Javascript help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mamassita
    Confirmed User
    • Nov 2009
    • 252

    #1

    Javascript help needed

    I want the page to close automaticly after 10 seconds, without clicking on close button, but seem i can't figure it out

    PHP Code:
    <script type="text/javascript">
    /** 
     * Number of seconds the video is accessable 
     * without clicking continue after submitting
    */
    var seconds_to_expire = 10
    //-----------------------------------------------
    var baseurl = '{$baseurl}'
    var video_id = '{$videox}'
    var video_title = '{$titlex}'
    {literal}
    // Set Valid Cookie Value and Redirect back to this page
    function clickToContinue(){
        Set_Cookie( 'Private-Video', video_id, '/', '', '' )
        parent.window.document.location = baseurl + '/video/' + video_id + '/' + video_title 
    }
    // Set Cookie
    function Set_Cookie( name, value, path, domain, secure ){
        var expires = seconds_to_expire * 1000
        var today = new Date();
        today.setTime( today.getTime() );
        var expires_date = new Date( today.getTime() + (expires) );
        document.cookie = name + "=" +escape( value ) +
        ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
        ( ( path ) ? ";path=" + path : "" ) +
        ( ( domain ) ? ";domain=" + domain : "" ) +
        ( ( secure ) ? ";secure" : "" );
    }
    {/literal}
    </script> 
    
    Any ideas ??

    Thanks!
  • ThatOtherGuy - BANNED FOR LIFE
    So Fucking Banned
    • Apr 2011
    • 1241

    #2
    self.close

    Perhaps

    Comment

    Working...