Jump to content


Member Since 31 Dec 1969
Offline Last Active Yesterday, 11:29 PM

Posts I've Made

In Topic: Change src attr

18 July 2014 - 10:07 AM

I don't hate you. I just don't like your attitude about jQuery. More importantly, I don't like how that attitude manifests in your posts, how you look down on people who use it or even mention it.

You talk about all these not-so-smart people who call themselves programmers but can't write a line of javascript because they are wasting their time with jQuery, and I don't necessarily disagree with you, but running around pointing this out and how you aren't one of those not-so-smart people doesn't help the situation. All it does is make you sound like a pretentious, elitist asshat.

You weren't really interested in helping OP out. All you really wanted to do was get on your soapbox and wag your finger at OP about jQuery, and then you threw out a few half-hearted words pointing vaguely in the right direction to try to justify it. This makes you look like a pretentious, elitist asshat offering up no actual solution.

If you are truly here to help and stick to your (misguided) anti-jQuery principles, then help end this pandemic of stupidity by posting a pure js solution and explaining to the OP how it works and why it is a better solution. Otherwise, don't post at all, because as Dr. House taught us, people only tolerate pretentious, elitist asshats if they also provide actual solutions.

In Topic: Change src attr

17 July 2014 - 10:49 PM

Hey I was a js "purist" for many years too, I know all about it. And I still advocate learning vanilla before frameworks. But I now also advocate learning them and using them, as well.

In Topic: Change src attr

17 July 2014 - 07:12 PM

Since I do not use jQuery because I prefer JS, I can only give you ideas.

Still anti-jQuery eh? You do know that jQuery is js right? The solution you offered up would be the same syntax, even the "jQuery" way, because jQuery is js. If you are coding vanilla js properly, under the hood it's going to be the exact same as jQuery. The only benefit not using it is for example if you have a simple site with minimal js needs in which case jQuery or the like is extra bloat. Not that it's *that* big a deal, what with ability for things to be cached and all..

I do appreciate someone who likes the vanilla way.. lord knows I've been having much trouble trying to hire someone who actually knows vanilla js.. but you're only hurting yourself by not learning frameworks like jQuery. What if you come across a client willing to throw lots of money at you to fix something or dev something but requires knowledge of jQuery? Sure would be a shame turning that down.. Or..what if they hire you to do something for them and you do it the vanilla way and they're all like "Uh.. we have jQuery on the site.. what's with all this extra unnecessary code?" Are you gonna argue with them your (misguided) principles?

In Topic: regex &,

17 July 2014 - 06:44 PM

str_replace matches for exactly what you specify, no patterns (no regex). The first argument of str_replace can either be a string or an array. This is fine, because you aren't trying to match for any patterns.

$var = str_replace(array(',','&'),'',$var);

In Topic: regex &,

17 July 2014 - 04:56 PM

Replace them with what? Also, you probably only really need to use str_replace not regex.

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime