Forum Moderators: open

Message Too Old, No Replies

Simple Flash to JS works in FF, not IE. go figure.

3 lines of code and IE won't let it work.

         

Duskrider

5:08 am on Jun 21, 2007 (gmt 0)

10+ Year Member



I'm beginning to really hate how IE treats JavaScript Errors.

So I'm working on this Flash Captcha Script and everything is going along just peachy like. I've got the flash file working properly, creating my code phrase, and then MD5 encrypting it. The encrypted string is what I'm putting out to my page so the registration script can verify the poster is human.

I fired it up in Firefox and with a couple of simple tweaks it works like a champ. Run the same script in IE and get an error. Bah.
I've checked the Error Console in FF and get nothing related to my script. Here's the code.

In the Flash Movie:
//key is the md5 encrypted version of my access code.
getURL("javascript:setKey(\""+key+"\")");

On the page:
<script type="text/javascript"><!--
function setKey(md5key) {
document.register.key.value = md5key;
alert(md5key);
}
//-->
</script>

There's one other function in there that's for opening a window... never given me a problem.

IE gives me two different types of errors randomly, and the first type hits on a random character:
Line:1
Char:10 <-- this is random from about 8 to 15 or so
Error: Expected ')'
Code:0

OR

Line:1
Char:1
Error: 'cfe8527ead7aeed4688fc01961c18267' is undefined
Code:0

I've tried changing the type of quotes in the flash movie from single to double and back, and I've also tried commenting out everything inside the function, both to no avail.

Anyone see anything I'm missing?

colandy

8:07 am on Jun 21, 2007 (gmt 0)

10+ Year Member



Assuming IE gives an error most of the time, try sending un-encrypted data from flash and see if that works. I'm just wondering if the encrytped key has some characters that JS is interpretting as something else.

vincevincevince

8:21 am on Jun 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



getURL("javascript:setKey('"+key+"')");

DrDoc

8:25 am on Jun 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



... or even:

getURL("javascript:setKey(\\\""+key+"\\\")");

I don't see how that would work in FF, though, as the code, as written, should produce a parse error like the one you described.