I am trying to implement some simple javascript in my iOS app. I inject the javascript using the usual method
[webView stringByEvaluatingJavaScriptFromString:jsCode];
However, a script as simple as
$(document).ready(function(){
alert(document.location);
});
seems to work on some websites (for example www.nytimes.com), but not on others such as www.latimes.com. The function above is ridiculously simple and I expect it to work uniformly everywhere. Does anyone know a reason for this behavior?