Cork: What do you think.

 
Roelle: Zumba_ad_: the one option you have is to catch ALL errors in the page

Sittner: 1. bind an window.onerror, or 2. wrap the function inside the jsonp resoponse

Pivin: Https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror

Curi: This one is bound as $window.on’error’, func

Allender: With jquery and it is how you should do it

Bollinger: Cork: Why does this not work? https://jsfiddle.net/ftj4tyhw/7/ I want it to get inside the paragraph or underneath it, like when you click on the expand it should get underneath the paragraph and not under the whole section

Swezey: But note you will silence all code errors in the page if you cancel them in that handler

Belay: Ah, glad you mentioned it

Bruneau: Vanbecelaere: cause this is the window object on that line

Hockenberry: Vanbecelaere: i think you need to look into the basics of js, events and jquery

Mcguckin: Vanbecelaere: this is a special variable, and events sets them to the element they fired on

Gano: Vanbecelaere: that is why you can use $this.closest in the click handler

Rotanelli: On the resize it won’t work though

Hokenson: Vanbecelaere: also note you will have hundreds of event handlers in a few seconds with that code

Konigsberg: Cause every time resize fires and the window width is smaller then 800px you will bind a new handler

Stoltz: Cork: I understand, could I move the on’click’, . outside the function and just do a if statement if the window.width is smaller than 800px?

Mertz: No cause that will only execute on page load

Cerrillo: Cork: Hmm. Right! How could I do it then? – I’m kinda confused

Gavitt: The best option is to just make the if check inside the click handler when it “would fire”

Pollman: That results in the check only having to fire when someone actually clicks

Kapiloff: Cork: Do you’ve time and the energy for making an demo maybe? And if possible if it’s not much to ask, if you could maybe also include how to get the appendTo workout?

Tatters: Hey Cork, think you can help with my question earlier, it’s simple

Tupper: Vanbecelaere: have you checked https://learn.jquery.com/ ?

Hubler: Mvpgraff: ask it again

Dilan: Is there a way to target multiple element cl***es using toggleCl***? Example: $selector.toggleCl***’oldCl***1 oldCl***2 newCl***1 newCl***2′;

Susko: Cork: I’ve been sneaking on it, sorry if I ask some dumb questions.

Dacamara: Vanbecelaere: it isn’t dumb questions

Marmion: Dumb questions don’t exist, only dumb answers that teach nothing

Vasguez: Just basic ones that are kinda expected that ppl learn through the tutorials

Oconnell: We were all noobs once!

Mattila: I thought toggleCl*** did just that, toggled -a- cl***, not swap cl***es

Eikleberry: Mvpgraff: i almost said yes, but then i remembered that it actually bugs out if you do that

Lepera: Ah, wow did i even misunderstood the question?

Nuffer: I thought you meant to flip all the cl***es

Aarsvold: Cause yes you toggle cl*** only handles a single cl***

Sarni: Yea, as expected – I was curious if there something out there that combats that though. I’m trying to switch bootstrap cl***es using jQuery for A/B testing on a page

Faddis: Mvpgraff: what toggleCl*** does is taking the cl***Name attribute from the element

Glanton: Then split them on space

Berno: And then check if the “value” exists inside that array

Mallery: So if you give toggleCl*** a string with multiple cl***es things go bonkers

Mattila: Actually to prevent maybe some unwanted proliferation

Helzer: Mvpgraff: $’.oldCl***1′.removeCl***’oldCl***1′.addCl***’newCl***1′

Laa: Cork: What do you think about this, this works pretty much like I want now: https://jsfiddle.net/ftj4tyhw/8/