Welcome Guest [Log In] [Register]
Add Reply
having trouble with the alert; javascript
Topic Started: Jun 10 2009, 11:10 PM (440 Views)
kryssy23
Member Avatar

hey, i need to use javascript to open a link in a new window... that works... but i need to have an alert. once the link is clicked the alert should come up saying that you are leaving the site... then when you press 'ok' it should continue to the other website.

i have tried doing this at least 3 different ways but none seem to work... i am just starting to learn javascript... so forgive me if its a very simple question.

Code:
 

<dt>
<a href= onmouseup=alert("do you want to leave this site?)"onclick="return(popWin('http://afl.com.au'))">AFL website</a>
</dt>
<dd>This is the offical website for the AFL.</dd>


thanks for the help ;)
Offline Profile Quote Post Goto Top
 
Knight13

0
Edited by Knight13, Mar 19 2010, 07:55 AM.
Offline Profile Quote Post Goto Top
 
Darksorrow131

I think you also need a target="something" (I forgot what) on the <a> tag to open in new window.
(btw I don't think you can have spaces around the equals sign in HTML attributes but I'm not sure about that)
(let loop () (loop))
((lambda (x) (x x)) (lambda (x) (x x)))
(let ((k #f)) (call/cc (lambda (cc) (set! k cc)) (k))
((call/cc call/cc) (call/cc call/cc))

-- Infinite loops are awesome! --
Tell me if you have other awesome infinite loops!
Offline Profile Quote Post Goto Top
 
Knight13

0
Edited by Knight13, Mar 19 2010, 07:50 AM.
Offline Profile Quote Post Goto Top
 
kryssy23
Member Avatar

hey thanks for the reply... and yes that is what i wanted... in my code the popWin was actually a bit of javascript to open the link in a new window... teachers requirements :s anyways thanks guys for all your help :)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Web-Based Programming Support · Next Topic »
Add Reply

Banner and Logo by TheKeith