$.getJSON('<?php echo $this->baseURL()?>/site/ajax/checkusername',
{username: $('#username').val()},
function(data)
{
if (data == "TRUE")
{
$("#available").text("This username is available!");
}
else
{
$("#available").text("This username is not available!");
}
}
);
返回一个请求 url:
http://my.local/site/ajax/checkusername?username=sdfsdf
我希望它以以下形式返回:
http://my.local/site/ajax/checkusername/username/sdfsdf
如何做到这一点?