-1

I'm using jQuery in jsf pages and I have an issue with IE

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

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
Kurohige
  • 333
  • 2
  • 10
  • Could you translate the errors into English? (Or change your browser settings to English and recreate the error?) – Swadq May 02 '13 at 07:28
  • 2
    You seem not to have jquery. In case you have you will be able to log `$.fn.jquery`. The fact is others browsers than IE have a global `$` variable but if you don't load jquery `$` is not jquery – atondelier May 02 '13 at 07:29
  • That message is telling you `$` is undefined. Make sure you include jQuery. – jahroy May 02 '13 at 07:30
  • 5
    In fact, '$' is undefined. It looks like you haven't included jquery on your page properly: `` – Swadq May 02 '13 at 07:30
  • I'm using jquery as well and it's work in other navigators, I'm reusing primefaces Jquery with jsf pages – Kurohige May 02 '13 at 07:58
  • messages are clear without translating in english, first char in the specified line means '$' is undefined – Kurohige May 02 '13 at 08:01
  • 2
    just to be sure, can you check if the error still there with: `jQuery( document ) ...` ? the `$` shortcut can be disabled. – BiAiB May 02 '13 at 08:15
  • same issue using jQuery – Kurohige May 02 '13 at 08:32

2 Answers2

1

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 .

take a look at this link : how to use jquery with primefaces

Community
  • 1
  • 1
Genjuro
  • 7,405
  • 7
  • 41
  • 61
1

@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>

in my case my main jsf page call two iframe.

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

both iframe and the main page include the same js file :

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

my problem is solved by deleting unused js in the two iframe

thanx

Kurohige
  • 333
  • 2
  • 10