javascript - Get notified when objective-c dom updates are ready initiated from webview -


I am updating the domus webkit webwm through programmatic domelment objects - for complex UI, usually any The element that I add to the JavaScript component also asks the question of being notified when this update is complete - is there any such event? I know that regular devices do not fire an onload or org event, right? The second impression I had that could be completely wrong is that the domilement updates are not synchronous, so I can not do anything like this and believe that they will actually meet the labels in the DOM:

< Pre> DOMElement * displayNameLabel = [create documentElement: @ "div"]; [DisplayNameLabel setAttribute: @ "square" value: @ "user-display-name"]; [DisplayNameLabel setTextContent: currentAvatar.avatarData.displayName]; [[Document getElementById: @ "user-card-content"] appendChild: displayNameLabel]; Id win = [webView windowScriptObject]; [Evaluate WebSpace: @ "javascriptInstantiateLabel ()"];

Is this true?

I am already using jquery within the body of html, so I want to "live" in a particular class. I thought I might be able to do something like this:

  $ ("some-square-to-couple-after"). Live ("Ready", Function () for some fantastic JavaScript here).  

But have not experienced any happiness yet.

Thanks, Josh

Edit: Anurag Based on the answer, here is the code that I came up with (work):

function ("modify button panel subtitle", 7); $ ("Panel-button"). Each (function () "console.log (" found button "+ $ (this) .attr (" class "), 7); if (! $ (This) .hasClass (" $ ") ($ (This) HasClass ("chat")) {console.log ("got chat button, instant notification", "7"); var chat_button = new button ($ (this), chat_button_def); $ (this). AddClass ("Processed "$ (This) .hasClass (" get ")) {var chat_button = New button ($ (this), get_button_def); $ (this) .addClass (" processed ");} $ (" #bottom-button-panel "). Tie (" DOMSubtreeModified ", onButtonPanelChange); console.log" with changing button, Rebing ", 7);}}); } $ (Document) .ready (function () {$ ("# down-button-panel"). Bind ("DOMSubtreeModified", onButtonPanelChange);});

Note that you need to unlock the incident, because there is another incident in each subsequent change, and the second, and the other.

See similar questions asked an hour ago -

any element To listen for changes in, use something like this:

  $ ("# someDiv"). Bind ("DOMSubtreeModified", function () {warning ("tree change");});  

I have not written the DOM through Objective-C, so it is not known that the purpose is a way of subscribing to DOM events with wrappers.

DOMSubtreeModified The revised event works on the iPhone just tested with it.


Comments