- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 6685 Articles for Javascript
![Johar Ali](https://www.tutorialspoint.com/assets/profiles/14293/profile/60_101691-1513053093.jpg)
179 Views
Before beginning with the difference, let’s learn what are Primitive Datatypes. Primitive defines immutable values and introduced recently by ECMAScript standard.JavaScript allows you to work with three primitive data types, Numbers, eg. 3, 310.20 etc.Strings of text e.g. "This text string" etc.Boolean e.g. true or false.JavaScript also defines two trivial data types, null and undefined, each of which defines only a single value. In addition to these primitive data types, JavaScript supports a composite data type known as the object.After datatypes, let us discuss about Objects:Objects In JavaScript, objects are considered a collection of properties. Identify properties using key values. It ... Read More
![Johar Ali](https://www.tutorialspoint.com/assets/profiles/14293/profile/60_101691-1513053093.jpg)
443 Views
The following are the difference between inline JavaScript and external file −External scriptsThe browser stores the external script once it is downloaded for the first time. If it is to be referenced again, then no additional download is needed.This reduces download time and size.The async and defer attributes have an effect. If these attributes are present the script will change the default behavior.Inline scriptsInline Scripts are executed immediately.It gets loaded instantly and there is no need to trigger another request.The async and defer attributes has no effect.Inline Scripts are more useful for server-side dynamic rendering.Read More
![Amit Sharma](https://www.tutorialspoint.com/assets/profiles/14294/profile/60_103411-1513053466.png)
982 Views
To avoid multiple server requests, group your JavaScript files into one. Whatever you use for performance, try to minify JavaScript to improve the load time of the web page.If you are using single page application, then group all the scripts in a single file.If you are using multiple files, then minify all of your scripts and separate them into categories.example - Place JavaScript to be used in every page. This can be the core script of the file. - Place your plugins hereRest, add other scripts in a JavaScript file. It’s good to maintain it in different files.Read More
![Ali](https://www.tutorialspoint.com/assets/profiles/14292/profile/60_101553-1513052445.jpg)
369 Views
Page load time gets affected with JavaScript files and code. If you are not optimizing JavaScript files then the page load time will increase, which shouldn’t happen. Minify the JavaScript code to decrease the page load time.Also, cache JavaScript file for better results. For better performance, use inline and external JavaScript properly. Try to use external JavaScript file if you want to add the same script in multiple pages.External scriptsThe browser stores the external script once it is downloaded for the first time. If it is to be referenced again, then no additional download is needed.This reduces download time and ... Read More
![Rahul Sharma](https://www.tutorialspoint.com/assets/profiles/14297/profile/60_102977-1513054044.jpg)
1K+ Views
To use the same JavaScript in more than one page, add the js code in an external JavaScript file. Let’s say the following demo.js is our external JavaScript file −function display() { alert("Hello World!"); }Now add the external JavaScript file to the following HTML web page. In the same way, you can add it to multiple content page.
![Johar Ali](https://www.tutorialspoint.com/assets/profiles/14293/profile/60_101691-1513053093.jpg)
283 Views
Let’s say the following line we have in our HTML −Here the browser identifies inline JavaScript by detecting onclick, even when tag wasn’t available.The following are some of the suggestions for using inline JavaScripts −You should consider inline script elements such as ...) if the script only to be used for a single page.Do not use event attributes such as onclick="...", and bind event handlers using JavaScript.Use external script elements such as ) for most scripts, especially if reused between pages.
![Amit Sharma](https://www.tutorialspoint.com/assets/profiles/14294/profile/60_103411-1513053466.png)
184 Views
JavaScript’s automatic semicolon insertion (ASI) is to insert missing semicolons. The following statements are affected by automatic semicolon insertion −empty statement var statement expression statement do-while statement continue statement break statement return statement throw statementThe rules are in the following specification −When, as a Script or Module is parsed from left to right: A token is encountered that is not allowed by any production of the grammar, then a semicolon is automatically inserted before the offending token only if one or more of the following conditions becomes true −Offending token is }.Previous token is ) and the inserted semicolon would ... Read More
![Rahul Sharma](https://www.tutorialspoint.com/assets/profiles/14297/profile/60_102977-1513054044.jpg)
155 Views
To disable resizable property, use CSS style −textarea { resize: none; }To disable specific textarea with different attribute values, try the following. Let’s say the attribute is set to “demo” −textarea[name=demo] { resize: none; }Let’s say the id attribute is “demo” −For the above,#demo { resize: none; }
![Johar Ali](https://www.tutorialspoint.com/assets/profiles/14293/profile/60_101691-1513053093.jpg)
78 Views
Nowadays, almost every web browser supports JavaScript. If it is turned off, you can use tag. To let users know about non-JavaScript web browsers, use the tag. The HTML tag is used to handle the browsers, which do recognize tag but do not support scripting. This tag is used to display an alternate text message.Example HTML noscript Tag Your browser does not support JavaScript!