View Single Post
Old 05-11-2011, 06:06 PM  
Mamassita
Confirmed User
 
Join Date: Nov 2009
Posts: 252
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_Cookienamevaluepathdomainsecure ){
    var 
expires seconds_to_expire 1000
    
var today = new Date();
    
today.setTimetoday.getTime() );
    var 
expires_date = new Datetoday.getTime() + (expires) );
    
document.cookie name "=" +escapevalue ) +
    ( ( 
expires ) ? ";expires=" expires_date.toGMTString() : "" ) +
    ( ( 
path ) ? ";path=" path "" ) +
    ( ( 
domain ) ? ";domain=" domain "" ) +
    ( ( 
secure ) ? ";secure" "" );
}
{/
literal}
</script> 
Any ideas ??

Thanks!
Mamassita is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote