SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Js popup url not working.

    Hello,
    I was wondering if someone could help me with a problem I am having with a js popup.

    I was reading this article on quicksmode and when I added the code in the begining, it worked flawlessly.

    Meaning the result was a popup saying that popupex.html could not be found, which was expected as this script is not running off of the quicksmode server.

    I simply tried to change the url and for some reason I can not get the pop up to work.

    I am obviously doing something wrong, i just hope its not that stupid

    Here is the code:
    in the head:
    Code HTML4Strict:
    <script language="javascript" type="text/javascript">
    		<!--
    		function popitup(url) {
    			newwindow=window.open(url,'name','height=200,width=150');
    			if (window.focus) {newwindow.focus()}
    			return false;
    		}
    		// -->
    	</script>

    and the link in the body:
    Code HTML4Strict:
    <a href="popupex.html" onclick="return popitup('http://www.facebook.com/sharer.php?u=http://www.the-irf.com&t=The Irf's Website')">Link to popup</a>

    btw, the link is the facebook share php sharing a site i made.

    I hope someone can help me with this and I would appreciate any and all help.

    Thanks in Advance and Best Regards,
    Team 1504.

    P.S. I just want the above url,
    HTML Code:
    http://www.facebook.com/sharer.php?u=http://www.the-irf.com&t=The Irf's Website
    , to popup.
    So if anyone has any other ideas on how to get it to do that and that work please let me know. Thank you again.

  2. #2
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    336
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Put the link you want in the href.

    You can also try this:
    Code HTML4Strict:
    <a href="http://www.google.com" onclick="return popitup(this.href)">Link to popup</a>

  3. #3
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    With that same script above in the head, none of my implementations of your suggestions worked :-(

    Maybe im doing this wrong...

    Here is what I had before in the body:
    Code HTML4Strict:
    <a href="popupex.html" onclick="return popitup('http://www.facebook.com/sharer.php?u=http://www.the-irf.com&t=The Irf's Website')">Link to popup</a>

    then i tried it with the link in the href and in the onclick.
    Code HTML4Strict:
    <a href="http://www.facebook.com/sharer.php?u=http://www.the-irf.com&t=The Irf's Website" onclick="return popitup('http://www.facebook.com/sharer.php?u=http://www.the-irf.com&t=The Irf's Website')">Link to popup</a>

    then i tried it with your suggestion of using onclick="return popitup(this.href), like so:
    Code HTML4Strict:
    <a href="http://www.facebook.com/sharer.php?u=http://www.the-irf.com&t=The Irf's Website" onclick="return popitup(this.href)">

    Unfortunately, none of them seemed to work. Well maybe i phrased that wrong, then last one worked. But it opened the link in a new tab not it a pop up.

    any ideas or suggestions?


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •