Main | May 2006 »

April 20, 2006

Slide Shows with Ajax

Rich Ajax slide shows with DHTML and XML

Posted by lsloan at 11:14 PM | Comments (0)

April 19, 2006

Javascript That Reads Itself

This evening, while experimenting with Javascript DOM calls, it occured to me that if the JS could find the node for the script element, it may be able to read the code within it. Sure enough, the text, innerHTML, and textContent attributes of an inline script element node contains the Javascript code. That could make for some interesting introspection capabilities and possibly even Javascript that rewrites itself.

However, the same does not hold true for script elements that load their code from another source, using a src attribute and URL. There doesn't seem to be any way to access the code of that kind of script element. At first, I thought it must be the browser security in action, similar to that of iframe content loaded from a different domain. But I've found that this doesn't work even if the Javascript is loaded from the same domain as the page.

I was really hoping that Javascript could access the contents of such script elements. If it could, then I could add a script element to load any document, not just Javascript, then access its contents though the DOM.

Oh well, even if it were possible, it probably would be a security hole. I wouldn't be able to make use of it for very long before it got plugged.

Posted by lsloan at 12:06 AM | Comments (1)

April 15, 2006

Alternative to Many JS DOM Calls

As many folks will tell you, manipulating a document's content by modifying its various innerHTML properties can be problematic. A safer way is to use DOM calls. But it can be a pain to write a lot of DOM calls. There's no shortage of libraries to simplify this task, though.

Vivabit DOM Builder looks like a good example.

Posted by lsloan at 06:17 AM | Comments (0)

April 07, 2006

IBM developerWorks: a Good Resource

I don't think IBM is the greatest, but their site, developerWorks : IBM's resource for developers, has a lot of good articles and tutorials. Sign up for the newsletter while you're there.

Posted by lsloan at 03:11 PM | Comments (0)

XSLT 2.0 vs. XQuery

Another useful article from IBM developerWorks:
Working XML: Comparing XSLT 2.0 and XQuery

Posted by lsloan at 03:06 PM

April 05, 2006

Javascript Closures

As part of my learning about Ajax, I ran across an article that explains Javascript Closures. It's not a well-written article as far as English grammar and readability, but it does offer a good amount of technical information. I found the section on execution contexts to be pretty interesting.

Posted by lsloan at 09:36 AM | Comments (0)