Problems opening new window via javascript in IE5

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
ccaruso@brainshark.com
Beginner
Beginner
Posts: 5
Joined: Tue Feb 24, 2004 8:20 pm

Problems opening new window via javascript in IE5

Post by ccaruso@brainshark.com »

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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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://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.
John
ccaruso@brainshark.com
Beginner
Beginner
Posts: 5
Joined: Tue Feb 24, 2004 8:20 pm

Post by ccaruso@brainshark.com »

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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Not to worry. Tuesday is "dense-day", and now it's my turn...

This...

Code: Select all

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?
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

I suspect it's your syntax:

Code: Select all

<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: Select all

<a href="javascript:void onSendReq()">Send New Request</a>
--or--

Code: Select all

<a href="javascript:onSendReq()">Send New Request</a>
--or--

Code: Select all

<a href="http://websites.milonic.com/yahoo.com/" target="_blank" onclick="onSendReq()">Send New Request</a>
(used yahoo because that's what's in your example function)
--or--

Code: Select all

<a href="javascript://" onclick="onSendReq()">Send New Request</a>
Make sense?

Kevin
ccaruso@brainshark.com
Beginner
Beginner
Posts: 5
Joined: Tue Feb 24, 2004 8:20 pm

Post by ccaruso@brainshark.com »

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://milonic.com/menusample11.php. If you changed that link to call a javascript function and that function opened a new window. Instead of:

Code: Select all

<a href="/download.php?sampleid=11"><img src=/images/download.jpg border=0></a>
I want:

Code: Select all

<a href="javascript:myFunc()">"><img src=/images/download.jpg border=0></a>
where myFunc is defined as:

Code: Select all

function myFunc() { window.open("http://www.yahoo.com") }
Thanks,
Chris
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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 :?: :?
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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
ccaruso@brainshark.com
Beginner
Beginner
Posts: 5
Joined: Tue Feb 24, 2004 8:20 pm

Post by ccaruso@brainshark.com »

Success!

The following worked:
<a href="javascript://" onclick="onSendReq()">Send New Request</a>

Thank you both very much for your assistance.

- Chris
[/b]
ccaruso@brainshark.com
Beginner
Beginner
Posts: 5
Joined: Tue Feb 24, 2004 8:20 pm

Post by ccaruso@brainshark.com »

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
Post Reply