So my script right now is:
$(document).ready(function() {
$("#submit").bind('click', function() {
var username = $("#username").val();
$.ajax({
type: "GET",
url: 'http://www.roblox.com/UserCheck/DoesUsernameExist?username=' + username,
data: {
q: username
},
async: true,
dataType: 'jsonp', //you may use jsonp for cross origin request
crossDomain: true,
success: function(data, status, xhr) {
alert(xhr.getResponseHeader('Location'));
}
});
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id="username" type="text" name="" value="" placeholder="Enter your idiom here">
<br>
<button id="submit" type="">Submit</button>
How do I make it so I can make this script work with the +username? I need help on fixing this, this isn't my original code but I am just tinkering with it. I am new to stuff like JS, JSON, etc.