June 19, 2007

Calling JavaScript functions from C++ with WebKit

Filed under: Distribute — Ryan Wilcox @ 12:06 pm

I figured out how to call JavaScript functions from C++ with WebKit today.


WebCore::KJSProxy* js = frame->scriptProxy();
if (js)
{
js->evaluate(filename, linenum, scriptText, Node);
//filename can be "" and linenum can be 0 if you want to just execute the line in scriptText
}

Now the next task: calling C++ objects from JavaScript…

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment