Firefox And Javascript

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Firefox And Javascript

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

check the Javascript console. I'd guess it's your html comments being in the wrong place(s)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
User avatar
SystemWisdom
Forum Commoner
Posts: 69
Joined: Sat Mar 26, 2005 5:54 pm
Location: A Canadian South of the 49th Parallel

Post 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..
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

post a link to a live version.
Post Reply