Page 1 of 1

Firefox And Javascript

Posted: Sat Apr 16, 2005 5:23 am
by s.dot
These following two javascripts do not work in firefox. Maybe it's a user preference, or they are disabled for some reason.

Code: Select all

<script type=&quote;text/javascript&quote;>
<!--
if(parent.resetForm)
parent.resetForm();
//-->
</script>
And alert boxes.

Anyone know why?

Posted: Sat Apr 16, 2005 6:27 am
by feyd
check the Javascript console. I'd guess it's your html comments being in the wrong place(s)

Posted: Sat Apr 16, 2005 8:10 am
by s.dot

Code: Select all

<div id=&quote;contents&quote;>
<div><strong><a href=showme.php?u=<? echo $_COOKIE&#1111;'username']; ?> target=&quote;_blank&quote;><? echo $_COOKIE&#1111;'username']; ?></a>: </strong><? echo $message32; ?></div>
</div>
<script type=&quote;text/javascript&quote;>
<!--
  if(parent.insertMessages && document.getElementById(&quote;contents&quote;))
    parent.insertMessages(document.getElementById(&quote;contents&quote;).innerHTML);
//-->
</script>
<script type=&quote;text/javascript&quote;>
<!--
if(parent.resetForm)
parent.resetForm();
//-->
</script>
that is how it is inserted in my HTML, however there are a few php/sql queries/commands before and after this part.

Posted: Sat Apr 16, 2005 10:45 am
by SystemWisdom
Is parent referring to a frameset, or a sub-window?
If it is a frameset, then the frameset file must have the corresponding functions, maybe show them? If it is a sub-window, then you shouldn't be using parent, but rather window.opener..

Posted: Sat Apr 16, 2005 11:24 pm
by s.dot
The code I pasted above is inside of a hidden IFRAME, but the javascript needs to call to the main page (parent) to reset the form.

Posted: Sun Apr 17, 2005 6:44 am
by feyd
post a link to a live version.