Iframe History.length Query ?
Feb 15, 2012
I have been playing around with the history.length property in JavaScript and have come across a bit of a problem I don't understand.
On my localhost machine I have two pages - Page A and Page B that both have one line of script being:
When I load new browser tab and open page A the page says I have 1 URL in history. I then open page B in the same tab and it says I now have 2 URLs in history list. Thats fine.
However, I then tried using iframes. I created an iframe with src to Page A and then changed the src of the same frame to Page B. The problem is instead of returning value of 2 (i.e. Page A and Page B) it says only 1 URL in history list but I opened two pages in the same iframe?
<body>
Does the history.lenght property have to be accessed differently for the iframe history something like document.getElementById('myframe').history.lenght ?
View 1 Replies
ADVERTISEMENT
Oct 7, 2011
Im trying to use javascript history to resize an iframe when a submit button is clicked inside the iframe.
This is what i found so far.
Code:
Us this with iframe:
Code:
Code:
But im not really sure on how to apply this to my iframe, and i know that the resize part also needs to be edited, but what is missing?
View 1 Replies
View Related
Feb 7, 2011
Is there a way you can control history on a specific iframe?
Let say you have these file
index.html
a.html
b.html
As you can see it's just very simple page w/ 2 frames. I created 2 button that is specific to iFrame's history but... it does not work... Yes, it does perform "back" but at the the "top" level and not at specific iframe.... I tried this on both firefox and chrome..same behavior..
View 2 Replies
View Related
Jun 14, 2007
I want to know the length in pixels of a document embedded in a iframe.
The way I go seems to work under IE but not under Firefox (about other
browsers I'll see later). Code:
View 3 Replies
View Related
Oct 6, 2007
How do I find the length of page in target iframe?
I am looking for the code or give me idea to find the length
View 4 Replies
View Related
Dec 4, 2005
Is there a way to obtain the last page visited? I don't want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?
View 20 Replies
View Related
Feb 24, 2005
I'm having a bit of a problem with IE and the history.go(-1).
I have script in php that adds a new vehicle to the DB. Before adding it checks to see if all fields are populated. If not it displays an error message and then provides a back button in the form of an submit button and onclick="history.go(-1);return false;
In IE when I click back I get an error message ... see attached screen dump.
I click ok and then click back ... it says the same error message.
I click the back button once more and it then takes me 2 pages back from the current page.
I dont experience the same problems in Firefox ... all works great.
I also have header("Cache-control: private"); //IE 6 Fix set at the top of the page.
View 10 Replies
View Related
Jul 20, 2005
We use a three-window frameset for online manuals. The "main" window
contains our document. Since the documents have hyperlinks between
them for related topics, we have "return" links built into a
navigation bar on some of the pages. Most of the time these work
fine, but if the person clicked on the top or left frame before
clicking on the "return" link, the wrong frame is changed.
Does anybody know how to alter the script so that only the main
document window is in focus? Here's the script we use in the page:
<a href="javascript:history.go(-1);">Back</a>
By the way, this is for a company Intranet - with all users on IE5.5
as a minimum.
View 1 Replies
View Related
Jul 24, 2001
is there neway using javascript that you can detect if a vistor has clicked a link?
the reason i ask is that i need to make only certain links on an area of a page to be a certain color if they have been linked, but other ones remain unaffected. i only have control over a few links, as it is an asp application for someone to download and have inside their pages
View 7 Replies
View Related
Aug 3, 2007
I 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?
View 2 Replies
View Related
Jun 2, 2002
I just finished adding a purchased shopping cart to a site and it's part php and part javascript.
The first problem is this little piece of code:
<A HREF="javascript:history.go(-1)">Back<A>
It works fine in IE6 but, wil only work once in Netscape6.2...What gives?
View 3 Replies
View Related
Jul 23, 2005
I have an Apache PHP enabled webserver and want to know from where users are coming from.
Understand I want the last surfer's browser visited url. I imagine I can do this with some kind of interraction between 2 scripts : one client side, one server side. The client one send the URL and the server one write it in the right log file....
View 4 Replies
View Related
Jul 23, 2005
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?
View 1 Replies
View Related
Aug 4, 2005
I search for a way in javascript to prevent browser from caching my
HTML page in its "history" and "temporary files" if there is any .
View 1 Replies
View Related
Mar 7, 2007
I have a one-page site that uses 4 different links to show or hide 4
different content DIVs. Because each piece of content isn't a
separate page, a user who clicks the back button after clicking one of
my links will be taken away from my site. Is there a way for me to
use a JavaScript function to write a history entry each time they show/
hide a layer so that if they do click the back button they aren't
navigating away from my site? I've noticed that this only affects
Internet Explorer...I do not need this for FireFox.
View 1 Replies
View Related
Aug 3, 2009
Is there any way to get browse history list ? with java script ?
View 3 Replies
View Related
Jan 11, 2007
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?
View 1 Replies
View Related
Nov 15, 2007
I want a page should not maintain history.what code in javascript.
View 1 Replies
View Related
Nov 21, 2007
i need go to back page using history.back() but this page dont refresh, i need this
how ican refresh the back page?
View 2 Replies
View Related
Sep 22, 2005
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 ?
View 2 Replies
View Related
Feb 14, 2006
Is it possible to force an entry into the browsers history without actually changing pages? I want to change the history based on a tabbed interface so that when linking away from one of the tabs a back button will return me to the correct tab or even the browser back button for that matter.
View 1 Replies
View Related
Nov 6, 2006
When we signout the form How can i disabling back button and,not only disabling back button but also delete history from browser.Suppose i used
<script language="javascript" >
javascript: window.history.forward(1);
</script>
to disable back button , its working.when i go to back list and click previous histories it shows data. so data hiding is important to my project. how can i delete browser history
View 9 Replies
View Related
Aug 6, 2009
<html>
<head><title>Back, Reload, and Forward Buttons</title>
</head>
<body>
[Code].....
how to display the number of history entries properly without having the code not run...any pointers?
View 2 Replies
View Related
Nov 22, 2006
I have an input button that i have assign to. Is there a way to use this but force the previous page to be refreshed?
View 3 Replies
View Related
Sep 11, 2002
I'm designing a web site and I designed an error page with .htaccess so that when someone types in an incorrect URL, it takes them to my customized page. Well, I used server-side programming to make it log the bad URL and check against a database if the there is a good URL matching the bad one. If so, it redirects to that page instead of giving the error. It's a good, well-written script done by me, I'll give it to anyone that requests it.
What I want to know is if JavaScript can prevent a page from being logged in the visitor's browser history.
You see, when they click the back button, the revisit the error page and it relogs the bad URL.
Is this possible in Javascript? Code:
View 4 Replies
View Related
Feb 14, 2011
My clients have a, "Family Violence" Prevention website and they have asked me to create them an "Exit" button so that the users could escape the page quickly if they heard their abusive partners.
I added the "javascript:document.location.replace("http://www.google.com")" to the button to disable the back button, but it only works on the last page viewed.. if they viewed more than one page on the website it takes them back to the page before the last page viewed.Is there a way to remove all pages from a domain name? or remove all browser history before that?
View 1 Replies
View Related