onclick parameters


L

Luis

I have an onclick function that pops a new window (nothing fancy) the
problem is that whenever I want to return to the page where I popped
the new window from I find that it is reloaded and has taken me to the
fist line of the page. What parameter (or anything else for that
matter) can I add in order to pop up a new window and still be in the
same place when I return to the previous page?
Thanks for your help guys
 
Ad

Advertisements

M

Marc

don't use # in the href...

<a href="popup.html" target="_blank"
onclick="window.open('popup.html','','width=300,height=300'); return
false;">
 
Ad

Advertisements

A

arkadiusz juszczyk

Luis said:
I have an onclick function that pops a new window (nothing fancy) the
problem is that whenever I want to return to the page where I popped
the new window from I find that it is reloaded and has taken me to the
fist line of the page. What parameter (or anything else for that
matter) can I add in order to pop up a new window and still be in the
same place when I return to the previous page?
Thanks for your help guys

just guessing here, but...
you probably have:

<a href="#" onClick="popup()">nothing fancy</a>

and you want to have:

<a href="some-page-for-scriptically-challenged-browsers.html"
onClick="popup(); return false;">nothing fancy</a>

the critical thing being the "return false", which tells the browser not
to try and follow the link.

arkadiusz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top