Reputation: 21
i am using ajax to populate a drop down but the call is not going to the server. getting the following error in fire bug
POST 0
status 404 not found
my code is:
function selectChildCategory(parent,child){
var url = "<?php echo url::site('admin/video/showSubCategory/')?>";
if(parent != "")
{
if(child != 0){
url = url+parent+"/"+child;
}else{
url = url+parent+"/"+0;
}
$.ajax({
url: url,
type:"POST",
success: function(select)
{
//alert(select);
$("#sub_category").html(select);
}
});
}
}
the parammeters are showing correct values....but call is not going to the server. The URL is correct
please advise.
Upvotes: 0
Views: 215
Reputation: 2876
404 Error code means that the page your are trying to call does not exists.
You are buildng a HTTP path using your parent and child variables but if the formed url does not exists (or is not captured by any mod_rewrite) a 404 error is shown.
For example, for parent "0" and child "0" the url /admin/video/showSubCategory/0/0 exists?
Also if you are using something like mod_rewrite is really correctly configured?
Try first calling the URL manually to check if the url generated by javascript really exists.
Upvotes: 1