Forum Moderators: open

Message Too Old, No Replies

IE6 Issue

window.location and object.submit() problems

         

Sekka

12:59 pm on Mar 29, 2007 (gmt 0)

10+ Year Member



Hi,

I have just finished some IE 6 testing for a control panel I'm making. Since when did "window.location" and "window.location.href" both stop working in IE6?

This is my JS function,

function con (msg, url) {

// Check
if (msg == null) { return false; }
if (url == null) { return false; }

// Do
var con = confirm (msg);

// Check
if (con) {

// Go
window.location = url;

}

}

Some things to know,

1) The code inside the if (con) { ... } is deffo running, I put an alert in there.
2) I have tried my current URL method "/some/page/" and a full URL (with the [)....]
3) This works fine in IE7, FF, Camino, Safari.
4) I have tried both window.location and window.location.href.

Anyone?

Also, just done some further testing and none of my functions with formobject.submit() work either. Again, anyone?

Update

More investigation has found the problem.

My links are,

<a href="javascript:void(0);" onclick="<function_call>">

Yes, I know they aren't very accessable, etc, but why does moving the onclick code into the href property make it all work?

Sekka

1:05 pm on Mar 29, 2007 (gmt 0)

10+ Year Member



Appears I figured out my own problem.

For anyone else with the same issue, the code in the href property of the link was stopping the function running.

Solution,

<a href="javascript:void(0);" onclick="<function_call>; return false;">