开发者

Username Availability

I am currently implementing a registration form and doing the username availability checking using jquery and php.

In this case where the 开发者_如何学编程user_availability.php is in same folder as the registration from, it is easy to specify like the following to retrieve the function in the page.

$.post("user_availability.php",{ user_name:$(this).val() } ,function(data)

But what if my user_availability.php page is in the model folder? What should the URL be?


There's nothing magical about jQuery here - you need to refer to user_availability.php in the same way that you'd refer to it in a link.

If it's in the root of your domain, refer to it as /user_availability.php.

If it's in a folder above where you are, refer to it as ../user_availability.php.

If it's in a sibling (models) of the folder where you are, refer to it as ../models/user_availability.php.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