Stanfa: Its only about .replace
Roseum: SET trimmedValue EVAL””
Wakley: Dekok: SyntaxError: missing ; before statement
Glad: Whole thing is iMacros
Usman: Ask the JS portion of your question if it’s a JS question
Spuler: Whatever is doing ” is probably not going to do what you expected with b
Usman: If your code gets pre-p****d, give us the post-p****d JS code
Usman: Obviously {{!EXTRACT}} is not a pattern that is matched in your replace
Valesquez: Mehmeh: you need to know what’s the entire string getting p***ed to “EVAL” then. Maybe EXTRACT is valid JS, maybe it isn’t.
Formella: Aight, thanks for your help guys, I’ll get to it tommorow
Spuler: Just add twice as many backslashes
Colaiacovo: Dekok: it’s probably not even JS, my bad
Wentz: Eval””{foo}”.trim”.replace/{foo}/, ‘foo”bar’
Wakley: Dekok: SyntaxError: missing after argument list
Weiss: Wanted to finish this today but Im leaving in 10 mins so I joined this channel :
Pletcher: That’s most likely the problem you have. But you need to know what EXTRACT is. If it’s dynamic, that code you have up there is not going to work
Crossley: Dekok: well, Im extracting a block of text
Vodicka: Mehmeh: yeah, you need to transform that text into a valid JS string, then. String interpolation isn’t going to help you there.
Neuschwander: I want to trim it so it’s only “msg NickServ confirm *9charsCodeHere*”
Weissinger: Have a good day guys, sorry and thanks
Landau: If i have var a = element; element is a div with stuff in it and i want to change the style to it, tried a.attr”style”, “css”; and it didn’t work, how can i do this?
Gershkovich: What were you expecting that code to do
Gershkovich: You’ll want something like a.stylestyle = yourStyle
Ludovici: Gershkovich: i’m trying to use jquery to change the style
Nasalroad: A.style.color = ‘red’
Tacy: I know it’s dumb but i’m a noob
Tag: Hm. again a best practice thing: I want to run a function which has 2 “modes of operation” so i want to send along an argument for which mode. How would I make this p***ed variable meaningful? Should I use a string and check for it? Or just have good variable names and use a boolean?
Nasalroad: How to slow your javascript :-p
Usman: Twirl: a.style.color = ‘red’;
Usman: There’s no need to use jquery
Gershkovich: Anotheryou: best practice would not be to have a function that does two things, but make it two functions :v
Dempewolf: Usman: its for other stuff that was just an example
Struzzi: Gershkovich, I want to either update all divs on page load or just the hidden one on some other action
Cervera: Gershkovich, so you think, I should make 2 functions that just share child functions :
Ruckey: And the update function is quite complex with an ajax call and stuff
Nasalroad: It’s only easier if you works on many elements
Gershkovich: Anotheryou: yes, one update function, on load you iterate over all divs, otherwise you can just p*** the hidden div to it
Dartt: Gershkovich, all a little more complicated :
Gershkovich: Divs.forEachupdate and updatehiddenDiv
Usman: Twirl: still true — you don’t need jquery to change styles
Usman: Twirl: and in general, if you want to know about X, ask about X
Usman: Don’t obfuscate in irrelevant examples
Nonnemacher: Gershkovich, I fill div 1 until it’s overflown, than I remove the last thing i put in and put it in div number 2. So div 1 overflows to div 2. When the user skips to div 2, div 1 get’s updated, once the user switches back to div 1, div 2 gets updated.
Nasalroad: Well, you will get irrelevant answer :-p