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:41
Problems opening new window via javascript in IE5
Poster: ccaruso __at__ brainshark.com
Dated: Tuesday February 24 2004 - 19:49:44 GMT
OS: Windows 200 Professional
Browser: IE 5.00.3700.1000 (SP4)
URL: http://65.204.35.223/brainshark/test/test.htm
Description of Problem:
The above page is very simple. One href that calls a javascript function. The javascript function opens a new window.
On IE 5 browsers, the parent page (the one launching the window), goes into some sort of infinite loop after you click the href. The "title" section goes from "Milonic Test" to the url of the page. Plus, the mouse pointer turns to the hour glass.
If I comment out "DrawMenus()", the page works correctly.
Any help would be greatly appreciated.
- Chris Caruso
Poster: John
Dated: Tuesday February 24 2004 - 20:21:47 GMT
First things first...
You're way down-level. You are at RC38. We went through RC50 and are now at 5.03 final release. Upgrade.
Then, for me anyway, why didn't you use http://www.milonic.com/menusample11.php (and our JS calls as supplied)? Changing the code, whether it works or not, means you're running something we didn't supply, and that can make things tough.
Poster: ccaruso __at__ brainshark.com
Dated: Tuesday February 24 2004 - 20:41:49 GMT
Thank you for the quick response.
I have updated the code to the latest release.
I'm still having the same problem however.
I would definitely copy the sample code from menusample11.php but it doesn't seem to fit my needs. Sorry for being dense ... The only thing I want is an href that calls a javascript function that opens a new window.
Once I commit to using the Milonic Menu on a page (ie call drawMenus()), do I need to create href's differently?
Thank you again.
- Chris
Poster: John
Dated: Tuesday February 24 2004 - 21:00:01 GMT
Not to worry. Tuesday is "dense-day", and now it's my turn...
This...
Code:
aI("text=Open Google;url=http://www.google.com/;target=_new;targetfeatures=width=300 height=300;");
...will open a new window, 300x300, etc. Other normal features can be added to the string - toolbar, status, etc.
What am I missing?
Poster: kevin3442
Dated: Tuesday February 24 2004 - 21:53:18 GMT
I suspect it's your syntax:
Code:
<a href="javascript:void(onSendReq())">Send New Request</a>
I ain't no syntacticalic expert or nuthin', but it seems to me that the only reason for that syntax would be to cancel the default action of the link.... i.e., loading an href. it should be fine, but IE5 is apparently picky. Instead, you could try the following alternatives:
Code:
<a href="javascript:void onSendReq()">Send New Request</a>
--or--
Code:
<a href="javascript:onSendReq()">Send New Request</a>
--or--
Code:
<a href="http://www.yahoo.com/" target="_blank" onclick="onSendReq()">Send New Request</a>
(used yahoo because that's what's in your example function)
--or--
Code:
<a href="javascript://" onclick="onSendReq()">Send New Request</a>
Make sense?
Kevin
Poster: ccaruso __at__ brainshark.com
Dated: Tuesday February 24 2004 - 21:55:04 GMT
But the link I'm referring to isn't part of a menu!
It's just a standard, run of the mill, everyday href that calls a javascript function.
It would be similar to changing the "Download Version 5 Here" link on http://www.milonic.com/menusample11.php. If you changed that link to call a javascript function and that function opened a new window. Instead of:
Code:
<a href="/download.php?sampleid=11"><img src=/images/download.jpg border=0></a>
I want:
Code:
<a href="javascript:myFunc()">"><img src=/images/download.jpg border=0></a>
where myFunc is defined as:
Code:
function myFunc() { window.open("http://www.yahoo.com") }
Thanks,
Chris
Poster: John
Dated: Tuesday February 24 2004 - 21:57:26 GMT
Then the next obvious question becomes (not trying to be snotty) - if the link has nothing to do with the menu system why are you asking for help here
Poster: kevin3442
Dated: Tuesday February 24 2004 - 21:57:42 GMT
Hi Chris
It looks like my reply made it in just before yours. I get the impression that you hadn't seen my previous reply before posting yours?
Kevin
Poster: ccaruso __at__ brainshark.com
Dated: Tuesday February 24 2004 - 22:10:28 GMT
Success!
The following worked:
<a href="javascript://" onclick="onSendReq()">Send New Request</a>
Thank you both very much for your assistance.
- Chris
[/b]
Poster: ccaruso __at__ brainshark.com
Dated: Wednesday February 25 2004 - 16:00:10 GMT
Sorry to bother you again ...
I am still having IE5 problems using the Milonic menu system.
The following web page does not work in IE5:
http://65.204.35.223/brainshark/test/test.htm
After clicking the item in the sub-menu, th eparent page appears to reload (ie the <title> filed goes back to the url and the cursor turns to an hour glass). This is only happening in certain IE5 browsers. It does not happen in IE 4 or IE 6.
Could someone take a look at this page and see if they see the problem?
Thank you!
- Chris