scriptObject is a field instance of the delegate class. It's an
NSObject subclass called LJSScriptObject.
LJSScriptObject * scriptObject;
I've added this in windowScriptObjectAvailable:
[wso setValue:scriptObject forKey:@"scrObject"];
but doing this creates no discernible difference.
I'm using pre-existing JavaScript, which cannot be modified.
'scrObject' is the name and parameter I have to use.
what confuses me is that using loadRequest:pathForResource: will
allow me to get a result, "1000", while inserting a new string with
loadHTMLString:baseURL: returns me a result(whether or not I have
[wso setValue:scriptObject forKey:@"scrObject"]; in the
webView:windowScriptObjectAvailable:. In both cases
webView:windowScriptObjectAvailable: are called.
what if I generated scratch files in a temporary directory and reload
them with loadRequest:pathForResource: ?
Michael
--
Michael Hanna
email@hidden
iChat: michaelkhanna(AIM)
Note: The objects you expose to JavaScript using this technique may
conform to the WebScripting interface of Web Kit, which is
available in Mac OS X version 10.4. The Web Kit uses the methods of
this interface to allow you to control which methods you expose
from your Objective-C class. For more information, see Using
Objective-C From JavaScript in Cocoa User Experience Documentation.
To test if an invalid argument is your problem, change cocoacalling
to take no arguments and issue a simple alert and see if it executes.
Michael
--
Michael Hanna
email@hidden
iChat: michaelkhanna(AIM)
On 2-Dec-05, at 11:50 AM, Geoffrey Garen wrote:
It would be interesting to NSLog the result of the outerHTML call
to see exactly what HTML you end up reloading. I suspect the
result does not include the script you've constructed, which may
indicate a bug in WebKit.
Geoff
On Dec 2, 2005, at 11:21 AM, Michael Hanna wrote:
Hi I'm trying to inject JS into the DOM dynamically, but I'm
having trouble getting a result from the injected JS which
*would* give me a result when I loaded the standard way from a
file.
The html code in the webview is like this at first:
I know my technique is in error in some way. Is there a way to
dynamically inject JS like I'm trying to?
--
Michael Hanna
email@hidden
iChat: michaelkhanna(AIM)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webkitsdk-dev/ggaren%
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden