Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:15
Milonic and Opera 7.54
Poster: mpappert
Dated: Saturday August 14 2004 - 20:13:56 BST
I have setup my Milonic menu and have tested it under IE6, IE6 wSP2, Firefox 0.9.3 and am now trying Opera 7.54 ... and the problem surfaces! LOL
In the other browsers the following line of code works (as a menu item):
Code:
aI("text=Send Feedback;url=javascript:popupWindow('http://www.mdocs.ca/feedback.htm','feedback',460,445,0,0,'yes','no','no','no');");
However, in Opera, this code is never even executed! At the entry point in the function I added a document.write('Entry Point'); and in every browser it displays this text, Opera however, it does not ...
Any suggestions?
Thanks!
M.
Poster: kevin3442
Dated: Sunday August 15 2004 - 4:06:40 BST
Hi M.
Can you post the code for the popupWindow() function?
I'm assuming its a wrapper for the window.open() method, and that the parameters are probably url, window name, width, height, top, left, scrollbars, resizable, etc... There are some attributes in the js window.open() method that are often used but that aren't recognized in all browsers (left and top for example). Of course, if the function isn't even entered, that wouldn't be the explanation. Then again, some browsers also handle document.write() differently... maybe try an alert() at the top of the function instead, just to be sure.
Kevin
Poster: mpappert
Dated: Sunday August 15 2004 - 5:28:40 BST
Hey Kevin,
I have done more testing and it definitely seems like its an Opera bug ... I've tried the alert and nothing. The code can be viewed here:
http://www.mdocs.ca/scripts/common.js
If I turn on the Opera javascript error window, it shows the following error:
http://www.mdocs.ca/scripts/common.js
Unknown context
Syntax error while loading (line 61)
-^
line 61 is the closing } of the popupWindow function ... so not sure why this error is being generated. I've tested it under IE6 (with and without SP2) and Firefox 0.9.3 without problems.
When I click the link, the following text is produced in the error window:
http://www.mdocs.ca/alpha_v1d814.htm
Javascript URL thread: "javascript:popupWindow('http://www.mdocs.ca/feedback.htm','feedback',460,415,0,0,'yes','no','no','n..."
Error:
name: ReferenceError
message: Statement on line 1: Reference to undefined variable: No such variable 'popupWindow'
Backtrace:
In unknown script
popupWindow("http://www.mdocs.ca/feedback.htm", "feedback", 460, 415, 0, 0, "yes", "no", "no", "no");
Not sure why it thinks popupWindow is a variable - I'm guessing for whatever reason, it's not linking the common.js file properly?
It's got me for now! LOL
Thanks!
M.
Poster: kevin3442
Dated: Sunday August 15 2004 - 10:11:19 BST
Hi M.
Looks like Opera 7.54 has decided to be a pain and not be as forgiving in parsing js code as some other browsers (or even as forgiving as it used to be... the error doesn't occur in Opera 7.20). Then again, it seems to me that Opera is always a pain about something
Anyways... thanks for the thorough post... definitely makes it easier to help. The problem is in the last line of code in the common.js file:
Code:
} <!-- End Function -->
There's js code and html code on the same line... the closing curly brace for the popupWindow() function is followed by an html comment. So, it looks like Opera never finished reading the function. Therefore, to Opera, the function (which Opera annoyingly calls a variable rather than an object) doesn't exist. If you move the End Function comment down to the next line, like so:
Code:
}
<!-- End Function -->
<!-- End Function -->
or if you leave it on the same line but put a // in front of the <!--, or if you get rid of it altogether, then the problem should go away.
Hope that helps,
Kevin