how to get ajax to retrieve something like: no data even when the requested link does not exist.

0 favourites
  • 1 posts
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • im making a create account thing in my game where people can cloud save their stuff, I already have all of that done but now the problem is that someone can choose the same name as someone else and overwrite the original account, to fix this i added a text box and what happens is that before the sign up process gets completed there is a get request done by going to "myproject.firebase.com/users/"&username. username is the username variable that people entered in in the text box. If the username exists I made it so that a textbox hidden away gets set to ajax.lastdata, and this does work, the text box gets filled with a bunch of json stuff. but then if the username doesn't exist, the ajax doesn't return anything, like not even an empty string, this means that the text box gets filled with the previous json stuff that was from the previous ajax.lastdata which meant that if the link doesn't exist so: myproject.firebase.com/users/(nonexistantname) i wanted to retrieve something like null or something like that but instead there isn't even a return which makes it impossible for the person to sign up if the username doesn't exist. How do i make it return null or return literally anything so that i can use the compare text event. Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)