SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Should this script work?

    I am using the PopupTraffic 12 hour script, but I want to be clean about it in my site code, so would this work


    My javascript filie, popup.js

    Code:
    if (document.cookie.indexOf("popuptrafficbehind") == -1) {
    var expdate = new Date((new Date()).getTime() + 43200000);
    document.cookie="popuptrafficbehind=general; expires=" + expdate.toGMTString() + "; path=/;";
    document.write("<script language=\"text/javascript\" src=\"http://www.popuptraffic.com/assign.php?l=jag5311&mode=behind\"></script>");
    }
    Then in my header of my page I would have this

    <script type="text/javascript" src="popup.js"></script>

    When I test it, its not working. Any help would be great.

    Thanks
    Bryan

  2. #2
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow, no takers huh

    I am sure it has something to do with the fact that I already have

    <script type='''''''> and then I use that inside the javascript as well.

  3. #3
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should be "type='text/javascript'" instead of "language='text/javascript'". Try this:
    Code:
    document.write("<" + "script type='text/javascript' src='http://www.popuptraffic.com/assign.php?l=jag5311&mode=behind'><" + "/script>");
    Also, I'm not sure about this - but you may need to use &amp; instead of &.

  4. #4
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think that may have worked. I tried it in firebird, but apparently it automatically has popups disabled. I tried it in IE 5.2 on a Mac and it appeared to work. Is there any chance IE would read the javascript code differently then other browsers?

    Its only 1 popup and its a popbehind, so if you wanted to let me know if it works on your side thats cool. Its a gaming site (look in sig) if you want.

    Thanks Mike
    Bryan

  5. #5
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're welcome, Bryan.

    Yes, the popbehind works for me in IE6 on Win2K.

  6. #6
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sounds good. Since most of my visitors will probably be IE, that IS a good thing


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
  •