How to load XML file with pressing on a button

Just starting out? Need help? Post your questions and find answers here.
User avatar
T4r4ntul4
Posts: 132
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands
Contact:

How to load XML file with pressing on a button

Post by T4r4ntul4 »

Hi all,

I have a problem with loading XML > on the fly <
I have it working that if my app starts it loads an XML (from a php file that echo's to XML), and can get that read just fine.

But i need to get it working too if i press a button, that i can do something like this:
LoadXML(#XML_Something, "http://localhost/somephpfile.php?name=something")
For retrieving some specified data from the database.

I know that i need a callback for LoadXML() :
But how can i do this, when loading() already is used for other preloading XML files?

I cant (and would be bad design) to load the whole database in xml before my app starts.

Is there any solution to loading XML when pressing a button?

Any help or other solution is very much appreciated!
User avatar
Peter
Posts: 1093
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: How to load XML file with pressing on a button

Post by Peter »

you can use

Code: Select all

HTTPRequest(#PB_HTTP_Get, "http://localhost/somephpfile.php?name=something", "", @YourCallback())
In YourCallback() you can parse the result with ParseXML().

Greetings ... Peter
User avatar
T4r4ntul4
Posts: 132
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands
Contact:

Re: How to load XML file with pressing on a button

Post by T4r4ntul4 »

Thanks, never thought of that. Its working flawless!
Post Reply