Skip to main content

Browser support to JavaScript



Browser support to JavaScript

It is possible that a browser do not support JavaScript (generally older versions of the browsers). In such cases JavaScript will be displayed as the content of the webpage as explained above. To prevent them from doing this and as a part of the JavaScript standard you should use the HTML comment tag to "hide" the JavaScript. For this you need to add an HTML comment tag (end of comment) after the last JavaScript statement.

E.g.







Note: In the above example the two forward slashes at the end of comment line (//) are the JavaScript comment symbol. This prevents JavaScript from executing the --> tag. In case browser does not support JavaScript, the JavaScript code will not be displayed in the webpage as it is written inside the HTML comment tag.

Using JavaScript and HTML together

As you have seen that you can easily embedded JavaScript in a HTML document. Whenever you need to write JavaScript code you need to use



In the above example you find that the text to be written by the javaScript code is formatted using the header tags

and

.

On opening the above page in the browser you will get following output:


Placing JavaScript in a HTML document Before you exactly learn the syntax of javaScript you must know where you can write the javaScript code. JavaScript code can be inserted in the head tag as well as in the html document. You only require using


Writing scripts in the body section of a webpage: Scripts to be executed when the page loads go in the body section. When you place a script in the body section it generates the content of the page.








Note: You can place any number of JavaScripts in both the body and the head section of the document. Check out the following code:









In the above code javaScript has been written in the head as well as the body section of the document.

Linking a Webpage to an External JavaScript: It is possible that you may want to run a JavaScript in several pages without actually writing the same script again and again.. This can be done by making an external JavaScript file and linking it with the webpage. The external JavaScript file needs to be saved with a .js file extension. To use the external script you need to link to the external .js file by giving the file path in the "src" attribute of the





In the above code using the ‘src’ attribute of the script tag webpage has been linked to an external javaScript code. While executing this document browser will look for the ‘trial.js’ file to execute its code. You should be careful as the .js file does not include the

Comments

Popular posts from this blog

Advantages and Disadvantages of EIS Advantages of EIS Easy for upper-level executives to use, extensive computer experience is not required in operations Provides timely delivery of company summary information Information that is provided is better understood Filters data for management Improves to tracking information Offers efficiency to decision makers Disadvantages of EIS System dependent Limited functionality, by design Information overload for some managers Benefits hard to quantify High implementation costs System may become slow, large, and hard to manage Need good internal processes for data management May lead to less reliable and less secure data

Inter-Organizational Value Chain

The value chain of   a company is part of over all value chain. The over all competitive advantage of an organization is not just dependent on the quality and efficiency of the company and quality of products but also upon the that of its suppliers and wholesalers and retailers it may use. The analysis of overall supply chain is called the value system. Different parts of the value chain 1.  Supplier     2.  Firm       3.   Channel 4 .   Buyer

Big-M Method and Two-Phase Method

Big-M Method The Big-M method of handling instances with artificial  variables is the “commonsense approach”. Essentially, the notion is to make the artificial variables, through their coefficients in the objective function, so costly or unprofitable that any feasible solution to the real problem would be preferred, unless the original instance possessed no feasible solutions at all. But this means that we need to assign, in the objective function, coefficients to the artificial variables that are either very small (maximization problem) or very large (minimization problem); whatever this value,let us call it Big M . In fact, this notion is an old trick in optimization in general; we  simply associate a penalty value with variables that we do not want to be part of an ultimate solution(unless such an outcome is unavoidable). Indeed, the penalty is so costly that unless any of the  respective variables' inclusion is warranted algorithmically, such variables will never be p