Being beaten to death by jquery, uncover why jquery cannot use _javascript skills under Ie/firefox

Source: Internet
Author: User
Its projects are developed by ASP.net technology, still used WebForm as a front-end processing, but some features include jquery functionality, he encountered the problem is whether in IE or Firefox, including jquery, the part of the page function can not be used normally.


After Google search, the results can be summed up to 3 kinds:

The FSO feature is not enabled
High level of IE security settings
MSXML not installed
However, after the current project check, the above is not the problem, in the project with a test page, you can check whether the server side can be normal operation of jquery, content and the content of the jquery official web site:

Code
Copy Code code as follows:

<script type= "Text/javascript" src= "Js/jquery.js"/>
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("a"). Click (function () {
Alert ("Hello world!");
});
});
</script>
<body>
<a href= "#" >Link</a>
</body>

But in any case it is not in IE or Firefox to see jquery pop-up "OK" hint, I was embarrassed ... So I performed the following steps:

Download the latest jquery script to replace the version in the project
Check each line of JavaScript code
Check IE security settings, set to minimum
............
Did not see the effect, until today suddenly found that the page calls jquery's reference line is written in this way

<script type= "Text/javascript" src= "Js/jquery.js"/>

I'll change it.

<script type= "Text/javascript" src= "Js/jquery.js" ></script>

"OK" finally bounced out ...

But the problem has not ended, the project developer is in the master page contains jquery, the source code is as follows

Code
Copy Code code as follows:

<asp:scriptmanager id= "ScriptManager1" runat= "Server" >
<Scripts>
<asp:scriptreference path= "~/js/jquery.js"/>
</Scripts>
</asp:ScriptManager>

Check out the ASP.net official forum you can see the answer http://forums.asp.net/t/1377657.aspx, I add the Script control properties Enablepartialrendering= "true" and Enablescriptglobalization= "false" after all normal, so that the problem all resolved, the project successfully deployed.
Conclusion: Thank you for taking the time downstairs to read my article, but I have consulted the http://www.w3.org/TR/REC-html40/interact/scripts.html# on HTML references <script> scripts h-18.2.2.3, also did not find <script/> This writing is not in accordance with the definition of the specification, only to see the promotion as far as possible without closing the mark ">" But with "<" better (such as "Y < X" than "x > y" good).
See also the message, thanks again. But what I want to say is that this type of writing is only problematic in the ASP.NET environment, if you write <script src= ' ... ' type= ' text/javascript '/&gt in PHP. You can run and get results in Apache environment.

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.