SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast marc_2ky's Avatar
    Join Date
    Apr 2004
    Location
    Glasgow, Scotland
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onClick to popup on entry, can this be done?

    Hi, i am using a chromoless window on which you have to click to open...

    Code:
    <a href="javascript://" onClick="javascript:openChromeless('popup.php',548,375)" onfocus="blur();">Open Chromeless Window</a>
    I was just wondering is there anyway in Javascript to convert this to open onLoad when the page opens to show the screen without clicking on a link.

    Thanks in advanced!
    Marc
    I am a learner, be gentle!

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    Code:
    <script type="text/javascript" language="javascript">
    <!-- Hide from browsers without javascript
    
    window.onload = function()
    {
    	document.links[3].onclick();
    }
    
    
    // End hiding -->
    </script>
    </head>
    Count the links on your page starting at 0 until you get to your link. Then, use that number in the links[] array in place of 3.

  3. #3
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marc_2ky

    I was just wondering is there anyway in Javascript to convert this to open onLoad when the page opens to show the screen without clicking on a link.
    This will be blocked by most modern browsers.

  4. #4
    SitePoint Enthusiast marc_2ky's Avatar
    Join Date
    Apr 2004
    Location
    Glasgow, Scotland
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Problem sorted, thanks 7stud
    I am a learner, be gentle!


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
  •