Page 1 of 1

The "xml example" with ajax

PostPosted: Fri Jan 10, 2014 10:56 am
by Monumental
Hi
I'm going to need to pull some text from a xml stored under files. I never used xml and ajax with construct before, so I figured it would be a good idea to start simple. I'm glad i did course I got problems almost immediately.

Here's what i did: I took the Example xml file that comes with construct saved the xml to a file and tried to load it with ajax. I thought this would be straight forward and work on the fly, But no.
I read lots of threads and the manual but I still can't figure this one out. So I now come to you for some clarification, please.

!Working!
Here's the CapxMonumental2014-01-10 14:56:50

Re: The "xml example" with ajax

PostPosted: Fri Jan 10, 2014 12:30 pm
by zenox98
It's because the bookstore.xml is not well formed. You have double quotes everywhere in the file. Just search and replace with single quotes and it works, i.e.

change <book category=""COOKING"">
to <book category="COOKING">

Re: The "xml example" with ajax

PostPosted: Fri Jan 10, 2014 1:04 pm
by Monumental
I made the changes. However it seems to be that ajax won't work in local view. So that's probably it. If anyone can confirm that's the case please do. I will leave the cpax for the time being, but will upload a working one when it's done. Thanks for the response!

Re: The "xml example" with ajax

PostPosted: Fri Jan 10, 2014 1:21 pm
by zenox98
What do mean by local? No html5 export can be ran locally due to browser restrictions, and must always be hosted in either your own web server, or offsite in places such as Dropbox.

Here is the .capx that works for me: https://dl.dropboxusercontent.com/u/34306693/xmlajaxexample.capx

and here is it working from DropBox:

https://dl.dropboxusercontent.com/u/34306693/xmlajax/index.htmlzenox982014-01-10 13:21:28

Re: The "xml example" with ajax

PostPosted: Fri Jan 10, 2014 2:10 pm
by Monumental
I were reading this and started thinking that is was due to some web server magic, not my inability =P

!Capx updated!

Live long and prosper, zenox98!