jQuery ajax error do nothing -


this basic question, , shouldn't hard it's turned out be.

i have cms i've developed. using ajax change form parameters. when user selects option has no "special params" want nothing display. right now, have ajax searching file. if file exists, should display in div. if doesn't exist, want nothing displayed. of now, when file doesn't exists div loaded entire page 404 error. don't want display errors, want nothing when file doesn't exist.

this have:

$.ajax({  url: '../components/com_'+params+'/menu.php', success: function(result){      $('#menuparams').html(result); }, error: function(){     $('#menuparams').html(''); } }); 

sounds path routed cms failing send http response header. either forgot send 404 in response header in cms or sent text page before tried send header.

if case, either fix cms. or check success results 404 error.

update

in cms when not found, before else gets sent have do:

<?php header("http/1.0 404 not found"); ?> 

there needs no characters @ including spaces sent web server before call header made. can't further without knowing more internals of cms.

since nothing @ all, got ask. when open urls in browser? post url use open in browser , contents of params.

tell console.log('../components/com_'+params+'/menu.php'); does. if put before $.ajax({


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -