Jump to content

Building a ajax website


brianlange

Recommended Posts

I'm developing a site that uses a lot of ajax. I'm using php and the zend framework for the backend.

I'm finding myself putting in a lot of javascript files in the layout file since I can't add them selectively because the

head section of the page doesn't reload. Is there a way to address this issue?

 

Thanks,

 

Brian

Link to comment
https://forums.phpfreaks.com/topic/226261-building-a-ajax-website/
Share on other sites

Where possible you should try and pack (and I mean pack, using jsmin or similar) all your js into 1 file anyway. It makes for less http requests.

 

and to compact it even more (and solve your problem), you can dynamically build that .js file with server-side scripting. You'd have your .js files in a dir and  have your script tag point to a single blah.js and mod_rewrite that to point to blah.php and and in blah.php you would file_get_contents the necessary ones and compact it and output the single custom file. 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.