473,799 Members | 3,310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox history.go(-1) not working as needed

Hi,

My web page has an iframe with a list of items from a database. These
items are html links and when clicked they execute a server side
script to update the database and reload the iframe with the updated
links. The list is sometimes long and I would like the user to return
to the same iframe anchor point as they were before. I use the
following code in the database update script (which also reloads the
iframe) which works fine with Internet Explorer but returns the user
to the top of the iframe with Firefox.

window.history. go(-1);

Any ideas/suggestions on how to get the desired behavior in both IE
and Firefox?

Thanks,
Raffi

Jun 23 '07 #1
6 4887
ASM
Raffi a écrit :
>
Any ideas/suggestions on how to get the desired behavior in both IE
and Firefox?
location.href=s elf.location; ?

or links in normal html ?

<p><a href="?feature= 001#f001" name="f001">fea ture 001</a>
<p><a href="?feature= 002#f002" name="f002">fea ture 002</a>
<p><a href="?feature= 003#f003" name="f003">fea ture 003</a>

--
Stephane Moriaux et son (moins) vieux Mac
Stephane Moriaux and his (less) old Mac already out of date
Jun 23 '07 #2
On Jun 23, 2:40 pm, ASM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
wrote:
Raffia écrit :
Any ideas/suggestions on how to get the desired behavior in both IE
and Firefox?

location.href=s elf.location; ?

or links in normal html ?

<p><a href="?feature= 001#f001" name="f001">fea ture 001</a>
<p><a href="?feature= 002#f002" name="f002">fea ture 002</a>
<p><a href="?feature= 003#f003" name="f003">fea ture 003</a>

--
Stephane Moriaux et son (moins) vieux Mac
Stephane Moriaux and his (less) old Mac already out of date
I tried location.href=s elf.location; and it resulted in an endless
loop. The anchored link will not work since it's not the linkthat
reloads the iframe but the script that is executed when the user
clicks the link. Here are more details. The main page has an iframe
which has a number of links like the following:

<a href="javascrip t:window.locati on.href = './script.xxx?
varable=choice1 >Choice1</A>

script.xxx then updates the database using the variable and reloads
the iframe content. Currently

parent.history. go(-1);

works fine for IE but not for Firefox.

Any help will be appreciated.

Thanks,
Raffi

Jun 23 '07 #3
ASM
Raffi a écrit :
>
I tried location.href=s elf.location; and it resulted in an endless
loop.
Not very surprised :-)
The anchored link will not work since it's not the link that
reloads the iframe but the script that is executed when the user
clicks the link. Here are more details. The main page has an iframe
which has a number of links like the following:

<a href="javascrip t:window.locati on.href = './script.xxx?
varable=choice1 >Choice1</A>
I do not understand where is the script (JS script) ?

Youre 'JS' script 'window.locatio n' is exactly same as :

<a href="./script.xxx?vara ble=choice1">Ch oice1</A>

What is what I proposed,
except I've introduced anchors in links AND in calls

<a href="./script.xxx?vari able=choice1#ch oice1" name="choice1" >Choice1</A>
If you want absolutely to use JS :

<a href="./script.xxx" name="choice1"
onclick="this.h ref+='?variable ='+this.name+'# '+this.name;">C hoice1</A>

or :

<script type="text/javasccript">
window.onload = function() {
var L = document.links;
for(var i=0; i<L.length; i++)
if(L[i].href.indexOf(' script')>0)
L[i].href += '?variable='+L[i].name+'#'+L[i].name;
}
</script>

<a href="./script.xxx" name="choice1"> Choice 1</A>
<a href="./script.xxx" name="choice2"> Choice 2</A>
<a href="./script.xxx" name="choice3"> Choice 3</A>

--
Stephane Moriaux et son (moins) vieux Mac
Stephane Moriaux and his (less) old Mac already out of date
Jun 24 '07 #4
On Jun 24, 6:16 am, ASM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
wrote:
Raffia écrit :
I tried location.href=s elf.location; and it resulted in an endless
loop.

Not very surprised :-)
The anchored link will not work since it's not the link that
reloads the iframe but the script that is executed when the user
clicks the link. Here are more details. The main page has an iframe
which has a number of links like the following:
<a href="javascrip t:window.locati on.href = './script.xxx?
varable=choice1 >Choice1</A>

I do not understand where is the script (JS script) ?

Youre 'JS' script 'window.locatio n' is exactly same as :

<a href="./script.xxx?vara ble=choice1">Ch oice1</A>

What is what I proposed,
except I've introduced anchors in links AND in calls

<a href="./script.xxx?vari able=choice1#ch oice1" name="choice1" >Choice1</A>

If you want absolutely to use JS :

<a href="./script.xxx" name="choice1"
onclick="this.h ref+='?variable ='+this.name+'# '+this.name;">C hoice1</A>

or :

<script type="text/javasccript">
window.onload = function() {
var L = document.links;
for(var i=0; i<L.length; i++)
if(L[i].href.indexOf(' script')>0)
L[i].href += '?variable='+L[i].name+'#'+L[i].name;
}
</script>

<a href="./script.xxx" name="choice1"> Choice 1</A>
<a href="./script.xxx" name="choice2"> Choice 2</A>
<a href="./script.xxx" name="choice3"> Choice 3</A>

--
Stephane Moriaux et son (moins) vieux Mac
Stephane Moriaux and his (less) old Mac already out of date
Hello Stephane,

Thanks for your response and suggestions. It helped me clean up my
html code a little.

