Skip to main content

Posts

JSON left out Infinity and NaN; JSON status in ECMAScript?

Any idea why JSON left out NaN and +/- Infinity? It puts Javascript in the strange situation where objects that would otherwise be serializable, are not, if they contain NaN or +/- infinity values. Looks like this has been cast in stone: see RFC4627 and ECMA-262 at the top of p. 197: Finite numbers are stringified as if by String(number). NaN and Infinity regardless of sign are represented as the string null. Source: Tips4all

Programmatically stop Javascript execution in FireFox/FireBug

I am currently debugging complex Javascript/AJAX code written with mootools with FireBug. I am looking for a way to stop the JS execution as if it was a breakpoint programmatically. Ex: instructions ... degugger.breakpoint(); // the execution stops here as if a breakpoint was // manually set other instructions ... any idea? Source: Tips4all

Non-ajax GET/POST using jQuery (plugin?)

This is one of those situations where I feel like I'm missing a crucial keyword to find the answer on Google... I have a bag of parameters and I want to make the browser navigate to a GET URL with the parameters. Being a jQuery user, I know that if I wanted to make an ajax request, I would simply do: $.getJSON(url, params, fn_handle_result); But sometimes I don't want to use ajax. I just want to submit the parameters and get a page back. Now, I know I can loop the parameters and manually construct a GET URL. For POST, I can dynamically create a form, populate it with fields and submit. But I'm sure somebody has written a plugin that does this already. Or maybe I missed something and you can do it with core jQuery. So, does anybody know of such a plugin? EDIT: Basically, what I want is to write: $.goTo(url, params); And optionally $.goTo(url, params, "POST"); Source: Tips4all

Can javascript access a filesystem?

I was pretty sure the answer was NO , and hence google gears, adobe AIR, etc. If I was right, then how does http://tiddlywiki.com work? It is persistent and written in javascript. It is also just a single HTML file that has no external (serverside) dependencies. WTF? Where/how does it store its state? Source: Tips4all

JavaScript Charts API: Flot jQuery Plugin OR Google Visualization?

I am looking for a charts library to be displayed on a website. I will use intensively this library (for area, line and bar charts mainly), so I prefer to secure my choice before starting implementing. The list of website chart libraries that I have initially considered are: Plotkit Emprise JS Charts Sparkline Protochart gRaphael Bluff YUI Charts : However after some researches on this forum and investigations on the web, I have reduced my candidate list to these two libraries: Flot jQuery plugin Google Visualization Which one do you advise me to use and why (if you have worked with one or two of them, please tell me your feedback)? How do they compare one to each other regarding ease of use, performance and features? Thank you EDIT: Based-Flash Chart libraries were not eligible with my constraints Source: Tips4all