SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    How Much Money?
    Join Date
    Aug 2001
    Location
    Liverpool, UK
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Simple question?

    I have a simple newsfeed typr script, is it possible to add a javascript to open a popup
    window on load. or is there a special PHP script needed for this

    Thankyou

    Matthew Taylor
    AutomatedLinks.com
    Boost your search engine ranking, by increasing your link Popularity,
    Dynamically.

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It doesn't have to be an onload:

    Code:
    <SCRIPT LANGUAGE="Javascript">alert("Hello!"); </SCRIPT>
    or in php

    PHP Code:

    <?php

    echo("<SCRIPT LANGUAGE='Javascript'>alert('Hello!')\;</SCRIPT>");
    ?>
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    How Much Money?
    Join Date
    Aug 2001
    Location
    Liverpool, UK
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sorry

    Sorry i didnt explain what i wanted,
    i dont want a popup message. i want a popup window with that is a html document.

    Thankyou

    Matthew Taylor
    AutomatedLinks.com
    Boost your search engine ranking, by increasing your link Popularity,
    Dynamically.

  4. #4
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A very crude way of doing it this:

    Code:
    <head>
    window.open('url.html');
    </head>
    but you can turn it into a function and start doing crazy things (like removing title bars etc)for example, this one (from jss) which opens with a delay of 2 seconds:

    Code:
    <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
    
    <HEAD>
    
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Original:  Ronnie T. Moore, Editor -->
    <!-- Web Site:  The JavaScript Source -->
    
    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    
    <!-- Begin
    closetime = 0; // Close window after __ number of seconds?
    // 0 = do not close, anything else = number of seconds
    
    function Start(URL, WIDTH, HEIGHT) {
    windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT;
    preview = window.open(URL, "preview", windowprops);
    if (closetime) setTimeout("preview.close();", closetime*1000);
    }
    
    function doPopup() {
    url = "http://javascript.internet.com/navigation/delayed-popup-window.html";
    width = 267;  // width of window in pixels
    height = 103; // height of window in pixels
    delay = 2;    // time in seconds before popup opens
    timer = setTimeout("Start(url, width, height)", delay*1000);
    }
    //  End -->
    </script>
    
    <!-- STEP TWO: Insert the onLoad event handler into your BODY tag  -->
    
    <BODY OnLoad="doPopup();">
    
    <p><center>
    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>
    
    <!-- Script Size:  1.27 KB -->
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky


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
  •