Your suggestions for the anchor did not work however. I think the
reason is the anchor information in the html link is passed along to
script.xxx. Once this script runs the "window.history .go(-1);" at the
end of the script does the reloading of the iframe. I think I need
something in script.xxx to make the iframe scroll to the anchor after
reloading.

Thanks,
Raffi

Jun 24 '07 #5
ASM
Raffi a écrit :
>
Your suggestions for the anchor did not work however. I think the
reason is the anchor information in the html link is passed along to
script.xxx.
Isn't script.xxx a file (a php file whom script does something) ?
Once this script runs the "window.history .go(-1);" at the
end of the script
Why do you keep this JS in your file 'script.xxx' ?
You don't need it with the attached anchor (#choicexx)

I do not understand why you have to go back ...
'script.xxx' can't content what that is to display ?

The clicked link calls the file 'script.xxx'
with attached to its url :
- the variable and ist value : ?variable=choic exx
and
- the anchor to reach on (re)loading : #choicexx

It is simple and normal html feature
I think I need
something in script.xxx to make the iframe scroll to the anchor after
reloading.
on reloading you only need to reach the mentioned anchor

Try this example
- where the file calls itself instead to call another file
(isn't it this file which is the src of iframe ?)
- where there is a (JS) script about the attached variable

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled </title>
<style type="text/css" title="text/css">
div p { height: 150px; border: 1px solid; margin-top: 50px; }
</style>
<script type="text/javascript">
onload = function() {
alert(window.lo cation.search);
}
</script>
</head>
<body>
<div>
<p><a href="?feature= 256#f256" name="f256">fea ture 256</a>
<p><a href="?feature= 001#f001" name="f001">fea ture 001</a>
<p><a href="?feature= 002#f002" name="f002">fea ture 002</a>
<p><a href="?feature= 003#f003" name="f003">fea ture 003</a>
<p><a href="?feature= 004#f004" name="f004">fea ture 004</a>
<p><a href="?feature= 005#f005" name="f005">fea ture 005</a>
<p><a href="?feature= 006#f006" name="f006">fea ture 006</a>
<p><a href="?feature= 007#f007" name="f007">fea ture 007</a>
</div>
</body>
</html>

--
Stephane Moriaux et son (moins) vieux Mac
Stephane Moriaux and his (less) old Mac already out of date
Jun 25 '07 #6
Raffi wrote:
Hi,

My web page has an iframe with a list of items from a database. These
items are html links and when clicked they execute a server side
script to update the database and reload the iframe...

window.history. go(-1);

Any ideas/suggestions on how to get the desired behavior in both IE
and Firefox?
The history refers to web pages loaded within the browser. The loading
of an iframe from the server to an area within the web page does not
change the web page that was loaded, therefore the history does not
record the change of the update. This is as it ought to be and, if it
does not work that way in MSIE then I am afraid that IE is wrong and
Firefox is right. You are dealing with it on your server and it is
your server that should permit the reloading of the previous iframe
contents, not the browser page code in Javascript.
Jun 25 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
10592
by: menakasrinivasagam | last post by:
my coding is working in mozilla firefox.but not working in Internet explorer.plz give suggestion to rectify this problem
5
2908
by: kalra | last post by:
I have to clear the Firefox history using javascript. I have done this in IE but that is not working perfectly in firefox. Please help me. This is the web application and I have to remove the pages from cache as after the user sign out from the web site.
1
1584
by: Lollygag | last post by:
Hi folks. Please try not to laugh at my web design noobness, I'm a photoshop monkey, but I thought I'd have a go at updating this website to learn css & html, it's far more complex than I'd anticipated. I've managed to cobble this much together, the css even validates: http://www.accesscomms.com.au/Newsite2/ It displays nicely in Firefox but gives IE7 (and presumably IE6 & below) serious indigestion, it seems hellbent on positioning...
33
5566
by: buss123 | last post by:
Hi all, combo box script code was working in IE perfectly with all modes but OnChange event was not working in FireFox(editable mode, if we select valuese that combo box values r not dislaying if enter the data the it is inserting properly) javascript code follows pls help me to solve this problem function fnKeyDownHandler(getdropdown, e) { fnSanityCheck(getdropdown);
10
10503
Ajm113
by: Ajm113 | last post by:
Making a History Page for BIG Sites Intro: Ok, let's say after a while your website has grown massive. We're talking search engine, forum and video hosting -- you've got a LOT of content. And you are wondering, "Why do I need yet another feature for my big site?" Well, some people can become forgetful every time they see content on your site, and let's suppose that one day they needed to work on a good php script for their class and they...
2
1761
by: pavanip | last post by:
Hi, I am using the following code to get Internet Explorer filepath to display history list. filePath1 = Environment.GetFolderPath(Environment.SpecialFolder.History) by using the above path i am getting only internet explorer history list. Please anyone can give suggestions how to get Firefox history list?where it will store these data? And one more doubt what is the meaning of Computer list in firefox history? Thanks in advance...
5
1751
by: black143 | last post by:
Hi All, i am using this below addElement() function to create the file element dynamically function addElement( filename,businessName ){ // Make sure it's a file input element //if( element.tagName == 'INPUT' && element.type == 'file' ) { var textdiv = document.createTextNode('SER file to upload:');
1
5914
by: bogdanm | last post by:
Hello everyone, I am having a probleme with a issuu code when trying to insert it o my site it doesnt work in IE but in mozzila works fine the code is bellow: <div><object style="width:500px;height:300px" ><param name="movie"...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10252
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.