JavaScript and client side scripting.
Moderator: General Moderators
s.dot
Tranquility In Moderation
Posts: 5001 Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana
Post
by s.dot » Sat Apr 16, 2005 5:23 am
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="e;text/javascript"e;>
<!--
if(parent.resetForm)
parent.resetForm();
//-->
</script>
And alert boxes.
Anyone know why?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Apr 16, 2005 6:27 am
check the Javascript console. I'd guess it's your html comments being in the wrong place(s)
s.dot
Tranquility In Moderation
Posts: 5001 Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana
Post
by s.dot » Sat Apr 16, 2005 8:10 am
Code: Select all
<div id="e;contents"e;>
<div><strong><a href=showme.php?u=<? echo $_COOKIEї'username']; ?> target="e;_blank"e;><? echo $_COOKIEї'username']; ?></a>: </strong><? echo $message32; ?></div>
</div>
<script type="e;text/javascript"e;>
<!--
if(parent.insertMessages && document.getElementById("e;contents"e;))
parent.insertMessages(document.getElementById("e;contents"e;).innerHTML);
//-->
</script>
<script type="e;text/javascript"e;>
<!--
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.
SystemWisdom
Forum Commoner
Posts: 69 Joined: Sat Mar 26, 2005 5:54 pm
Location: A Canadian South of the 49th Parallel
Post
by SystemWisdom » Sat Apr 16, 2005 10:45 am
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..
s.dot
Tranquility In Moderation
Posts: 5001 Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana
Post
by s.dot » Sat Apr 16, 2005 11:24 pm
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Apr 17, 2005 6:44 am
post a link to a live version.