Welcome to WebmasterWorld Guest from 54.145.208.64

Forum Moderators: open

Message Too Old, No Replies

getURL with Java not working in IE

   
10:55 am on Jan 25, 2010 (gmt 0)

5+ Year Member



Hi,

I have a problem with IE. The folowing code does not work in IE: getURL("javascript:handle_div()");

But the strange thing is that in FireFox and Chrome it works just fine.. So the javascript itself works just fine.
Any ideas?

5:25 pm on Jan 25, 2010 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome aboard ntfu, this doesn't work because javascript:anything is not a valid URL.

Second, the call the the Javascript is within Flash, so it's out of context/scope of the page.

You're going to have to craft this somehow so it passes the data to the page and is interpreted by javascript. One example might be

getURL("http://example.com/page.html?handle_div=1");

Then in your Javascript in a window.onload function, check if a value for handle_div exists, if is does, execute the JS within the page.

A more graceful one might be to use Flash's internal communication methods, flashVars or something, but nothing's coming to me at the moment.