Forums

This topic is locked

what does this mean? <a href="javascript:history.g

Posted 16 Jan 2003 05:49:13
1
has voted
16 Jan 2003 05:49:13 Kim Polley posted:
Hi again...

Does anyone know what this means?

&lt;a href="javascript:history.go(-1)"&gt;

Thanks

__________________________
B O H E M I A N_B E L L E
www.bohemianbelle.com.au

Replies

Replied 16 Jan 2003 06:02:49
16 Jan 2003 06:02:49 Owen Eastwick replied:
It creates a link which has the same effect as clicking the back button in the browser toolbar.

Regards

Owen.

---------------------------------------------------
Used programming books and web development software for sale (UK only):
www.tdsf.co.uk/Shop.htm

Multiple Parameter UD4 / Access 2000 Search Tutorial:
www.tdsf.co.uk/tdsfdemo/
Replied 16 Jan 2003 07:11:08
16 Jan 2003 07:11:08 Kim Polley replied:
Hi Owen

Thanks for that... I'm trying to change the code on a .php pop up (www.peaceatwork.com/tell_a_friend.html) so that when you select Submit it will close the popup but instead it keeps clearing it (which explains the back)... the form sends fine though.

I tried to change this line of code:
&lt;div align="center"&gt;&lt;a href="javascript:history.go(-1)"&gt;&lt;/a&gt;&lt;/div&gt;

to the self close code but it ignores it and just goes back to a blank form.. hmmm?


__________________________
B O H E M I A N_B E L L E
www.bohemianbelle.com.au
Replied 16 Jan 2003 12:59:43
16 Jan 2003 12:59:43 asp asp replied:
to close your pop-up use

javascript:self.close()

make this your link, or go to the behaviours pannel and select CALL JAVASCRIPT then put this

javascript:self.close()

Replied 16 Jan 2003 13:10:34
16 Jan 2003 13:10:34 Owen Eastwick replied:
I don't know PHP, so my example is in ASP, but the principal is the same, If you want to close the window after the Form submits:

Create a small transparent gif, a table or whatever then place it in a conditional region, something like:

&lt;% If Request("txtName" &lt;&gt; "" Then %&gt;
&lt;img src="MyImages/Transparent.gif" width="1" height="1" onLoad="window.close()"&gt;
&lt;% End If %&gt;

However, why not keep the contents of Your name:, Your e-mail address: and Include a personal message: and display a message "Would you like to send another", something like:

&lt;input type="text" Name="txtName" value="&lt;%= Request("txtName" %&gt;"&gt;
etc...

Then:

&lt;% If Request("txtName" &lt;&gt; "" Then %&gt;
Thank you, message sent. Would you like to send another:
&lt;% End If %&gt;

Regards

Owen.

---------------------------------------------------
Used programming books and web development software for sale (UK only):
www.tdsf.co.uk/Shop.htm

Multiple Parameter UD4 / Access 2000 Search Tutorial:
www.tdsf.co.uk/tdsfdemo/

Reply to this topic