简体   繁体   English

IE的jQuery错误

[英]jQuery errors with IE

I'm using jQuery in jsf pages and I have an issue with IE 我在jsf页面中使用jQuery,但是IE出现问题

Message : '$' is undefined
Line : 1
character : 1
Code : 0
URI : .............../js/test.js.jsf

the script begin with $.extend($.expr[':'], { 脚本以$.extend($.expr[':'], {

normaly if you use the jsf import <h:outputScript library="primefaces" name="jquery/jquery.js" /> , jsf garantees that the script is only imported one time , IE isn't tolerent to duplicate script import . 通常,如果您使用jsf import <h:outputScript library="primefaces" name="jquery/jquery.js" /> ,则jsf保证该脚本仅被导入一次,IE不容许重复脚本导入。

take a look at this link : how to use jquery with primefaces 看一下此链接: 如何将jquery与primefaces一起使用

@FrozenFlame thank you for your help, you are right but I don't know why <h:outputScript.. is imported twice when it is used in multiple referenced <iframe> @FrozenFlame感谢您的帮助,您是对的,但我不知道为什么<h:outputScript..在多个引用的<iframe>使用时会被导入两次

in my case my main jsf page call two iframe. 就我而言,我的主要jsf页面调用了两个iframe。

<iframe name="test1" src="test1.jsf" />
<iframe name="test2" src="test2.jsf" />

both iframe and the main page include the same js file : iframe和主页都包含相同的js文件:

<h:outputScript name="js/test.js" />

my problem is solved by deleting unused js in the two iframe 通过删除两个iframe中未使用的js解决了我的问题

thanx 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM