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: Dynamically reset the DOM?



Hi Geoff, my comments inline..
--
Michael Hanna
iChat: michaelkhanna(AIM)


NSString * scriptPreamble = @"<!-- function cocoacalling(scrObject) { scrObject.Score = 1000; document.write('cocoacalling'); return scrObject.Score;}";

I'm suggesting changing that to

NSString * scriptPreamble = @"<!-- function cocoacalling() {alert('cocoacalling got called'}";

and changing 

result = [wso callWebScriptMethod:@"cocoacalling" withArguments:args];

to

result = [wso callWebScriptMethod:@"cocoacalling" withArguments:nil];

and testing whether the function gets called at all. Is that possible?


yes of course, will try that.

You might as well log wso at the time as well, just for sanity's sake.

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

Is this a typo? I thought the loadHTMLString case did not return a value.


yes, sorry that was a typo. loadHTMLString did not return a value.

As for loadRequest, that is indeed strange.

what if I generated scratch files in a temporary directory and reload them with loadRequest:pathForResource: ?

Seems like a reasonable work-around, but I'd prefer to get to the bottom of the problem.


As do I! I will be working on this over tomorrow and will update you and the list on this.
Michael

Geoff


 _______________________________________________
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

This email sent to email@hidden

References: 
 >Dynamically reset the DOM? (From: Michael Hanna <email@hidden>)
 >Re: Dynamically reset the DOM? (From: Geoffrey Garen <email@hidden>)
 >Re: Dynamically reset the DOM? (From: Michael Hanna <email@hidden>)
 >Re: Dynamically reset the DOM? (From: Michael Hanna <email@hidden>)
 >Re: Dynamically reset the DOM? (From: Geoffrey Garen <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.