Mamassita |
05-11-2011 06:06 PM |
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 :disgust
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!
|