473,396 Members | 1,933 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,396 software developers and data experts.

Href Help needed

Can someone help me on this little problem. I am using the following
code in
an xsl page.

The directed page is written in the javascript: submitOnClick();

<a href="#">
<xsl:attribute name="onClick">submitOnClick();</xsl:attribute>
Main Menu
</a>

The problem is that when href is given the # sign, the moment i click
on the link it first jumps to the top of the page, before moving to
the directed page.
This can be seen when the page is longer than the screen size.

Is there any other solution to rectify that problem ..........

Thanks for your time
Rose
Jul 23 '05 #1
1 1096
Rose Girl wrote:
Can someone help me on this little problem. I am using the following
code in
an xsl page.

The directed page is written in the javascript: submitOnClick();

<a href="#">
<xsl:attribute name="onClick">submitOnClick();</xsl:attribute>
Main Menu
</a>

The problem is that when href is given the # sign, the moment i click
on the link it first jumps to the top of the page, before moving to
the directed page.


If you don't return false on the onclick event, then the link is
followed, so the correct code would be

<a href="#">
<xsl:attribute name="onclick">submitOnClick();return false;</xsl:attribute>
Main Menu
</a>

Note that some visitors may not follow JavaScript links (including
search engine spiders!) so you may want to put a link to an actual page
in the href attribute.

--
Klaus Johannes Rusch
Kl********@atmedia.net
http://www.atmedia.net/KlausRusch/
Jul 23 '05 #2

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

Similar topics

2
by: Patryk Konieczka | last post by:
Hello Here's the thing I have a database edited by some company workers editing descriptions of books in the sotre , unfortunately these workers do not have the habit of inserting a space...
3
by: Harag | last post by:
Hi all I'm using W2k Pro, ASP 3, IIS 5 & DWMX 6.1 and code in VBSCRIPT I currently use the <BASE href=XXXX> in all my pages and just read that this tag is no longer supported so will soon...
11
by: Dana Smith | last post by:
Can anybody explain why when I have a hyperlink on a page with the code similar to below, after the user clicks on the link, the desired window opens but the page with the hyperlink changes to a...
5
by: Mel | last post by:
can someone post a simple javascript to change the text of the <href> for me ? thanks
16
by: michael | last post by:
Is it possible to get all href URLs contained in a unordered list and place them in an array? Or in fact two different arrays, differently named one for each <ul> group? <ul> <li><a...
4
by: Nak | last post by:
Hi there, I know this isn't 100% relevant to ASP.NET but I'm hoping that someone can shed some light on href's in HTML code. Consider the following, http://www.spoon.com/dir/page.html ...
2
by: adMjb | last post by:
Hi Any help would be fantastic I have a simple problem but I cant work it out... DOHH...., this is my XML: <?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/css"...
3
by: ajos | last post by:
Hello friends, In my action class i am getting a resultset data which im storing in a arraylist. In my jsp page im retrieving the arraylist data as-----> <%publicity.PendingReqForm prfObj=null;...
5
by: prathapavp | last post by:
hi all, We r working on ERP sys and am doing crossBrowser compatibility. The problem is am not able to load one function by onClicking the refrence text . could u please help me out.
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: 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
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?
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
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...
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,...
0
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...
0
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...

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.