How do I validate HTML with Javascript? [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I would like to verify that a string is valid HTML, like the W3C Service does. I specifically don't want any browser corrections (like closing open tags), which precludes options that create DOM elements and read the HTML from them. It will run very frequently, so I really need to run it locally. Libraries are OK, jQuery is OK.
Edit #1: I'm asking about HTML validation, not form or input validation.
Edit #2: What I need is basically a Javascript implementation of the Nu HTML Checker.

Provided you're running node.js or python on the server side you can use a library like html5-lint by Mozilla to do all the heavy lifting for you. And for the java world there is a similar library jtidy and there are countless of similar libraries out there.

Related

How to fire up a javascript function with Java [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I am currently getting some data from a website and I need to use java to fire up a javascript function without clicking the corresponding button on the HTML, the HTML of that button looks like this:
<a class="d-info" href="javascript:downXml(12449086,'2.Some Video names');">XML</a>
the script is not embedded in this HTML so how to deal with this situation, thank you so much!!
The details that you have provided is not enough but assuming that you're trying selenium or JSoup like library to automate or to scrape the web page details. checkout some selenium automation scripts how that is doing the job. You can pick DOM elements and automate the real scenario.

Form validation - in terms of conciseness [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have a form on a website I wish to validate. It is a simple enough Bootstrap 3 marked up form. Please see the image below.
As you can see it's nothing too fancy...
In terms of validation what is the right way to write concise code that serves the designated purpose? For instance if I were to have 20 fields, is it appropriate or considered okay to have isset used on every posted variable?
Typically best practice is to have both client-side and server-side validation, so I think the best answer is both.
This is important because, if you just have client-side (JS) validation anyone can go into DevTools and change your form around to avoid the validation rules. This is especially try for spam bots which look for these types of exploits.
Having server side validation in conjunction with your client side solution can ensure quality data being passed into your database.
Hope this helps.

Default path of database in a bootstrap website? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
My Boss just gave me a website of his friend so the developer that build it was fired and i need to access the data base to change things.
The Website is developed using Bootstrap and I never used it Before where do I find the definition of the database connection help please.
Nowhere.
Bootstrap is a collection of CSS and (client-side) JavaScript.
It isn't a traditional, server-side MVC framework (or anything else that would fulfil a similar role) and doesn't do anything that would involve a database.
Bootstrap might be used in the output of a View from such a framework, but that's handled at a different level in the codebase.

How to get the data I need from airbnb web page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to get the dates booked and price from the the airbnb page: https://www.airbnb.com.sg/rooms/2781352 under the "Calendar" tab of it.
I am quite newbie to this, and I want to python to do that, can I?
And what else should learn, javascript, PHP?
For extracting data from web pages, my first stop is Beautifulsoup. It is designed for just this purpose, and is excellent at it. Combine it with the great requests HTTP library (so much better and easier than urllib/urllib2/etc.) for getting the pages.
Both of these are Python modules, there is no need to learn any other programming languages to do it, although it greatly helps to have an understanding of HTML and DTDs (Document Type Definitions) for setting up paths.

How can we find whether default JavaScript file working on rails 2.3.8? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
how do I find whether default JavaScript file working or not?? Can same one give me small code example for this ??
If you are using Ruby on Rails version 2, a quick way to find this out is to browse the source of your web page. The line where your javascript is, should end with a question mark and a number.
For instance, if you are using the default name application.js, open your webpage source and check if it looks like this:
http://www.example.com/javascripts/application.js?1311166541
The ?1311166541 tells you that your javascript was found and it's loaded by the page.
If it's still not working, the problem is inside your javascript file and it has nothing to do with Ruby on Rails.
If you are using Rails 3, there will not be a number after the filename, but just before the .js. Something like /assets/application-447c72e0609e769e6d9601ff3e930fdc.js. The principle is the same.

Categories