Skip to content
Advertisement

JS search in object values

I have an array of homogeneous objects like so; I’d like to search these objects’ values (not keys) with a keyword, and return an array of objects that contain the keyword in any of the values. So for example, with a keyword r, I would get all the objects (“baR” in object #1, “loRem” in object #2 and “doloR” in

Javascript sort not working in Firefox

I have the following code which is sorting a list of javascript objects in an array based on their date. The data is coming from an XML file. The date is formatted as follows: MM-DD-YYYY So at this stage I have a load of concert objects in my concerts array. I then go to sort it and output it to

Insert content at top of page without scrolling

Is there a way that I can insert content at the beginning of a webpage without causing the page to give the impression of scrolling up. I’m trying to implement something kind of like infinite scrolling but I need to be able to scroll up infinitely as well as down (I’m also unloading content on the other end so that

trouble with recursion; parsing JSON

I have a json object like this: …and I’m trying to iterate through it and get a total count on the “text” objects. I can’t seem to be able to get something recursive working.. I think I’m missing a base-level understanding of both json and recursion.. After a couple of days of variations on this: I’ve come to the conclusion

Toggle display:none style with JavaScript

I want to change the style (second line below) to remove the display: none; part when the user clicks on the “Show All Tags” link. If the user clicks the “Show All Tags” link again, I need the display: none; text added back in to the “style…” statement. I’ve searched here and Google for an example I can apply to

Cross origin requests are only supported for HTTP but it’s not cross-domain

I’m using this code to make an AJAX request: But from the Google Chrome JavaScript console I keep receiving this error: XMLHttpRequest cannot load file:///C:/xampp/htdocs/webname/resources/templates/signup.php. Cross origin requests are only supported for HTTP. The problem is that the signup.php file is hosted on my local web server that’s where all the website is run from so it’s not cross-domain. How

Which events are the most intensive?

Which events are the most resource intensive to have attached? Is a mouseover “worst” than a click? Are there any events that are known to be really harsh on the browser? I have my sights on IE7 mainly, as we are seeing performance issues there. We use event delegation where we can. Or, how can I profile events which are

Stop Chrome Caching My JS Files

I will make a change to my JS files but it won’t really change in the browser, I have to rename the files every time so that it reloads it. Is there some sort of .htaccess command I can add or something to make it stop caching? It is even caching my html pages hard core. I need to reopen

Catch scrolling event on overflow:hidden element

Any insights on how to catch a scrolling event on a element that has overflow:hidden? I would like to scroll in a column without showing a scrollbar to the user. Answer This is actually a somewhat indepth process. What I do is set global flags when users mouse enters and leaves the element that you want to scroll. Then, on

Advertisement