weird JS error......

M

maya

pls see screen-shot here of errors as displayed in FF console:

www.mayacove.com/js/error.gif

"missing } in XML expression" ?????


function:

function getPhoto(loc,width,height) {
wdth = width;
hght = height;
var x = Math.round((window.screen.width-wdth)/2);
distX = (x < 0) ? 0 : x;
var y = Math.round((window.screen.height-hght)/2);
distY = (y < 0) ? 0 : y-20;
var params = 'statusbar=no,status=no,locationbar=no,menubar=no,'
params += 'resizable=yes,personalbar=no,favorites=no,toolbar=no,'
params += 'width=' + wdth + ',height=' + hght + ',top=' + distY +
',left=' + distX
params += 'screenY=' + distY + 'screenX=' + distX + ',scrollbars=no,'
window.open(loc,'win',params);
}

call to function:

<a href="#" onClick="getPhoto('photo.jsp',510,500)">


many thanks...
 
M

Martin Honnen

maya said:
pls see screen-shot here of errors as displayed in FF console:

www.mayacove.com/js/error.gif

"missing } in XML expression" ?????


function:

function getPhoto(loc,width,height) {
wdth = width;
hght = height;

Firefox 1.5 and later support E4X (ECMAScript for XML) so I guess your
script unintentionally has code that looks like the start of an E4X
literal. Instead of posting URLs to gif images with an error message
post the real URL of that script file and/or the HTML, then we can tell
you more as currently the context is missing.
 
M

maya

Martin said:
Firefox 1.5 and later support E4X (ECMAScript for XML) so I guess your
script unintentionally has code that looks like the start of an E4X
literal. Instead of posting URLs to gif images with an error message
post the real URL of that script file and/or the HTML, then we can tell
you more as currently the context is missing.

thank you very much, Martin.. actually this error was on pop-up itself,
it appeared in console once pop-up window opened.. so took out function
declaration (i.e., call to .js file that contains function) from that
page.. (although I still think mere fact that function declaration was
"visible" from code in pop-window itself should not have caused a
problem as long as code in pop-up window does not call function.. but
well.. this is a bit complicated b/c dealing w/JSP/Struts/tiles.....:)

thank you very much..
 
M

Martin Honnen

maya said:
thank you very much, Martin.. actually this error was on pop-up itself,
it appeared in console once pop-up window opened.. so took out function
declaration (i.e., call to .js file that contains function) from that
page.. (although I still think mere fact that function declaration was
"visible" from code in pop-window itself should not have caused a
problem as long as code in pop-up window does not call function..

There is something wrong with the code in the external script files, it
seems to contain a start tag e.g.
<script type="text/javascript">
which does not belong in a script code. Unless you wanted to use E4X.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top