Web development , php , ajax , symfony, framework, zend
In: web resources
28 Jul 2009An interesting piece by Neil Fraser shows that using JSON-P with generated script nodes can be quite a memory leak. Normally you’d add information returned from an API in JSON-P with a generated script node:
The issue there is that you clog up the head of the document with lots of script nodes, which is why most libraries (like the YUI get() utility) will add an ID to the script element and remove the node after successfully retrieving the JSON data:
The issue with this is that browsers do remove the node but fail to do a clean garbage collection of the JavaScript at the same time. This means to cleanly remove the script and its content, you need to also delete the properties of the script by hand:
Read the whole post here
This blog delivers stylish and dynamic news for designers and web-developers on all subjects of design, ranging from: CSS, Ajax, Javascript, web design, graphics, typography, advertising & much more. Our goal is to help you communicate effectively on the web with an engaging website or functional interface.