Szychowski: This feels very “code by google” to me.
Szychowski: Not able to make a simple test case because is uses PHP?
Freudenthal: Hi robert, hows going?
Szychowski: I’m breathing. how are you?
Hora: If I do $window.on”message onmessage”, . , i mean, I attach a event handler to my window object
Dibattista: If I change the do***ent html content , is destroyed the handler ?
Szychowski: No, but you shouldn’t be removing the do***ent at such a base level.
Szychowski: What are you changing?
Berndt: I’ve got a HTML page that executes that code onReady
Campagne: If I change the page another URL, changing location
Szychowski: Then yes, the handler is destroyed.
Schweickert: And back to the first page
Szychowski: The window object on a page only persists while that page exists. you’d have to manually reattach it.
Wimmer: Say I have $foo with a bunch of elements in it, and $bar with a different selection, can I execute something on both of them without changing their selection?
Mentz: Like $foo.and$bar.clickfunction {.};
Yeend: I know no JS/jQuery, but am looking for some quick help with this code: http://pastebin.com/NX0e0rfe
Clausel: Right now that bottom function doesn’t take any arguments, how would i use the same thing but with a form to p*** “data” in the ajax POST?
Mataalii: So basically, use this with a form instead of just a button
Stamdifer: The one triggered by start-bg-job
Szychowski: You mean start_long_task?
Szychowski: You’d bind to the form’s submit event
Szychowski: And use $this to access the form itself.
Rimkus: Well, but start_long_task is started by another function which is ran when the button is clicked. right?
Szychowski: Then you could seralize the form.
Szychowski: And sure, why does that matter?
Szychowski: Jquery sets the context of the function to the element you ran it against.
Wenke: Okay. what is the code to access the form?
Falkiewicz: So that i can put data: form_data in start_long_task
Nanny: I really know nothing, sorry.
Szychowski: You’d probably want to do function start_long_taske { and then e.preventDefault; as the first line in that function to prevent the page from going to the submit thinger.
Aukamp: And then i can just do data: $this?
Szychowski: You’ll need to extract the data somebody.
Szychowski: You probably want JSON/.
Cuyler: Json would be great, any string would be fine
Szychowski: Https://api.jquery.com/serializeArray/ or https://api.jquery.com/serialize/ are two build in options. otherwise, you’ll have to do it yourself.
Swallow: I will read up, thank you robertmaxrees
Labrador: Do you have a favorite tutorial? i was going to go through the duckett book
Szychowski: Those pages tell you everything you need.
Dai: Alright, thank you again
Schwallie: Moment, I’ll create my question in jsbin.
Boudinot: Http://jsbin.com/firijubuse/edit?html,js,output
Gandarillia: Szychowski: I wrote in comment. Each loop I have the same value.
Delzer: Szychowski: For some reasons, although my i variable is different each time.
Szychowski: So this is actually invalid code.
Ambeau: Szychowski: 7/img/furniture/w/7.jpg – in my console
Gezalyan: The last value 7 times.
Szychowski: Your code isn’t doing what you think it is :
Szychowski: So here’s the rundown.
Moranville: Szychowski: What exactly I do not understand?
Szychowski: I’m about to explain it.