Jacques Jocelyn wrote:
Thanks Scott for your insight, It worked fine.

Great.

I have to agree with your  opinion on JS not working, but here I don't
think I will have a choice, the entire apps is built on Ajax...

Up to you, of course, but I always try to provide the necessary functionality to Javascript-less users, usually with some unobtrusive JS techniques.


on last thing, how do you usually build your apps with Jquery :
- one common JS library with all your custom Jquery scripts ?
- or the relevant Jquery script related to the current page is
included in the current page ?

I've never really settled this one in my own mind. I try not to put any actual JS on a production page, but sometimes I include a link to a single JS file with all the custom script for the current page after including all the libraries and plugins required. Other times, I break it into smaller functions and include them on each page that needs them.

My favorite solution is one I've done several times, but only for specific customers and never in a generic fashion: I keep track of dependencies between various scripts either in a database or in formatted comments at the top of each file. Then I include them with something like:

    <scrtipt src="js/depends.php?cluetip&interface&thickbox" .../>

where the results of the server-side call combines all the direct requirements, all their dependencies, all the dependencies of those, and so on, and then caches the response.

This is a nice technique that reduces the number of HTTP requests per page, but it reduces the likelihood of having scripts that are cached across pages. I'm about to try this with JQuery for the first time, and I think I might do some selector magic that will allow the scripts to run appropriately on many pages so that there will be only one JS include which will be used on each page of the production site. It will likely be fairly large, but I think it will be a good way to go.

Good luck,

  -- Scott

Reply via email to