Skip to main content

runtime error jmaki undefined

1 reply [Last post]
algorithm
Offline
Joined: 2007-04-24
Points: 0

hi,
i'm using eclipse 3.2 and myfaces and installed jmaki plugin using eclipse. i have no problem using the fisheye list but once i added the following code, it gives me a runtime error stating jmaki is undefined.

function fisheyeListener(item) {
var targetDiv = document.getElementById("newpage");
var responseText = "";
var index = Number(item.index);
switch(index){
case 1: // Set responseText equal to Jayashri's bio
break;
case 2: // Set responseText equal to Roberto's bio
break;
case 3: // Set responseText equal to Greg's bio
break;
default: responseText += 'Click on one of the photos above';
break;
}
targetDiv.innerHTML = responseText;
}
jmaki.subscribe("/fisheye", fisheyeListener);

the above code is taken from http://blogs.sun.com/jenniferb/ .
it seems that the line jmaki.subscribe("/fisheye", fisheyeListener); is where the error is occuring, but i cant seem to identify the excact error. can anyone help me out?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31
Points: 0

Hi,

This script block needs to be defined *after* the first tag is included in the page. The first tag is what causes the jmaki.js to be loaded which has the jmaki.subscribe function on it.

It might be easiest to put that code in the glue.js file (which is loaded after the jmaki.js).