Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 3 123 LastLast
Results 1 to 15 of 34
  1. #1
    Regular Coder
    Join Date
    May 2003
    Location
    Chicago, IL
    Posts
    131
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Would like index page to redirect viewer.

    I'm interested in having the index page to my site automatically redirect viewers to a tooless popup in which the site will appear.
    At the same time I'd like the index page to jump to another "closing" or "thank you" page for lack of a better discription. I have the following script for a pop up which I have used in the past. I realize that it needs to go in a blank html doc.
    I'm lost after that.
    Code:
    <script>
    <!--
    function winopen(){
    var targeturl="newPage.html"
    newwin=window.open("","","scrollbars")
    if (document.all){
    newwin.moveTo(0,0)
    newwin.resizeTo(screen.width,screen.height)
    }
    newwin.location=targeturl
    }
    //-->
    </script>
    How do I go about getting the function to perform automatically?

    Thanks!

  • #2
    Regular Coder
    Join Date
    Aug 2003
    Location
    Loughborough University
    Posts
    427
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To get it to run the function automatically you would use the onload event handler, like this:

    <body onload="winopen();">

    I would suggest making your index page into the thank-you or good-bye page and including the pop-up script in it. Gimme 5 mins and I'll post an example of what I mean.
    AMD Athlon "Barton" XP 3200+ (11*200.5MHz = 2.2GHz)
    BFG GeForce 6800 Ultra OC 256Mb
    3 * Kingston 256Mb PC3200 DDR400
    Seagate Barracuda 120Gb Ultra ATA-100 and Seagate Barracuda 160Gb, SATA-150

  • #3
    Regular Coder
    Join Date
    May 2003
    Location
    Chicago, IL
    Posts
    131
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I appreciate the assistance!!!

  • #4
    Regular Coder
    Join Date
    Aug 2003
    Location
    Loughborough University
    Posts
    427
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, I made two different versions of the script. I suggest using the second version as it is more friendly for the people without JavaScript enabled.
    Attached Files Attached Files
    AMD Athlon "Barton" XP 3200+ (11*200.5MHz = 2.2GHz)
    BFG GeForce 6800 Ultra OC 256Mb
    3 * Kingston 256Mb PC3200 DDR400
    Seagate Barracuda 120Gb Ultra ATA-100 and Seagate Barracuda 160Gb, SATA-150

  • #5
    Regular Coder
    Join Date
    May 2003
    Location
    Chicago, IL
    Posts
    131
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Ok, I have a few questions about 'version2'.

    I'm seeing 3 pages (index, index2, & index3). When viewing the source to index.html I'm seeing a number of error messages (based on whatever situation arises), though I don't see the winOpen function, nor do I see any links to the two other pages.
    When I click on that page nothing happens.

    When I click on index2.html I get the fullscreen pop-up toolless window, while a smaller window appears, then disappears (I assume this is the "Goodbye" page). When I view source to index2 I see the same script I view in index.html.

    Index3.html is self explanatory.

    I'm confused as to how to link all three (because I see no reference to index2 or index3 in index.html. And, because nothing occurs when I click on index.html I'm not sure if this is actually what you've intended to be the index page?

    I do appreciate your help!!!

    BTW, I have it working using the suggested setup in your version 1.
    Last edited by hothousegraphix; 09-25-2003 at 10:53 PM.

  • #6
    Regular Coder
    Join Date
    Aug 2003
    Location
    Loughborough University
    Posts
    427
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's supposed to happen is when you open index.html, if you have JavaScript enabled it will re-direct you to index2.html.
    If you don't have JavaScript enabled you will stay on index.html where it will display a noscript version of your web-site.

    If you are re-directed to index2.html, it displays the good-bye message and opens index3.html as a new window with the JavaScript version of your web-site in it.

    At least that's the way it's supposed to work. Could you explain in a lot more detail about exactly what happens when you open index.html and include what errors you are getting. Also whether you are using Mac or windows (I only have windows), and what browser and version etc. In the mean time I'll test out the script with all of the other browsers that I have.
    AMD Athlon "Barton" XP 3200+ (11*200.5MHz = 2.2GHz)
    BFG GeForce 6800 Ultra OC 256Mb
    3 * Kingston 256Mb PC3200 DDR400
    Seagate Barracuda 120Gb Ultra ATA-100 and Seagate Barracuda 160Gb, SATA-150

  • #7
    Regular Coder
    Join Date
    May 2003
    Location
    Chicago, IL
    Posts
    131
    Thanks
    3
    Thanked 0 Times in 0 Posts
    When clicking on index.html I'm getting the The page cannot be displayed message.

    I'm on a windows machine, with XP. IE6 with latest updates.

    As I said earlier I do have this working using the simpler version.

    What I'm intending, is to have the index page redirect to a new window containing my flash site Link.
    I've done this plenty of times with the on(click) function, though, never automatically.

  • #8
    Regular Coder
    Join Date
    Aug 2003
    Location
    Loughborough University
    Posts
    427
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmmm, that's strange. I'm testing it in IE6 on Win XP home, complete with updates as well.

    Have you disabled pop-ups or anything like that with your security settings? If so that could be causing the problem.

    In any case I have replace location.href with location.replace, see if that solves the problem. If not try the file Copy of index.html and see if that one works, it will take you to the W3C site (theoretically).

    Is it even the redirect that's the problem? Are you actually being taken to index2.html or are you being left at the index page?
    Attached Files Attached Files
    AMD Athlon "Barton" XP 3200+ (11*200.5MHz = 2.2GHz)
    BFG GeForce 6800 Ultra OC 256Mb
    3 * Kingston 256Mb PC3200 DDR400
    Seagate Barracuda 120Gb Ultra ATA-100 and Seagate Barracuda 160Gb, SATA-150

  • #9
    Regular Coder
    Join Date
    May 2003
    Location
    Chicago, IL
    Posts
    131
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Being left on the index page. Haven't disabled anything.

    I'll take a look at your updated version.

  • #10
    Regular Coder
    Join Date
    May 2003
    Location
    Chicago, IL
    Posts
    131
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Still occuring.

    Though, when I click on index2.html, the pop-up occurs as intended, and when closed, index3 is displayed.



    Seems like the way it should work, but, from the index page, NOT index2.

  • #11
    Regular Coder
    Join Date
    Aug 2003
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    &nbsp;........ another wild guess ........

  • #12
    Regular Coder
    Join Date
    May 2003
    Location
    Chicago, IL
    Posts
    131
    Thanks
    3
    Thanked 0 Times in 0 Posts
    cheesebag - thanks for the link, though, thats not exactally what I'm doing. I want the tooless pop-up window to open autimatically when the user types in the address and hits go on their browser, not with a button action.

    I now understand how to have this function performed without
    the user action.

    Thanks

  • #13
    Regular Coder
    Join Date
    Aug 2003
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hothousegraphix...

    Figured that, but it's easy to modify, and seems a typical scenario for Flashers. Nice site, btw.
    &nbsp;........ another wild guess ........

  • #14
    Regular Coder
    Join Date
    May 2003
    Location
    Chicago, IL
    Posts
    131
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks

  • #15
    Regular Coder
    Join Date
    May 2003
    Location
    Chicago, IL
    Posts
    131
    Thanks
    3
    Thanked 0 Times in 0 Posts
    K, here's a new wrinkle...I would also like to include this plug-in detection script I've found which gets placed in the same directory as the index page.
    Below is the script provided:
    Code:
    <script src="plugins.js">
    
    //Detect Plugin (Flash, Java, RealPlayer etc) //
    //SAMPLE USAGE- detect "Flash"
    if (pluginlist.indexOf("Flash")!=-1)
    document.write("You have flash installed")
    
    </script>
    What I would like to do is something like this:
    Code:
    if (pluginlist.indexOf("Flash")!=-1){
    //instead of document.write("You have flash installed")//
    //I would like simply like to perform the winopen function//
    //taking the user to the toolless pop-up if FLASH is installed//
    
    winopen();
    }
    else{
    //If user does not have FLASH installed - prompt to install//
    window.location.href= "DownloadFLASHPLAYERpage.html"
    }
    What I need to know is if, for this to function correctly, should I place between the body tags and again use the onload function?

    Does the above script look formatted correctly?

    Thanks.


  •  
    Page 1 of 3 123 LastLast

    Posting Permissions

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