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.
I am trying to add mouseout and mouseover event to flash object using document.write so that I can show or hide text when someone rollover on flash but I am not sure how to do that? check my code and make any necessary changes to it.
<script language="JavaScript" type="text/javascript"> function CngTxt(id,txt){ var obj=document.getElementById(id); if (txt){ obj.innerHTML=txt; }
I am totally new to jQuery and no good knowledge on javascript. However, I was assigned a task, to convert a javascript program to jQuery due to compatibility problem on browsers like Chrome and Safari. My program originally use javascript xmlDoc.load('....') to read XML file, and then use document.write statement to write html tables on client side. Something like this (the sample below may got lots of syntax problem as I jut want to show the major part):
Code: document.write('<TABLE >'); var y=x[0].getElementsByTagName('NoOfRows'); for (i=0; i<=noofrows-1 && i<=y.length-1; i++){ document.write(' <TD>'); document.write(z[j].getElementsByTagName('RecordDetails')[0].childNodes[0].nodeValue; }
Now I changed to use jQuery, I can read the XML file elements. However, when I try to write the table, it failed:
I have a client that has ads on her website that really slow down the site. These ads are called by an off site javascript file and I want to use a jQuery(document).ready or similar method to call these files after all of the site content has loaded. But these files contain document.write functions to add more javascript files. Since I want to load the files after everything else has loaded, this in turn makes the page blank and then loads the ad. Is there a way to position where document.write will write to?
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?
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.
Im trying to have a click event that replaces an image on the page with a new image that has been selected randomly from an array. I have solved PART of this already (can get the random image to appear).
However, instead of appearing on the page where the old image was, the new image appears in a blank page.
My research indicates that this blank page location-problem is a result of using document.write in the Function. Therefore, I know I need to find a different way to accomplish this, but am failing miserably.
I have been trying for hours and hours and HOURS to figure out proper syntax for accomplishing this via elements, functions, variables and mootools.
A bit of my research:
-I found this---but havent figured out how to implement it in my scenario:
Source: [url]
-I found this---but havent figured out how to implement it in my scenario:
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.
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
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?
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....
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'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
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 ?
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.
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
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.