Archive of UserLand's first discussion group, started October 5, 1998.

JavaScript -based client-side includes

Author:Dave Winer
Posted:12/21/1999; 7:04:17 PM
Topic:JavaScript -based client-side includes
Msg #:13807
Prev/Next:13805 / 13808

Well, I must have been asleep while the rest of the web figured out how to do client-side includes.

The last few days have been really interesting as I dug in on this stuff, and used the JavaScript method of including dynamic text in Other People's Pages. I believe this method will be key in making Edit This Page work on statically rendered Manila sites (when we have those). Before this innovation, we were thinking we'd have to write a hosting application for every dynamic environment out there, ASP, PHP, Cold Fusion, whatever. Now it's clear that we can have a small bit of dynamic code in static pages. What an opening of functionality!

However, there's one minor glitch and I'd like to see if any people here can advise me on how to work around it. I find that the browser doesn't re-fetch the JavaScript code from one page view to another. So if I visit two pages with the same code, you get the same ad all over again. This makes our numbers look smaller than they really are.

To bring the point home, here are two invocations of the same JavaScript. Ideally there should be something I return to the browser, probably in the HTTP header, that tells it not to cache the result. If it works, we should see two different ads below:

So, does anyone know the trick??


Postscript: The problem is only with MSIE. Netscape works as it should, you see two ads in Netscape, not one.


There are responses to this message:


This page was archived on 6/13/2001; 4:53:49 PM.

© Copyright 1998-2001 UserLand Software, Inc.