Archive for the ‘Ajax’ Category

innerHTML and Ajax – Bad Combination

Monday, January 7th, 2008 |

Ajax is comparatively new to the world of programming and software. So far, only few people have cracked the use of this program without the use of toolkits. Only God knows how many people who can actually code without using toolkits but I’m willing to bet that they don’t really reach that much. Saying that only a rocket scientist could figure out how to properly code Ajax is probably an understatement considering its requirements from a developer.

But if you have figured Ajax out, good for you. On my end, I was able to do a little bit of Ajax project from time to time but I still have troubles figuring things out. It’s still a matter of trial and error for me.

In my journey in figuring out Ajax, I came into contact with one of the peculiar situation that will only happen to Ajax. If you have been to the world of programming language, you may already have encountered innerHTML. This little tool is often used by programmers to easy write objects in a DIV. Although the longer way of using DOM is also good, programmers naturally select the easier way… including me.

(more…)

Popularity: 9% [?]

Why innerHTML can ruin your AJAX applications

Monday, January 7th, 2008 |

The reason I am writing this article is because of some work I have been doing recently. My client wants a persistent AJAX application to work in IE6+. This means the web page will be left running for days/weeks on end without being refreshed or the browser being closed. This means it cannot have ANY memory leaks.

I currently process incoming XML using an XSL document – which works very well. However when done under IE6 the XSL transformation is output as plain text [please let me know if there is a DOM alternative] which means the only way to insert my newly transformed code is to use innerHTML. This seems to leak memory like a biatch! Note that the leak doesn’t occur in FireFox.

So why does innerHTML leak? Well after some digging I found out a few interesting facts – lets look at the who, where, why and how…

(more…)

Popularity: 9% [?]

Cool Effects from Prototype and Scriptaculous

Sunday, January 6th, 2008 |

Script.aculo.us is a cool library for effects. I collect samples from different places in this page. Enjoy it!
Extra Tip: protoculous is a javascript file which contains Prototype and Scriptaculous together compressed.

Cool effects:

  1. Accordion effect
  2. Auto-scrolling page navigation
  3. Carousel (able to use with Rails)
  4. Crossfader
  5. Data Picker
  6. FrogJS Javascript Gallery
  7. Goofy Boxes
  8. Image Transition Manager
  9. Lightbox
  10. Lightwindow: Lightbox prototype.js version
  11. Modalbox: like Mac OS
  12. Password strength meter
  13. Prototype window
  14. Scal: calendar component
  15. Slideshow
  16. Slideshow 2
  17. Scroll with slide component
  18. Scroll 2
  19. Shopping cart
  20. Tooltips
  21. Validation

Popularity: 18% [?]

Error: uncaught exception: Permission denied to call method XMLHttpRequest.open

Tuesday, January 1st, 2008 |

Thanks very much for the following articles as it solve my pain about ajax.

If you want to do cross-domain scripting with XMLHttpRequest, e.g. fetching data from a remote location but you’re on a local page or local XUL application (file:///), you need to tell Mozilla/Firefox about that, otherwise you get the infamous error:

Error: uncaught exception: Permission denied to call method XMLHttpRequest.open

Below is an example that can be run locally (save it to your harddisk and open the page with Mozilla/Firefox). It will fetch some RSS XML data from wunderground.com and alert it.

Always remember: XMLHttpRequest needs UniversalBrowserRead!

If the page with the XMLHttpRequest is on a http:// URI (on a webserver), it is not possible to fetch data from another domain!!! This is a security measure of Mozilla/Firefox.

(more…)

Popularity: 42% [?]

About Office-it.orG

This is a site to share my knowledge, discovery and experience related to my hobby and work. Most articles on this site are related to web design, web development, graphic design, short reviews, tips and tricks. I sometimes write some about Microsoft Office Application too.

Want to subscribe?

RSS Subscribe in a reader Or, subscribe via email:
Enter your email address:  
Find entries :