views:

456

answers:

2

Hi..
im new to this Ajax thing . and i wanted to try this
http://labs.adobe.com/technologies/spry/samples/data_region/SuggestSample.html
neat little Autosuggest form. But this does'nt work anymore ..when i save it locally.
this is what i've done so far :

  • Firefox -> save pages as ..(index.html)
  • new folder ( test23 )
  • also saved the products.xml
  • opened index.html
  • change this line : var dsProducts = new Spry.Data.XMLDataSet("../../demos/products/products.xml", "/products/product", { sortOnLoad: "name" })
  • into : var dsProducts = new Spry.Data.XMLDataSet("products.xml", "/products/product", { sortOnLoad: "name" })
  • test failed :(

so .. can someone help me out ?

+1  A: 

Hi,

I just tried for like three minutes and got it to work at the first try (without images). you have to remember to get all the scripts and actually point to them in the main html file.

Don't forget the script tags on lines 41 through 43.

Kris

-- additions:

I tested on my Mac's local filesystem without any server using Safari as my browser. I have since deleted the files but could easily do it again and put the files up for download.

Kris
i dont have to do it .Firefox does it for me ..but it still doesn't work.Are you sure ..? can i have the local copy ?THIS DOES NOT WORK !
n00ki3
Yes you do have to do it, trust me. see http://www.theredhead.nl/autosuggest.zip
Kris
+1  A: 

AJAX requests cannot access the local file system, so requests like that will fail. You will need to have the page up on a webserver. If you want a local one, install XAMPP or something similar.

ceejayoz
This works neither .. i've tried it . double checked my paths ..DOES NOT WORK :/WHAT THE F... I couldn't image that this would be so tricky.. the css works fine :/
n00ki3
He is not actually doing ajax, just xml parsing.
Kris
Kris, it looks like products.xml is getting fetched via AJAX.
ceejayoz