Can I use jQuery and make ajax requests?

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
xchatter
Posts: 25
Joined: 27 Mar 2015 16:27

Can I use jQuery and make ajax requests?

Post by xchatter »

Hi dudes,

I added a line to loadFile in my main.js and so I am writing my bindings(scenes) in a separate js file. Everything is good, i test them with console.log and they do appear at the server log.
My question is, can I use jQuery when making AJAX($.ajax()) request to a php file at my hosting?
I won't use any response or something, I just want to send the data and do stuff with it in my php scripts.
xchatter
Posts: 25
Joined: 27 Mar 2015 16:27

Re: Can I use jQuery and make ajax requests?

Post by xchatter »

I couldn't find a way to load it.
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Can I use jQuery and make ajax requests?

Post by pofs »

No, you cannot use jQuery. It is rather browser-bound, and might fail in plain JS environment.

You can make requests though. Look for http.request() in developer documentation.
xchatter
Posts: 25
Joined: 27 Mar 2015 16:27

Re: Can I use jQuery and make ajax requests?

Post by xchatter »

Thanks for the tip. :)
Works.
Post Reply