I have a question about the way I should build my website. What if the user has javascript disabled, then all the client side programming will be disable.
Should I rely on php at first, and then just add the javascript/jquery/ajax just in case.
Also how could I make partial requests, so that one part of the page is posted back while the other part of the page doesnt refresh (for example, navigating through a list of products on the page through a pager , without the whole page refreshing, like a gridview). How to achieve that?
Sorry, if i was confusing
First question
The suggestion I have is to build the site under progressive enhancement.
The key function should be available to user who has javaScript turned off, this means you shouldn’t depend on JS for HTML writing, CSS styling and form submission. Also you should always validate form submissions.
Second question
You could update part of your html with AJAX.
To apply the first principle, You’d better make full post url for every anchor, this will fetch the page from server-side.
When js is enabled, you could write AJAX call and diable the default anchor behavior to archive an AJAX page updates.
For example:
1.Provide
<a href="specific_page.php">on your html to ensure no-js user would access the url on your site.2.When js is enabled, you could select the anchor and use the ajax request instead of the default anchor href.
Further
You should know how to detect javascript disabled and use
<noscript>as a fallback.