Jump to content

Recommended Posts

Posted

Hello

I'm trying very hard to figure out how to execute javascript code on a webpage after it has loaded. Apple has a method called stringByEvaluatingJavaScriptFromString to do this in there WebKit but I cannot find anything like it for MSHTML.

Please help :thumbup


Posted (edited)

Two options.

In the body tag put onload="function.to.be.called"

eg.

<body onload="doit()">

or at the end of the document before the closing html tag use window.onload(bla.bla.bla)

try searching onload for more info.

good luck

edit: sorry I misunderstood the question

Edited by jaws75
Posted

Hmm but I want to execute it AFTER it has loaded when i choose to. So i can't embed it into the html code itself...

Posted
Hmm but I want to execute it AFTER it has loaded when i choose to. So i can't embed it into the html code itself...
Put script tags at the very bottom of the HTML.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...