I am using jQuery to parse the JSON result from Twitter.
Then I do a check against the returned results to see if they contain a double quote.
$.getJSON(url + query, function(json) {
$.each(json.results, function(i, tweet) {
var result = tweet.text.indexOf('"');
if(result != -1) {
$("#results").append('<p>' + tweet.text + '</p>');
}
});
});
The result is always -1. Even if the returned tweet contains a double quote.
I also tried using:, indexOf("\"");and that didn't work either.
Any idea what I can do wrong? Perhaps this is an encoding problem?
source
share