How To Go Back
Jul 20, 2005I want to enable a href back button using JavaScript This does not work.....
<A HREF="javascript:if (window.back) window.back()">Back to previous
page</A><br>
I want to enable a href back button using JavaScript This does not work.....
<A HREF="javascript:if (window.back) window.back()">Back to previous
page</A><br>
I'm looking to have a lightbox pop up when a user clicks the Back button in their browser rather than just navigating back. The purpose is to ask a question with a Yes/No answer, and if they click No, I allow them to go back. The only thing I've found anything like this is the onUnload event, but that doesn't prevent them from going back. How should this be handled?
View 1 Replies View RelatedI am trying to write a script that uses the IF statement to see wether or not a user clicked the back button to come to a page, and then if it's true to not let the page load and kick them back X number of pages (say 4) This is what I have so far:
<script language="JavaScript"><!--
if javascript:window.history.back == 1
{
javascript:window.history.back(4);
return false;
}
//--></script>
I have a webpage popup (lets call it POPUP) which refreshes the opener window (this one we call PARENT) when we close it, saying we want to save data. For this, we use
top.oWndOpener.refresh();
When we don't want to save the POPUP data, we just close the popup and
don't refresh the PARENT. In the PARENT we have a "Back" link which executes a simple
history.back()
The problem is:
If we refresh parent, we need to go back 2 pages, because the refresh
method adds another page to the history. But we have no (easy) way of
knowing in the PARENT if it had been refreshed. With this, our users
are forced to click two times in the Back link.
Is there anyway of going back to the previous page, no matter how many
refreshes happened in the current one ?
I have been trying to utilize a pre existing snippet of JS that makes a call to some PHP, where the PHP echo's out the answer, namely a dynamic quick search output, that gains its data from an xml file (which works as expected) and thought I might be able to rework the code to work for my altered purpose (which has been a disaster at every attempt) which is as follows:
1. I have a JS file called call4section.js - JS that has a string (str) value assigned (could be number or a combination of numbers and letters) which is passed to a PHP script called call4section.php.
2. The PHP script takes receipt of the string and finds a match within an XML file for the entry under <reference>.
3. The XML file has a format as follows:
<pages>
<note>
<section>value</section>
[code]....
And well, I dont seem to be able to get any further forward with it. Effectively, I can echo out the $reply (if it worked I think), but my stumbling block is sending the starting string, with the JS expecting some reply sent from the PHP.
I am trying to capture the back button and redirect if it is a certain URL, if not just go back like a normal back button.I've never really messed with the history except for something like this: <a href="#" onClick="history.go(-1)">Anyone have an example using this plugin: [URL]r any other plugin that might achieve this
View 1 Replies View RelatedI am wondering how Back, Forward browser button works for iframes. Does it bring back/forward iframe or top window? I remember I had before a problem because I wanted to bring back iframe and not top window as it did. But today I tested my Facebook app and was surprised to see it works as I need which means it brings back/forward iframe window and not top. Is it possible that Facebook has some javascript code which does that or is this normall behaviour?
View 4 Replies View RelatedI can use the following code to create an HTML table based on an XML document. However, I would like to pass the onreadystatechange event a callback function (with arguments) to process the XML document. This way I can effectively remove the processing of the document from the event handler.Alternatively, is there a way the event handler can return a reference to the document, so that I can then parse it externally to the event handler?
Code:
function LoadXMLDoc(url) {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
[code]...
I have a site with two frames. In the top frame i have a link with this href: javascript:window.parent.frames['main'].history.back()
And this should make the bottom frame (main) go one history back, but it only works in Firefox but not in Internet Explorer...
i need to make a link called "back" to get the browser back 1 page
View 8 Replies View RelatedI have a form with a "Print" button on the page. When the user clicks this it doesn't actually print but opens a condensed version of the page, passing the field contents with php. On the new (condensed) page I capture the load of the page in js and when it occurs issue the command print(). This works fine.
But once I've done this (printed) I would like to return to my original form. I've tried
if (print()) history.back()
print()
history.back()
neither seems to work. As an experiment I put the following code at the bottom of my condensed page that prints...
<FORM>
<INPUT type="button" value="Click here to go back" onClick="history.back()">
</FORM>
Clicking on the resulting button does exactly what I want... clears the form and returns me to my original.
I just don't what to
a) print the form with that button on it
b) require user input after the printing.
So... can anyone point me in a way of making history.back() work outside of an onClick construct?
I used <input type="button" value="Back to Correct" onclick="window.history.back();"> to go back to the previous page is working, but if i use the as below instead, it does not work. what did I do
wrong?
I want to know, is there any other methods other than history.forward(), to disable back operation in HTML using javascript.
View 1 Replies View RelatedI have a graphic with a rollover for site navigation on each page. I
put the page to go back to in the rollover javascript.
My question is, is it possible to put in some code that will refer the
visitor back to whatever page they came from rather than one I
specify?
The rollover is combined with a tooltip script to make matters fun
(below). However, I'm quite happy to lose the tooltip to have the link
perform as a back button.
<a href="../index.asp"
onmouseover="document.images['link1'].src=img2.src;
showtip(this,event,'Back to home page');"
onmouseout="document.images['link1'].src=img1.src; hidetip()";><img
src="bhome.gif" name="link1" border=0></a>
Iw ant to disable the back button and the cache functionality of
Internet Explorer, How do I, do it?
By pressing a button I am directed from one page to another. At the second
page some things displayed on the first page are changed and now I want to
go back to the first page again. The pages are written in php.
If I use javascript:history.back() I get back to the first page but I have
to manually reload it to see the changes I have made.
The solution could be:
echo "<meta http-equiv="refresh"
content="0;url=firstpage.php?op=view&id=$id&...&...&....">";
But I have to do a lot of work to get all the options (e.g. op=view&...).
Is there anyway I can use javascript to go back to the first page and force
it to reload, so that I don't have to reload it my self?
Or is there some way I can read out what is in javascript:history.back() so
that I could place it in the above mentioned solution? It doesn't seem to
work if I just do the following:
echo "<meta http-equiv="refresh"
content="0;url=javascript:history.back()">";
I'm rookie when it comes to Ajax and jQuery an..The following url produces an xml-file that I want to use on my page:When I use firebug it seems like nothing comes back. What have I done wrong?
This is what my code looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
[code]....
I have some jQuery
Code:
$(document).ready(function(){
$("#qty$_GET").change(function(){
var firm = $('#firm$_GET').attr('value');[code]....
if there's a way to prompt me with the value of data just so that I can validate the link that's going to go through with this?
if have this in a required text field:
Code:
onblur="javascript: return verify(SignUp.LName.value); return false;"
and this is the function:
[code].....
I've written a script that displays tooltips when your mouse hovers over a link - all this is fine, but when I click on the link and move to another page, then click the back button on the browser to go back, the tooltip for the link I clicked is still visible! It'd be great if there was a way of detecting the button had been pressed so that I can hide it...
p.s. I tried onclick = "tooltips.hideToolTip(4); return true;" for the links but no joy...
I'm attempting to use the javascript 'history.go(-1);' to make a page automatically return to the last page a user visited. At the moment, I can get this to work ONLY if I insert a link into the page.
What I want to happen is, the page autmatically sends the user back to the previous page after a set time. I have this for my JS:
function backtomusic() {
window.location = history.go(-1);
}
And in the body section of my page I have:
<body onLoad="setTimeout('backtomusic()', 3000)">
When it runs I get an error saying 'undefined' in the browser address bar
Any ideas?
how do i make the page go all the way to the top after you press the back button?
for example, you would go to page 1 and you scroll mid-way, then you press a link to page 2. then you press the back button on page 2 and takes you back to page 1 but it brings you back to the section where you scrolled mid-way.
is there any way to make it so it will automatically bring you to the top of the page. ive seen it on other sites.
document.cookie="yourdrive="+driveletter+"; expires="+"; path=/";
document.cookie="maindrive="+menuletter+"; expires="+"; path=/";
They end up looking like this in the cookie:
yourdrive E ~~local~~/ 1088 647360864 29848791 647360864 29848791 * maindrive C ~~local~~/ 1088 647360864 29848791 647360864 29848791 *
So they must be being set. I must have tried a dozen cookie reading routines and I can't read either of them back! Can anyone do it? I am sure it must be simple. But all I get is "false" all the time. Code:
i need go to back page using history.back() but this page dont refresh, i need this
how ican refresh the back page?
Have a slideshow navigation and want to put a DOM onubtrusive JS that finds the <a> in <li id="nav-back">and executes history.back() with a onclick handler. No worry about JS disabled because then I use a other link that is hidden when JS is enabled ...
Some questions-ideas
What do i need to put in the <a href="??"> of <li id="nav-back"> ?
And the script I started see below, should it be written like that ??
History.back() works perfectly cross-browser in DOM capable browsers ??
This is the HTML
<div id="navwrap">
<ul id="nav">
<li id="nav-prev"><a href="#" title="go to previous image">previous</a></li>
<li id="nav-back"><a href="#" title="go to overview of images">back to overview</a></li>
<li id="nav-forward"><a href="#" title="go to next image">next</a></li>
</ul>
</div>
Is this how to do go about it
if (!document.getElementbyId) {return;}
var backButton = document.getElementbyId('nav-back').document.getElementBytagname('a')
backButton.onclick = history.back();
}
Is it possible to show in the title tag that last history entry ?
i'm trying to find a way to reset the back button so when incrementing through my forms the users can't acidently go back to a previous page
View 8 Replies View Related