1

I'm new to this Ajax thing. I wanted to try this
http://labs.adobe.com/technologies/spry/samples/data_region/SuggestSample.html
neat little Autosuggest form. The form doesn't work when i save it locally.
Below there is a list of what i've done and used 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 :(

Can anyone help me out ?

n00ki3
  • 14,529
  • 18
  • 56
  • 65

2 Answers2

3

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
  • 176,543
  • 40
  • 303
  • 368
1

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
  • 40,604
  • 9
  • 72
  • 101
  • 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 Feb 15 '09 at 00:40