1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

GOD HELP ME WITH JAVASCRIPT

Discussion in 'Computers, Games, Electronics etc' started by reikoshea, Mar 22, 2006.

  1. reikoshea

    reikoshea HS Troll...And Mod Moderator VIP

    Messages:
    12,633
    Likes Received:
    193
    Joined:
    Apr 27, 2005
    Location:
    San Antonio, TX
    okay, so my boss decides to promise a dealership (yes im a graphic artist for an automotive ad firm) that we can have their e-mail ad campaign up and running by May 1st.

    Cool, i can do that...but what she told me today was that i need to have a small version of the ad in email (not a problem) and then a larger version pop up in a fixed window once anything is clicked (ad not a problem, pop up HUGE FRIGGIN PROBLEM).

    So i get everything ready with a normal link that opens a window that opens another window (onLoad) and then the child window closes the parent. No biggie. I upload to the server and guess what happends....GOOGLE POP UP BLOCKER...YAHOO POP UP BLOCKER and FIREFOX all kill my ad. So, its back to the drawing board on something i thought would be easy.

    Code:
    <script language="Javascript">
    var the_timeout;
    function doTimer()
    {
    the_timeout = setTimeout("document.forms.redirect.submit();", 3000);
    }
    function newWindow(newContent)
     {
    winContent = window.open('http://www.reikoshea.com/Work/Classic-TahoeAdFinished.html', 'nextWin', 'left=35,top=0,width=956,height=716,toolbar=no,scrollbars=no,resizable=no') 
     }
     function init()
    {
    doTimer();
    }
    window.onLoad = init;
    </script>
    <script LANGUAGE="VBScript">
    Sub Window_Onload
    window.opener = "x"
    End Sub
    </script>
    
    </head>
    
    <body>
    <form onSubmit="newWindow();" name="redirect">
    </form>
    </body>
    </html>
    
    That just sends my browser into an endless loop, but i think im close. anyone know anything that might help me out in keeping this project alive?
     
  2. HatchSpeeD

    HatchSpeeD ...Hi...

    Messages:
    1,241
    Likes Received:
    0
    Joined:
    Apr 14, 2003
    Location:
    Beantown
    Control - Alt - Delete?



    LOL, bro sorry I wish I could help...ask B...i'm clueless


    Bump for this poor guy...
     
  3. reikoshea

    reikoshea HS Troll...And Mod Moderator VIP

    Messages:
    12,633
    Likes Received:
    193
    Joined:
    Apr 27, 2005
    Location:
    San Antonio, TX
    i asked b...need more assistance...nothing is working.
     
  4. ScrapinSi

    ScrapinSi Senior Member

    Messages:
    3,292
    Likes Received:
    4
    Joined:
    Feb 27, 2003
    Wait... So you want to create a Popup that isn't going to be blocked by popup blockers?
     
  5. reikoshea

    reikoshea HS Troll...And Mod Moderator VIP

    Messages:
    12,633
    Likes Received:
    193
    Joined:
    Apr 27, 2005
    Location:
    San Antonio, TX
    its not a pop up technically...the user clicked and wants more info, im giving it to them in a sized window. thats my goal, but this is an email, and sized windows dont go well with emails.
     
  6. pissedoffsol

    pissedoffsol RETIRED

    Messages:
    49,693
    Likes Received:
    54
    Joined:
    Sep 28, 2002
    Location:
    Retirement Home
    i just sent you some code in pm
     
  7. VTECin5th

    VTECin5th Administrator

    Messages:
    2,182
    Likes Received:
    4
    Joined:
    Apr 17, 2005
    Location:
    Phoenix Az
    I dont understand the timeout, but if they need to click anyways define the link>
    This code works in ie7.
    Code:
    <script language="Javascript">
    function poop(){
    window.open('http://www.reikoshea.com/Work/Classic-TahoeAdFinished.html', 'nextWin', 'left=35,top=0,width=956,height=716,toolbar=no,scrollbars=no,resizable=no') 
    }
    </script>
    <a href="#" onClick="poop();">.</a>
    
    Stay away from VBScript for any reason if possible, FF doesn't support it.
     
  8. reikoshea

    reikoshea HS Troll...And Mod Moderator VIP

    Messages:
    12,633
    Likes Received:
    193
    Joined:
    Apr 27, 2005
    Location:
    San Antonio, TX
    bro, believe me if they could click twice i would have done it already. the customer wants that window up in one click, they dont want another link to click. this HAS to load with the one interaction in the e-mail (meaning i cant use JS) and then from there i can do whatever it takes for that window to end up on their screen, in a fixed pop up like window (no scroll no menu no nothing)
     
  9. VTECin5th

    VTECin5th Administrator

    Messages:
    2,182
    Likes Received:
    4
    Joined:
    Apr 17, 2005
    Location:
    Phoenix Az
    I'm lost i guess?
    They can just click one time to get that window open?
    Or do you mean they need to click a link to the page, and that needs to make the popup?
     
  10. CRX-YEM

    CRX-YEM Super Moderator Moderator VIP

    Messages:
    4,623
    Likes Received:
    54
    Joined:
    Sep 29, 2002
    Location:
    Wallingford, CT
    javascript as a popup might work, but in my case were I block javascript I'll never see it.
     
  11. reikoshea

    reikoshea HS Troll...And Mod Moderator VIP

    Messages:
    12,633
    Likes Received:
    193
    Joined:
    Apr 27, 2005
    Location:
    San Antonio, TX
    it starts out as an e-mail...from the email i need an ad. something like a window.open like above, but it just doesnt work in e-mails.
     
  12. CRX-YEM

    CRX-YEM Super Moderator Moderator VIP

    Messages:
    4,623
    Likes Received:
    54
    Joined:
    Sep 29, 2002
    Location:
    Wallingford, CT
    also keep in mind you're sending an email , which in fact is not a web browser, so a window.open call in javascript from a mail client might not open a "web browser" windows.

    also keep in mind many spam blockers junk mail with html and javascript so the effectivness of this ad might be degraded.

    just some food for thought.
     
  13. pissedoffsol

    pissedoffsol RETIRED

    Messages:
    49,693
    Likes Received:
    54
    Joined:
    Sep 28, 2002
    Location:
    Retirement Home
    how about using an absolute positioned div?
    you can fake it to look like a pop up using DOM scripting.

    similar to the my assistant "pop up". that is simply a div. it is not a popup.
     
  14. Bob Vila

    Bob Vila ɐןıʌ qoq Admin VIP

    Messages:
    4,670
    Likes Received:
    57
    Joined:
    Jul 4, 2003
    Location:
    Bristol, Ct.
    Maybe give this a try:
    Code:
    <A HREF="java script:void(0)" ONCLICK="open('adpopup.htm','miniwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=750,height=600')" style="text-decoration: none">
    set the href to the picture or whatever you want the user to click on. Set the adpopup.htm file to whatever you choose or set it to a hyperlink; http://www.kissmyass.com/adpopup.htm, etc. So the window will open with no scrollbars, etc ad to the size you request...

    However, I really don't think it will work in email, but give it a try...

    For some reason the code tag isn't recognizing an apostrophe after miniwin. Should be 'miniwin','toolbar
     
  15. pissedoffsol

    pissedoffsol RETIRED

    Messages:
    49,693
    Likes Received:
    54
    Joined:
    Sep 28, 2002
    Location:
    Retirement Home
    and where is function open?
     
  16. reikoshea

    reikoshea HS Troll...And Mod Moderator VIP

    Messages:
    12,633
    Likes Received:
    193
    Joined:
    Apr 27, 2005
    Location:
    San Antonio, TX
    lol, thank you, thats what i was gonna ask. keepin me alive even while i work on the ads (my boss was wondering why i only have the one for the tahoe one finished...she didnt seem to understand how big of a problem this was).
     
  17. kyleirwin

    kyleirwin Retired OG

    Messages:
    2,420
    Likes Received:
    2
    Joined:
    Oct 24, 2002
    Location:
    Vegas
    if you can deal with having scrollbars, menu's & a status bar... you can just link the e-mail to your ad and resize the window to your specs in javascript once it's open. that way you'll be able to avoid pop up blockers and won't have to include javascript in an e-mail.

    Code:
    <html>
    <head>
    <title><!-- ad title here --></title>
    <script language="javascript">
    function resze() {
    // change the width (800) and height (600) to your desired specs.
    window.resizeTo(800,600);
    
    if (self.innerWidth) {
    frameWidth = self.innerWidth;
    frameHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientWidth) {
    frameWidth = document.documentElement.clientWidth;
    frameHeight = document.documentElement.clientHeight;
    } else if (document.body) {
    frameWidth = document.body.clientWidth;
    frameHeight = document.body.clientHeight;
    } else return;
    
    // anything "800" below, change to your desired width.
    // anything "600" below, change to your desired height.
    if(frameWidth < 800 || frameHeight < 600) {
    newWid = 800 - frameWidth;
    newHei = 600 - frameHeight;
    newWid += 800;
    newHei += 600;
    window.resizeTo(newWid,newHei);
    }
    
    }
    </script>
    </head>
    <body onLoad="java script:resze();">
    <!-- ad content here -->
    </body>
    </html>
    
    edit: take the space out of "java script" in the onLoad function in the body tag. i don't know why it's there... the forum put it there.
     
  18. pissedoffsol

    pissedoffsol RETIRED

    Messages:
    49,693
    Likes Received:
    54
    Joined:
    Sep 28, 2002
    Location:
    Retirement Home
    <body onload="resze();">

    no need for all that java script: crap
     
  19. kyleirwin

    kyleirwin Retired OG

    Messages:
    2,420
    Likes Received:
    2
    Joined:
    Oct 24, 2002
    Location:
    Vegas
    old habits die hard.
     
  20. reikoshea

    reikoshea HS Troll...And Mod Moderator VIP

    Messages:
    12,633
    Likes Received:
    193
    Joined:
    Apr 27, 2005
    Location:
    San Antonio, TX
    id rather not have them there, but if thats what it comes to, i will use that.
     
Verification:
Draft saved Draft deleted

Share This Page