AJAX url literal vs variable

  • Hello -

    Sorry if this has already been asked, but I have looked and searched repeatedly and I cannot find a direct answer to this question.

    I was attempting to use a sprite's x and y value in the "URL" parameter for an AJAX object. Let us say that I wish to log a sprites location every 60 seconds. Its position on the next interval is 20 x and 50 y. I have found that if I literally code the values into the URL for the AJAX it works fine. For example, this does the job nicely:

    "HTTP://mywebsite.com/myPHPfile.php?x=20&y=50"

    BUT... when I attempt to do the following nothing happens on my server...

    "HTTP://mywebsite.com/myPHPfile.php?x=Sprite.X&y=Sprite.Y"

    I am kind of new to this... any help would be appreciated.

    Thank you! <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • how about:

    "HTTP://mywebsite.com/myPHPfile.php?x="&Sprite.X&"&y="&Sprite.Y

    should solve your problem :)

  • Thank you... <img src="smileys/smiley9.gif" border="0" align="middle" /> I think I need some sleep. I've been up far toooo long. <img src="smileys/smiley2.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)