Hey guys, I have a JS.

 
Wiltsie: When i visit the video it is complaining about directly the video plays

Shupe: I want to alter an element. But the element doesn’t exist within the do***ent yet.

Correro: So how do I do this: “when the element exists on the page, then do my stuff to it”

Ihm: You have to execute the logic after it is created

Ihm: There’s not any event for elements being created. you should know where/when it’s created

Ihm: How is the element being created?

Perotta: It looks like it’s being injected into the page by an ajax call

Ihm: So the success callback of the ajax is most likely creating it then. your logic would have to go in there

Tromley: I cant touch that script

Slauson: Watch for DOM change then search for the element and do logic things to it would be your only option then

Ihm: Polling dom, which is nasty.

Dahm: Yeah its a far cry from the best option, but considering your limitations you might not have any other choice

Ihm: Unless the method you call that does the ajax request returns a promise/deferred?

Ahluwalia: Ihm: it’s not my script and I can’t touch it

Bernieri: I have to build my own

Ihm: Your using a script you can’t touch. that’s strange

Tribbey: Not really. that’s what happens when you work with CMS’s.

Ihm: The CMS doesn’t have any sort of API do***entation?

Manchester: Well, it’s even a little more complicated then that. I’m working around some behaviour implimented by an extenstion to the CMS.

Bendig: And I don’t want to touch the extensions code either: I don’t want my hacks to be overwritten

Bramlette: So I want to isolate my own code from the CMS and it’s extensions

Puidokas: I’m sure that this isn’t an unusual scenario

Ihm: Alright, well in any case. if you can’t touch the script and the script does not return a promise/deferred, then one option is to poll until you find it, do your logic, and then stop the poll

Cotta: So that’s the idea behind the “mutation observer” pattern, right?

Ihm: Mutation observers are actual browser implementation related to this, which are not widely adopted in browsers yet

Ihm: They make dom changes actual events, in a manner

Thede: Is there a jquery way of, I guess, watching for changes to the DOM?

Biltz: More of a vanilla js question I guess. But maybe I could use DOMSubtreeModified

Lebahn: Like “if domsubtreemodied, then check for the existence of my element. ”

Newstead: The thing I was thinking would cause an infinite loop

Ihm: Http://stackoverflow.com/questions/6659662/why-is-the-domsubtreemodified-event-deprecated-in-dom-level-3

Ihm: And apparently its deprecated

Kampe: And that sx thread leads me back to MutationObserver, which I understand is not available in IE9

Ihm: Looks like it was implemented in 11

Ihm: So yeah, worst case https://jsfiddle.net/htgmnnun/

Fengler: I’m not much up to standard practices. If I have PHP on the backend, and I have a page that requires a form, a confirmation of order, that then sends to a payment charge process, what is the “best practice” way of doing this? 3 php pages with session variables, or jquery/singe page app style

Reineman: Can someone please tell me how do i use/integrate that helper functionsavePageContent in a script? http://stackoverflow.com/questions/12826596/write-results-into-a-file-using-casperjs

Mumpower: Https://jsfiddle.net/uvk27dfz/1/ could someone guide ? thanks

Panak: Hey folks, experiences some new unexpected behavior from jQuery UI widgets since yesterday.

Brzenk: Can’t find info via google, etc

Morsell: Loading external styles that weren’t there before

Cocola: Hey guys, I have a JS question but #javascript isn’t helping. can anyone explain how this script: https://www.coshx.com/blog/2015/02/19/developing-an-embeddable-javascript-widget-snippet-for-client-sites/ conveys the data-widget-id to the server?