How could I change window’s location without reloading and # hack?

Facebook is using the history api in HTML5. From this blog post you can see how this works. Basically they are making calls like the one below to change the url without reloading the page. window.history.pushState(“object or string”, “Title”, “/new-url”); Here is the HTML5 working draft spec about it: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#the-location-interface Sadly, IE9 does not support … Read more

Iterate through nested json object array

Since myJSONObject.abc contains a list of products it would make more sense to define the property abc as an array. Like this: var myJSONObject = { “abc”: [ [ {“prod_ver” : “prod 1 ver 1”}, {“prod_ver” : “prod 1 ver 2”}, ], [ {“prod_ver” : “prod 2 ver 1”}, {“prod_ver” : “prod 2 ver 2”}, … Read more

Does jQuery strip some html elements from a string when using .html()?

After a few quick tests it seems do me that this behavior isn’t caused by jQuery but instead by the browser. As you can easily verify yourself (DEMO http://jsbin.com/ocupa3) var data = “<html><head><title>Untitled Document</title></head><body><p>test</p></body></html>”; data = $(‘<div/>’).html(data); alert(data.html()); yields different results in different browsers Opera 10.10 <HEAD><TITLE>Untitled Document</TITLE></HEAD><P>test</P> FF 3.6 <title>Untitled Document</title><p>test</p> IE6 <P>test</P> so … Read more