![]() |
CI returns invisible symbol string to jquery ajax - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: CI returns invisible symbol string to jquery ajax (/showthread.php?tid=37322) |
CI returns invisible symbol string to jquery ajax - El Forum - 01-05-2011 [eluser]Edgars[/eluser] Don't know if It's Jquery or CI, but I have a situation. I have simple controller with function Code: function eds (){ Code: function eds (){ I checked length in CI before sending it to AJAX and it was correct. CI returns invisible symbol string to jquery ajax - El Forum - 01-05-2011 [eluser]Nick_MyShuitings[/eluser] Have you tested in Firebug to see the response to the AJAX? That might be a good indicator. I was unable to reproduce in a test just now. CI returns invisible symbol string to jquery ajax - El Forum - 01-06-2011 [eluser]Edgars[/eluser] When I remove Code: $this->lang->load("language", "ENG"); With Code: $this->lang->load("language", "ENG"); Can't understand what is has to do with language? Maybe It's just coincidence. CI returns invisible symbol string to jquery ajax - El Forum - 01-06-2011 [eluser]Nick_MyShuitings[/eluser] Give this a try: Try returning the information json_encoded. Not only does it allow your javascript to be a bit more flexible should you change things in the future, but it might take care of this issue. It'll get you in the better habit or returning a data set instead of plain text. For example, in this case you'd return something like this: Code: $response = array('name'=>'edgars'); return json_encode($response); Might take care of that odd whitespace. If not as a last resort, there are whitespace trim() type functions in javascript that should help. CI returns invisible symbol string to jquery ajax - El Forum - 01-07-2011 [eluser]Edgars[/eluser] Neither of that helped. Visually there is no white space when I display it. It's just that length is longer. I think it's not white space like ' ', but it's just '' empty. CI returns invisible symbol string to jquery ajax - El Forum - 01-07-2011 [eluser]Nick_MyShuitings[/eluser] in the new CI2.0 branch there is a function that strips invisible characters. That might also be of use... if not I'm officially intrigued ![]() CI returns invisible symbol string to jquery ajax - El Forum - 01-07-2011 [eluser]cideveloper[/eluser] could this be the problem in your language file? |