Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Link that leads to a pop-up
Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
poseidon




PostPosted: Sun May 11, 2003 7:27 pm   Post subject: Link that leads to a pop-up

I'm working on a site and I want a pop-up to appear when the user clicks a certain link.

eg. when the person clicks the link, a pop-up appears (the little customizable pop-ups that has the "OK" button), and when the user clicks "OK" the pop up closes and the browser links to another page.

Does any1 know the code for this? (if it exists)

Heres wat i have so far ....

a href="" onMouseover="alert('TEXT')">LINKTEXT
but I cannot actually get the browser to go to another page, I don't kno how to integrate the a href=URL> linktext</a into that code
Sponsor
Sponsor
Sponsor
sponsor
octopi




PostPosted: Sun May 11, 2003 8:26 pm   Post subject: (No subject)

I just quickly whipped this together:

code:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function popup() {
  var URL = "http://www.google.com";
  alert("A popup window will appear...");
  popup = window.open(URL,"popup","");
}
</script>
</head>


<body>
  <a href="javascript:popup();">click</a>
</body>
</html>
octopi




PostPosted: Sun May 11, 2003 8:35 pm   Post subject: (No subject)

errr.
On re-read I think I missed what you were saying, is this what you want?

code:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function leaving() {
  var URL = "http://www.google.com";
  alert("You are leaving my site...");
  window.location = URL;
}
</script>
</head>


<body>
    <a href="javascript:leaving();">click</a>
</body>
</html>
poseidon




PostPosted: Sun May 11, 2003 11:48 pm   Post subject: thx man

wow .. haha .... looking at ur code makes me feel like a true html newbie ... seems like I need to learn a lot more html

thx man ... exactly what I wanted .....

except .... I dont wanna be a nusiance but ... how do u get the linked url to open in another browser? so my initial page will still be there

thx again
poseidon




PostPosted: Mon May 12, 2003 12:07 am   Post subject: actually wait

I just tried it on my site, and for some reason it doesnt wrk .... the pop-up doesnt show ... and geocities(my host) ends up looking for a file

So far, I have


code:



<html>

<head>
<SCRIPT LANGUAGE="JavaScript">
function leaving() {
  var URL = "http://www.google.com";
  alert("You are leaving my site...");
  window.location = URL;
}
</script>
</head>



<body>
<text>

(My coding.  I omitted it because there's simply too much)


<a href="javascript:leaving();">click</a>

</text>
</body>
</html>




I was thinking, maybe the problem is in my placement of your coding or maybe .... href= " javacript:leaving() am I supposed to put a URL in there or something?

Also ... is there a way to put comments in html? (eg in turing, u use " % " in front of a statement to make it a comment)
octopi




PostPosted: Mon May 12, 2003 12:26 am   Post subject: (No subject)

Here are some links, with the documents I uploaded on my server.
I included a html comment in them, so you can see. (included below too)

http://javascript.etw.ca
http://javascript.etw.ca/popup.html
http://javascript.etw.ca/alertlink.html



code:
<!--STUFF GOES HERE -->
Homer_simpson




PostPosted: Mon May 12, 2003 12:33 am   Post subject: Re: thx man

poseidon wrote:
wow .. haha .... looking at ur code makes me feel like a true html newbie ... seems like I need to learn a lot more html
you need to learn alot more java scripting not html... and CSS and dhtml are also very useful for webdesigning
poseidon




PostPosted: Mon May 12, 2003 10:38 pm   Post subject: thx

Thanks a lot man ... it wrked ...

I think there was an issue w/ geocities ..... cause when i put the same code onto my other host, it wrked perfectly .. but there was always somethign wrong when i used geocities ...

o yea .. can any1 suggest a good html tutorial? java tutorial?

anyways .... thx again
Sponsor
Sponsor
Sponsor
sponsor
krishon




PostPosted: Tue May 20, 2003 6:37 pm   Post subject: (No subject)

well u can start a new topic and i'll help u out wit some stuff u dun't know. i'm not and html god, as in i dun't know everythin there is to know, but i know a fair bit. Javascript i'm ok at gotta touch up. so nethin u need just holla.
hez




PostPosted: Mon May 26, 2003 3:19 pm   Post subject: (No subject)

octopi wrote:
Here are some links, with the documents I uploaded on my server.
I included a html comment in them, so you can see. (included below too)

http://javascript.etw.ca
http://javascript.etw.ca/popup.html
http://javascript.etw.ca/alertlink.html



code:
<!--STUFF GOES HERE -->



Nicely Stated Wink we make newbies look bad Twisted Evil
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: