onclick parameters

Discussion in 'Javascript' started by Luis, Jun 26, 2003.

  1. Luis

    Luis Guest

    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
    Luis, Jun 26, 2003
    1. Advertisements

  2. Luis

    Marc Guest

    don't use # in the href...

    <a href="popup.html" target="_blank"
    onclick="window.open('popup.html','','width=300,height=300'); return
    Marc, Jun 26, 2003
    1. Advertisements

  3. 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 juszczyk, Jun 26, 2003
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.