It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Trigger button press on page reload in chrome.

Trigger button press on page reload in chrome.

Postby rbaylis on Tue Jul 12, 2011 6:35 pm

Hi guys,
this is my first time here and I'm quite the Javascript noob, but I was just wondering if it was possible to use javascript to have a button pressed on refresh. Here is the page I am trying to use. I have it auto-reloading every "X" seconds using this:


javascript:
timeout=prompt("Set timeout [s]");
current=location.href;
if(timeout>0)
setTimeout('reload()',1000*timeout);
else
location.replace(current);
function reload(){
setTimeout('reload()',1000*timeout);
fr4me='<frameset cols=\'*\'>\n<frame src=\''+current+'\'/>';
fr4me+='</frameset>';
return animator.callEvent('play',this);
with(document){write(fr4me);void(close())};
}

I am trying to trigger the play button on this webpage
http://www.weatheroffice.gc.ca/radar/in ... tml?id=XFT

This is the name of the anchor tag, I'm just not sure how to trigger it.
<a href="#" id="play-button" onclick="return animator.callEvent('play',this);" onmouseover="animator.callEvent('depress',this);" onmouseout="animator.callEvent('uplift',this);"><img src="http://www.weatheroffice.gc.ca/images/animation_buttons/play.gif" alt="Play"></a>

Any help would be greatly appreciated,
Thanks,
Russell
rbaylis
 
Posts: 1
Joined: Tue Jul 12, 2011 6:28 pm

Re: Trigger button press on page reload in chrome.

Postby rajmv on Thu Jul 14, 2011 6:02 pm

try
return animator.callEvent('play',document.getElementById('play-button'));
rajmv
100+ Club
 
Posts: 103
Joined: Thu Jul 14, 2011 7:22 am


Who is online

Users browsing this forum: No registered users and 9 guests