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

avoiding jump with <a href="#" onclick="window.open....

Hi all

I have a file I open in a smaller window, like this:

<a href="#" onclick="window.open....

but it also causes the main window to jump to the top. What have
people done to avoid that?

BR
Sonnich

Feb 15 '07 #1
4 23251
jodleren said the following on 2/15/2007 7:31 AM:
Hi all

I have a file I open in a smaller window, like this:

<a href="#" onclick="window.open....

but it also causes the main window to jump to the top. What have
people done to avoid that?
onclick="window.open('.....');return false"

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 15 '07 #2
Randy Webb wrote on 15 feb 2007 in comp.lang.javascript:
jodleren said the following on 2/15/2007 7:31 AM:
>Hi all

I have a file I open in a smaller window, like this:

<a href="#" onclick="window.open....

but it also causes the main window to jump to the top. What have
people done to avoid that?

onclick="window.open('.....');return false"
.... unless the modern IE/FF browser is set to always tab.

===============

What about gracefull
retardation/recreation/retalliation/what-was-that-d'mn-word-again?

<a
href='http://cnn.com/' target='_blank'
onclick='window.open(this.href);return false'
>
CNN
</a>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 15 '07 #3
On Feb 15, 12:31 pm, "jodleren" <sonn...@hot.eewrote:
Hi all

I have a file I open in a smaller window, like this:

<a href="#" onclick="window.open....
http://www.jibbering.com/faq/#FAQ4_24

" Instead, use <a href="something.html" onclick="somefunction();return
false"where something.html is a meaningful alternative. "

Feb 15 '07 #4
On Feb 15, 5:41 pm, "David Dorward" <dorw...@gmail.comwrote:
On Feb 15, 12:31 pm, "jodleren" <sonn...@hot.eewrote:
Hi all
I have a file I open in a smaller window, like this:
<a href="#" onclick="window.open....

http://www.jibbering.com/faq/#FAQ4_24

" Instead, use <a href="something.html" onclick="somefunction();return
false"where something.html is a meaningful alternative. "
I changed then items to buttons, it also makes more sence it that
place.

BR&Thanks
Sonnich

Feb 16 '07 #5

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

Similar topics

6
by: Tony Marston | last post by:
The code <a href="..." target="_blank">...</a> will not validate as XHTML STRICT because of the 'target' tag, so how do I achieve the same result by moving it to a CSS file? I cannot find anything...
10
by: Dieter Salath? | last post by:
Hi, in our webpage, a user could open a windows explorer to his temp directory with a simple link and usage of the file protocol: <a href="file://C:\temp" target="_blank">C:\temp</a> This...
3
by: Oliver Saunders | last post by:
can someone please tell me why everytime i try and pass this to a js function i can't seem to use it for anything: <html> <head> <script language="javascript"> function a(fromlink) {...
10
by: Eric-Sebastien Lachance | last post by:
Hey there, I decided to just create a 100% height and width div that filled the space over a background header image, and add an onclick event to redirect to the my index... Doesn't seem to work...
10
by: Gernot Frisch | last post by:
Hi, I'm currently writing: <span onclick="window.open(...);">Klick Here</span> but I want to use the <a href> for this, since it is defined in the css script the way I want my link to open....
6
by: kelvlam | last post by:
Hello, I'm a new begininer with JavaScript. I'm trying to figure out which is the best approach, and to understand the differences between them. I have a <Aelement that's suppose to either...
11
by: jesdynf | last post by:
I'm having trouble applying a stylesheet to content I'm generating after the fact. Here's the sample code: <html> <head> <title>CSS/DOM Problem Example</title> <style type="text/css">...
2
by: Peter Laman | last post by:
In my app I need to dynamically generate a series hyperlinks. Each hyperlink's action must be to focus a field in a <form>. I created the following function to create such a link (the argument is a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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: 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
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,...
0
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...

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.