Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 10-10-07
andy_jacko's Avatar
curiouser and curiouser
 
Join Date: Sep 2003
Location: uk
Posts: 654
Thanks: 0
Thanked 0 Times in 0 Posts
andy_jacko is an unknown quantity at this point
  partial reload of a page

I have a simple postcode lookup form

someone types the first characters of a postcode, click go and the page refreshes with a list of postcodes and postage rates.

what i would like to do is have the results load without refreshing the whole page. I'm guessing AJAX but aside from spelling it, i have no clue.

any ideas?

cheers andy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-10-07
Registered User
 
Join Date: Aug 2006
Location: Hadleigh, Suffolk, UK
Posts: 953
Thanks: 0
Thanked 0 Times in 0 Posts
axod is an unknown quantity at this point
  Re: partial reload of a page

Yup, ajax is the answer...

Postcode lookups are usually in the first examples section of any good ajax book.

Basic theory is:

register an onKeyPress event handler on the input to call a function - say keypressed

function keypressed() {
if (ourtimer) window.clearTimeout(ourtimer);
ourtimer = window.setTimeout(sendreq, 1000);
}

That bit means if they haven't typed anything for a second, send the request (Better than sending a request after every single keypress).

function sendreq() {
// Create XmlHttpRequest object, and do the request. Send the partial postcode as a param
// Set the callback for it to reqcallback - this'll get called when we get data back
}

function reqcallback() {
// Here you've got the data from the server. Now use some DOM goodness to show the user
}

Obviously then you need some server side PHP for example to handle the request, and return things.
I'd shell out for a good ajax book, or of course pay someone to do it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-10-07
Registered User
 
Join Date: Jun 2006
Posts: 178
Thanks: 0
Thanked 1 Time in 1 Post
jonsp is an unknown quantity at this point
  Re: partial reload of a page

Quote:
Originally Posted by andy_jacko View Post
I have a simple postcode lookup form

someone types the first characters of a postcode, click go and the page refreshes with a list of postcodes and postage rates.

what i would like to do is have the results load without refreshing the whole page. I'm guessing AJAX but aside from spelling it, i have no clue.

any ideas?

cheers andy
Ajax would be the answer. There's some good code here
Dynamic HTML and XML: The XMLHttpRequest Object

Even though it's Apples's site it works perfectly well on windows too. The principle would be
1/ add a textbox for postcode and a submit button
2/ wire up the submit button to the code above
3/ use some server side code to look up the postcode and return the results
4/ put some sort of "loading......" please wait message while 3/ is happening
5/ when the data's returned display it on the page

Cheers,
Jon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Webgains Merchants List Ryan Gilbert Webgains 22 05-02-08 03:38 PM
Ten Terrific Tips for On Page Optimisation Banner-Traffic Search Engine Strategies 1 29-03-07 09:42 PM
Affiliate Commerce System And Method marketraise int The Affiliate Marketing Lounge 11 07-03-07 02:50 PM
Google respond: Landing page answers part 1 3wdl The Affiliate Marketing Lounge 18 18-11-06 02:03 PM
Seach Engine Optimisation FAQ [Jan2006] thetafferboy Organic Google Search Optimisation 2 09-01-06 05:11 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7