Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint:
Rewriting Your Page, On the Fly
Feb 14, 2003 @ 13:47:12

I know it's not exactly PHP-related (yes, I do post these every once and a while), but this new article from SitePoint has a pretty cool little trick in it. It'll let you rewrite a layer's content with Javascript without having to refresh the page.

In Re-Write a Layer's Content with Javascript (nice, original name), the author gives you a block of Javascript that you can use in Netscape 4.*/6/7 and IE 4/5/6 to rewrite content on the fly inside of a DIV tag. You can even make multiple DIVs on the page and write to and from them quickly and easily. And the best part is that you never have to refresh the page if you don't want to. Since Javascript is all client side, you can just use the .write method of the text area and push just about anything in there you want (even more HTML I believe)...

The DIV tag has been slow to be adopted from what I've seen. I see more people refreshing the page to generate new content every time they need it. Of course, I also hang out more with PHP developers, not just general "web developers"....

tagged:

Link:


Trending Topics: