homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Developing Javascript webpage with non-javascript alternative

Msg#: 4418023 posted 12:33 pm on Feb 15, 2012 (gmt 0)

I've redeveloped a webpage where previously all the page layout and search results were generated in PHP on the server and then displayed on the page when they were complete. This was slow.

To improve performance and responsiveness the new version loads the header/footer only for the page and then creates the remaining layout with javascript before populating the results dynamically using AJAX requests.

The downside of this is that obviously the page doesn't load properly without javascript support. What I'm trying to do is find a way of falling back on the old PHP code for layout & results if javascript is not enabled.

I've tried adding the old code into my new page and in a non-javascript browser it is fine. However in a javscript browser it loads everything twice - using the new javscript layout & results code and the old php code.

Because the PHP code is executed before the javscript code I can't see anyway to avoid this. Am I missing something completely here?

Thanks for any guidance.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved