|
Posted by tihu on 04/25/06 02:34
Lisa wrote:
> when I click on Guidelines, the popup does not apper in
> the window and the page refreshes back to home.
>
> $guideLink = "<a href=\"#\" onclick=\"window.open('guideline.html',
> '_blank', 'left=5, top=10,
> toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=200')\">Guidelines</a>";
>
Hey there
The page is being refreshed because of <a href="#">. coincidentally I
was reading about this problem on
http://www.javascripttoolbox.com/bestpractices/ just before I read your
post. Synchronicity strikes..
The link to "#" is being followed like a normal link (which takes you
to the home page because framesets make urls like href="#" acts like a
link to the main page) as well opening a window.
To stop this happening you need add return false at the end of the
onclick string.
onclick=\"window.open('guideline.html', '_blank', 'left=5, top=10,
toolbar=no, location=no, status=no, menubar=no,
scrollbars=no,resizable=no,width=300,height=200'); return false;\"
Not quite sure why the popup is not opening the right page, the
window.open call looks ok. Try using an absolute url like to see what
happens, like:
window.open('http://gomagnetic.com/gomag/filename.htm','_blank'...
Good luck
Tim
Navigation:
[Reply to this message]
|