MSFN Forum: How to execute javascript on a WebBrowser control? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to execute javascript on a WebBrowser control? ...young programming newbie! Rate Topic: -----

#1 User is offline   JackM 

  • Group: Members
  • Posts: 2
  • Joined: 30-November 06

Posted 01 December 2006 - 12:06 AM

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


#2 User is offline   jaws75 

  • Member
  • PipPip
  • Group: Members
  • Posts: 124
  • Joined: 22-April 06

Posted 01 December 2006 - 12:15 AM

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

This post has been edited by jaws75: 01 December 2006 - 12:32 AM


#3 User is offline   JackM 

  • Group: Members
  • Posts: 2
  • Joined: 30-November 06

Posted 01 December 2006 - 12:19 AM

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...

#4 User is offline   LLXX 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Banned
  • Posts: 3,399
  • Joined: 04-December 05

Posted 02 December 2006 - 12:11 AM

View PostJackM, on Dec 1 2006, 01:19 AM, said:

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.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy