Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can I call JavaScript from webkit?



On Jun 30, 2005, at 2:56 AM, Gary Yuen wrote:

Is it possible to call a JavaScript function from the currently loaded page? After it's loaded, can call a function and pass it a value?

Yes.

And the right place to ask this is on the perhaps-misleadingly named email@hidden mailing list. This is an obsolete list for talking about development of WebCore; that discussion is now part of the WebKit Open Source Project (see our website at <http:// webkit.opendarwin.org>).

There are two easy ways to do this. One is to call:

    -[WebView windowScriptObject]

on an existing WebView. This gives you an object of type WebScriptObject, and you can get properties, call methods, etc.

There's also an older API:

    -[WebView stringByEvaluatingJavaScriptFromString:]

which takes a string.

    -- Darin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webcore-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webcore-dev/email@hidden

This email sent to email@hidden
References: 
 >can I call JavaScript from webkit? (From: Gary Yuen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.