JWC_TN
asked on
Sendkey to HTML iFram
I need to have a website open in an iframe and every few minutes send alt A to refresh the contents of the website. Below is the code I have that is not working
<html>
<body>
<iframe src="www.websiteneededrefreshed.com/">
<script type="vbscript">
Set WshShell = WScript.CreateObject("WScr ipt.Shell" )
Do
WshShell.SendKeys "%(A)"
Sleep 300
Loop
</script>
</iframe>
</body>
</html>
<html>
<body>
<iframe src="www.websiteneededrefreshed.com/">
<script type="vbscript">
Set WshShell = WScript.CreateObject("WScr
Do
WshShell.SendKeys "%(A)"
Sleep 300
Loop
</script>
</iframe>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In html it is more common to use javascript. Write a javascript that will set the src of the iframe every x seconds. The javascript function to use for that is setInterval().
<html>
<body>
<iframe id="myiframe" src="">
<script>
function RefreshIFrame() {
document.getElementById('m yiframe'). src = 'http://www.websiteneededrefreshed.com/';
}
window.setInterval(Refresh IFrame, 60000);
</script>
</body>
</html>
<html>
<body>
<iframe id="myiframe" src="">
<script>
function RefreshIFrame() {
document.getElementById('m
}
window.setInterval(Refresh
</script>
</body>
</html>
ASKER