473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Code working in IE but not in FireFox

Hi all,
I want to scroll within a window.
<a href="javascript:window.location('#first');">First </a>

When i click First then it moves to the particular anchor tag within the same page.

<a name="first" id="first">This is the first section of this page</a>

This code is working fine in IE, but in firefox it is not working.
I tried window.location.href='#first'; It take this as a new request.

Actually my requirement is not a new request, it have to show the corresponding place of the existing page.

Please help to resolve this issue.
Mar 12 '07 #1
5 4109
steven
143 100+
Hi all,
I want to scroll within a window.
<a href="javascript:window.location('#first');">First </a>

When i click First then it moves to the particular anchor tag within the same page.

<a name="first" id="first">This is the first section of this page</a>

This code is working fine in IE, but in firefox it is not working.
I tried window.location.href='#first'; It take this as a new request.

Actually my requirement is not a new request, it have to show the corresponding place of the existing page.

Please help to resolve this issue.
Why are you using Javascript for this function? It is not necessary. You can do this with html alone and it will not break if a user decides to visit your page in a browser with no javascript, or doesn't have javascript disabled.

In html:

[html]
<a href="#first">link to first</a>

<a name="first"></a>
[/html]
Mar 12 '07 #2
Why are you using Javascript for this function? It is not necessary. You can do this with html alone and it will not break if a user decides to visit your page in a browser with no javascript, or doesn't have javascript disabled.

In html:

[html]
<a href="#first">link to first</a>

<a name="first"></a>
[/html]
Thanks for your reply.
Yes Its working fine with html files. Actually i am working in jsp files (using struts tiles) so i want to scroll the window to the specific anchor tag.
Please help me to resolve
Mar 13 '07 #3
sumittyagi
202 Expert 100+
Thanks for your reply.
Yes Its working fine with html files. Actually i am working in jsp files (using struts tiles) so i want to scroll the window to the specific anchor tag.
Please help me to resolve

JSP is JSP at server side, it's never a JSP at clientside. what client sees is the HTML conversion of the jsp processed tags. so don't worry about the techniques used in jsp. whatever runs fine in a simple html, runs fine in jsp as well.
Mar 13 '07 #4
JSP is JSP at server side, it's never a JSP at clientside. what client sees is the HTML conversion of the jsp processed tags. so don't worry about the techniques used in jsp. whatever runs fine in a simple html, runs fine in jsp as well.
Thanks for your reply.

In java script i am using window.location("#first") to scroll the window within a page. Its working fine in IE, but its not working in FireFox.
Please help me to resolve this issue.
Mar 14 '07 #5
acoder
16,027 Expert Mod 8TB
See this thread.
Mar 14 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Gregory Piñero | last post by:
Hi guys, I'm trying to run this statement: os.system(r'"C:\Program Files\Mozilla Firefox\firefox.exe"' + ' "www.blendedtechnologies.com"') The goal is to have firefox open to that website....
3
by: The Bicycling Guitarist | last post by:
http://www.TheBicyclingGuitarist.net/css/index.css I have red nav buttons that turn blue when hovered over and turn purple after being visited. The red and blue work in FireFox, but not the visited...
6
by: Mark Olbert | last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an autopostback checkbox, for that matter). I'm aware of a problem with Netscape browsers and the...
7
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script...
1
by: ajaysoniji | last post by:
Hi, I am using this code to read the option values from a select option. I am getting the reference of that select option in arg1. Its working fine with mozilla firefox but not with Internet...
9
by: javakid | last post by:
Hi Following form validatioin code is working fine on IE but not working on Mozilla Firefox V2. Can any body suggest? Regards <script ="JAVASCRIPT" type="text/javascript">...
5
by: CoolForU | last post by:
this is my code and i call this code from code behinde file on page load like this useragree.Attributes.Add("onclick", "CheckSelection();") this is working fine with IE but not working with...
3
by: rajasree | last post by:
Hi all, am doing a project in PHP. my javascript code is working properly in ie. But its not working in firefox. Please help me my code is as follows; <script language="javascript"...
1
by: Sura | last post by:
Hi I have a flash interactive window which has html links and this appears on an html page. This window can be moved with the mouse on the html page. The html page has an iFrame too. When the...
26
by: Jenitha S | last post by:
Hi, I am working in JSP code.A Menubar is displayed in JSP page.It's working fine in IE. But in case of firefox the very first menuitem is not working.If i move that menu item as second means it's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.