Defer property causes a page that references jquery "The browser cannot open the site xxx, the operation is aborted" the wrong solution _javascript tips

Source: Internet
Author: User
jquery is used in an ASPX page, but when the IE6 browser opens the page, it reports "Internet Explorer cannot open the Internet site http://localhost:9001/ Index.aspx. Operation aborted "error, then the page can not be viewed normally. This problem is not available if you use IE7 or IE8.


All JS scripts are commented out using the "<!---->" tag (this may cause problems, but at least you can browse this page). One by one, the problem was found:

Copy Code code as follows:

<script src= "Jquery/datepicker/wdatepicker.js" type= "Text/javascript" ></script>



is a problem caused by this line of statements, and the page will be able to navigate after this row.

Query discovery is a reference to the JS script to manipulate a page element that has not yet been loaded, so it is good to solve the problem, the <script> script added "defer" properties, the page can be viewed normally.

Copy Code code as follows:

<script defer= "defer" src= "Jquery/datepicker/wdatepicker.js" type= "Text/javascript" ></script>


Resources:

Defer properties in script
If you are a person who cares and cares about system performance, I think you should be interested in the defer attribute in script scripts.
The defer property in the script is false by default. According to the description in the DHTML programming book, this is true for the defer property:
Using the attribute at design time can improve the download performance of a page because the browser does not need to par SE and execute the script and can continue downloading and parsing the page instead.
In other words: If you are writing a script to add the defer attribute, then the browser does not have to process it immediately when downloading the script, but continues to download and parse the page, which will improve the performance of the download.
There are many kinds of situations like this. For example, if you define a lot of JavaScript variables, or if you write a lot of scripts in a reference file (. inc) that you need to deal with, you might want to add the defer attribute to these scripts to help improve performance.
Examples are as follows:
<script language= "JavaScript" defer>
var object = new Object ();
....
</script>
Because the defer property defaults to False, <script language= "JavaScript" Defer> explicitly declares the defer attribute is equivalent to <script language= "javascript "Defer=true>
Once you have declared the Defer property, you need to decide if there are other variables that refer to the variables in the defer script block, otherwise it can cause a script error to occur.

I looked up, the stars to give light to those who look up ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.