php - JQuery don't recognized my (well formed) HTML tag. Possible BOM -


jquery print syntax error when try interpret ajax response apache server. file printed in php smarty template engine.

here simple minimal working exemple of "bug" (from chromium javascript terminal)

> $.post('newtasklist',{name: 'hello'},function(ans){console.log($(ans))})  xhr finished loading: "http://localhost/narasimha/newtasklist". jquery-1.9.1.js:8526  uncaught error: syntax error, unrecognized expression: <li><a><input type="hidden" class="listid" value="4" />hello(0)</a></li>  

as see, it's not problem in html tag. thought bom (i work under gedit 3.6.2), i've bomstrip-files every .php , .tpl files of project directory... hasn't changed anything.

in addition, i've add ans.replace(/^\ufeff/, '') answer script, don't work either.

does think solution?

edit: i've tried count number of bytes in answer. tell me "75", 2 bytes more actual string. don't know origin of difference.

> $.post('newtasklist',{name: 'salut'},function(ans){     console.log('ans : ', ans);      console.log('n_ans : ', ans.length);})  ans :     <li><a><input type="hidden" class="listid" value="13" />salut(0)</a></li> n_ans :  75  > '<li><a><input type="hidden" class="listid" value="13" />salut(0)</a></li>'   .length 73 

i never worked smarty, have thoughts, maybe can find problem. looks more smarty/php error me

  • what happens when open post-url in browser? show same issue?
  • i don't know how sensitve smarty is... doctype use... if it's html5 input-tag has no closing / slash
  • maybe want share of php generates html

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 -