Jump to content

Ajax inside phaser not working


bjarked
 Share

Recommended Posts

Hello 

I'm just trying to get a simple ajax function to work inside phaser just to play around with it. But I can't seem to get it to work. 

The function is just supposed to send two variables to PHP and get back a sentence where those two variables are part of it. But I only get the basic sentence back. And I have tried to use the function outside phaser with just an onclick bottom function, and their it works fine. So it must have something to do with phaser. 

heres the code in phaser 

image.png.89f86eeada50171e899e7c019505c8e6.png

 

And here is the php 

image.png.08fc19607356299a777709074c717edd.png

I have a sprite where i use the 

events.onInputDown.add

function. But i only get 

 

image.png.4d2718385fda143143e72cafd3664942.png

 

While when i just use a botton in html and plane javascript i get 

image.png.b349da6e5031887d63bfb1af68bc66c1.png

 

 

image.png

image.png

Link to comment
Share on other sites

Just remove this topic, the problem was with visual code. for some reason, it had not saved some changes in the PHP file even though it claims that the file was saved.  

Might have something to do with have to files with the same name, located to different places, messing up the save function i don't know. But everything works fine now, and it had nothing to do with phaser 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...