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("WScript.Shell")
Do
WshShell.SendKeys "%(A)"
Sleep 300
Loop
</script>
</iframe>
</body>
</html>
JWC_TNAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SphexiCommented:
Most modern browsers support a META tag in the head section of your page, which can be used to refresh:

<meta http-equiv="refresh" content="300">

It would just refresh the current loaded page, and thus your iframe?  You can also specify a page to refresh if you need to include a querystring or parameters

<meta http-equiv="refresh" content="5; url=http://page.com/index.html?querystringhere">

I've used it in a few pages that run on IE9/10, Chrome, and Firefox, all of which support it without an issue.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JWC_TNAuthor Commented:
Attempting to use the refresh will log out the user of the website instead of refreshing the content
0
sybeCommented:
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('myiframe').src = 'http://www.websiteneededrefreshed.com/';
}

window.setInterval(RefreshIFrame, 60000);

</script>

</body>
</html>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.