duffpaddy
26 Aug 2009, 02:08 PM
Hi there everyone,
I'm designing a website as part of an assignment for a JavaScript course. The brief is to produce a website for a fictitious company that sells products wholesale to other companies. The website should contain some information about the company, some pages that describe the various products, and has a shopping cart and checkout system.
I've decided to implement some basic AJAX techniques into the website so that the user has a a good experience without unnecessary page refreshes. My one limitation is that I am not in control of the application server so I am restricted to use the technologies available on that environment. I'd therefore appreciate some feedback on my proposed design.
The content of the website will be divided into three columns divs:
- The left most column will contain the navigation and will always be displayed. The links in this navigation bar will take you to all the website content pages for the products and information about the company
- The middle column will be much larger as this is where the content is acutally displayed. It will effectively be a large div which I can locate and change the contents off once I have received a response from the server.
- The right column will contain a shopping cart summary and a link to navigate the user to the checkout
By clicking a navigation link, I'll fire an event which calls a javascript function. This function will create and XHR object and make a request to a PHP script on the server. Once the reponse has been received, in this case some HTML (or could I use XML?) which I will then display in the content div.
I realise that this is a very high-level description, but would this be the correct way of employing AJAX techniques to achieve the effect that I desire? I'd be interested to hear your comments.
Thanks.
I'm designing a website as part of an assignment for a JavaScript course. The brief is to produce a website for a fictitious company that sells products wholesale to other companies. The website should contain some information about the company, some pages that describe the various products, and has a shopping cart and checkout system.
I've decided to implement some basic AJAX techniques into the website so that the user has a a good experience without unnecessary page refreshes. My one limitation is that I am not in control of the application server so I am restricted to use the technologies available on that environment. I'd therefore appreciate some feedback on my proposed design.
The content of the website will be divided into three columns divs:
- The left most column will contain the navigation and will always be displayed. The links in this navigation bar will take you to all the website content pages for the products and information about the company
- The middle column will be much larger as this is where the content is acutally displayed. It will effectively be a large div which I can locate and change the contents off once I have received a response from the server.
- The right column will contain a shopping cart summary and a link to navigate the user to the checkout
By clicking a navigation link, I'll fire an event which calls a javascript function. This function will create and XHR object and make a request to a PHP script on the server. Once the reponse has been received, in this case some HTML (or could I use XML?) which I will then display in the content div.
I realise that this is a very high-level description, but would this be the correct way of employing AJAX techniques to achieve the effect that I desire? I'd be interested to hear your comments.
Thanks.