jquery - echo HTML in php -


before asked question went through how echo in php, html tags couldn't come solution. i'm trying echo html in php. using codeigniter framework. when select category want load view using ajax request. using jquery send request , load page inside div. works when use php doesn't give me proper output. wrote following code:

echo '<a href="google.com"><img src="newone.jpg" /></a>';  

it produces output "</a>" double quotation.

this jquery code:

jquery(document).ready(function(){     jquery("#category").change(function(){         jquery.ajax({             type : "post",             url :  "controller_list/get_images",             data : "categoryid="+jquery("#category").val(),             datatype: "html",             success : function(msg)              {                 jquery("div").find("#img_list").html(msg);             }         });     }); }); 

issue fixed after changing datatype: "html" datatype: "json"


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -