I’m just writing a client app (win/c#) that will allow the user to tweet a message & photo. I’m using spring.net framework’s functions for oauth handling, and the webbrowser control to show the web pages, and it all works almost great. The almost part is that when the browser navigates to https://api.twitter.com/oauth/authorize?oauth_token=, it throws up a javascript error:
Line: 177
Char: 5
Error: Unable to get value of the property 'contains': object is null or undefined.
Code: 0
Do you want to continue running scripts.
Either yes or no doesn’t matter, I can still sign in and authorize the app, but it’s very annoying. Looking at the html that was sent to the browser, the offending function appears to be:
function($) {
$(‘a’).each(function (i, link) {
if (link.classList.contains('register')) return;
link.target = "_blank";
});
});
And, given that not all of the tags have classes, I’m guessing that is the cause for this. Of course, the real cause may be that the browser engine used by c# is really IE (shudder), but I don’t have much choice in that department.
Has anyone else seen this, and if it is a problem with the page being sent down, is there anything I can do to fix it, short of monkey-patching the html as it arrives?