News for hackers. Stuff that matters.
Re:Autocomplete from Stack Overflow by WithTeeth on Tuesday March 22, 2016 @08:42AM (#11336058)
Cool idea, but kind of ironic that the example you used produces unnecessarily complicated stack overflow solutions. A JavaScript "contains" function is as simple as:

var contains = function (needle, haystack) { return haystack.indexOf(needle) !== -1 }

Re:Autocomplete from Stack Overflow by pferde on Tuesday March 22, 2016 @10:34AM (#11336863)
You should submit this to SO, so that future developers can have it autocompleted in their projects.
Re:Autocomplete from Stack Overflow by ne0phyte on Tuesday March 22, 2016 @09:10AM (#11336257)
Older IEs don't have Array.indexOf(). So you either have to extend the Array prototype or, you know, just implement it in a more compatible way.
Re:Autocomplete from Stack Overflow by habith on Tuesday March 22, 2016 @04:25PM (#11339718)
> Older IEs don't have Array.indexOf()

IE8 and older to be specific[0]. But, if you're supporting IE8 still you have bigger problems at hand.

Microsoft stopped supporting any version lower than IE11 as of January 12th of this year[1]. So unless all of those older IE machines are accessing an intranet (and only an intranet) their risk of being hit with malware is way higher than average.

For my clients I do a cursory IE9+ review, but if anything lower is a requirement then it's an additional fee to make a site work with it.

In a few months it'll be IE11+ and the same fee structure will apply to anything lower (I'm just waiting for IE10 to wind down a bit).

[0] http://caniuse.com/#search=array.indexof

[1] https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE...

Re:Autocomplete from Stack Overflow by CiPHPerCoder on Tuesday March 22, 2016 @10:01AM (#11336630)
Or just not support older IEs.

http://browserupdate.org/

[dead]
Re:Autocomplete from Stack Overflow by extrapickles on Tuesday March 22, 2016 @03:48PM (#11339455)
What I do, is provide nwjs to those on old versions, so they think they are getting the "application" version, but in reality, its Chromium hard coded to only goto the web application.

So far its a win for both parties, since they are not installing another browser than can interfere with some silly IE6 only internal enterprise site and we get to use the latest browser features.

Re:Autocomplete from Stack Overflow by dang on Tuesday March 22, 2016 @04:37PM (#11339788)
Please don't post uncivil comments here.
Re:Autocomplete from Stack Overflow by romanovcode on Wednesday March 23, 2016 @04:49AM (#11342930)
Yea I'm sorry but it just gets on my nerves when people post things like "just don't support it!".

I would if I could, everyone would if they could.

Re:Autocomplete from Stack Overflow by dang on Wednesday March 23, 2016 @04:53AM (#11342946)
Believe me, I understand how comments like that get on one's nerves. But civil discourse requires those of us with nerves to tolerate the irritation enough not to toss it back. The system has no steady state: the irritation either grows or we dampen it.