Hi, very nice to JS and totally new to this forum, so please keep it simple if you can.
I've read that you can make a link with nothing in the URL inorder to use the onClick event handler. Essentially, what I'd like to do is open a new window with my specifications, rather than directly link to the page. What I've tried is this:
<a href="" onClick="OpenNewWindow()">Click here to open a new window</a>
Where OpenNewWindow() is the function that does the work. The new window opens just fine, so I'm not concerned that much about the function, as about the statement I posted.
I find that whenver I do something like this, the browser (IE, generally) takes the <a href=""> to be a link to the home directory. For example, if I'm working locally, when I click on the link the new window will open, but the main window will jump to the index of the directory. Similiarly, if I'm working on my site, the main window will jump to /index.html. This is all very annoying and I haven't found a solution to it.
I didn't see that at first, but thanks for that little "return false" hint! I was dealing with problem by creating a <a name="...."> to get the referring page to at least be in the correct place after the link was clicked. This fixes that issue. Great!