Typical.
Internet Explorer just keeps biting us web developers in the ass and we have no choice but to find work arounds.
After toying around with SignalR on my MVC3 application, I tested things out in IE 8. Surprise surpise. It didn't work.
When you run your application in Internet Explorer you'll see this dreaded icon on the bottom left.

Click it, and you'll be taken to the error window, showing you what went wrong. Go ahead and tick the little checkbox so that window fires up immediately after any javascript errors. We're trying to find the exact culprit.

Hit refresh and this window will pop up. You can now see what's causing things to go south. It's the signalR.min.js file, line 1, position 161.

Let's open up that file and see what's on that line:
The SignalR team bless their heart, great documentation. Simple enough, we need the json2.js library.
Using NuGet search for the json2.js file and install it.

Now let's head over to the area where I'm referencing the signalr.js file, and call json2.js before it, like so:
And you're done. Hit the refresh button on IE and you're asynchronous voodoo will work without a hitch. Thoughts, suggestions for improvement? Leave me a comment.
Internet Explorer just keeps biting us web developers in the ass and we have no choice but to find work arounds.
After toying around with SignalR on my MVC3 application, I tested things out in IE 8. Surprise surpise. It didn't work.
When you run your application in Internet Explorer you'll see this dreaded icon on the bottom left.

Click it, and you'll be taken to the error window, showing you what went wrong. Go ahead and tick the little checkbox so that window fires up immediately after any javascript errors. We're trying to find the exact culprit.

Hit refresh and this window will pop up. You can now see what's causing things to go south. It's the signalR.min.js file, line 1, position 161.

Let's open up that file and see what's on that line:
if (!t.JSON)
throw"SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8."
The SignalR team bless their heart, great documentation. Simple enough, we need the json2.js library.
Using NuGet search for the json2.js file and install it.

Now let's head over to the area where I'm referencing the signalr.js file, and call json2.js before it, like so:
<!-- Used for SignalR --> <script src="../../Scripts/json2.min.js" type="text/javascript"></script> <script src="../../Scripts/jquery.signalR.min.js" type="text/javascript"></script>
And you're done. Hit the refresh button on IE and you're asynchronous voodoo will work without a hitch. Thoughts, suggestions for improvement? Leave me a comment.
2 Comments On This Entry
Page 1 of 1
Page 1 of 1
Trackbacks for this entry [ Trackback URL ]
4 user(s) viewing
4 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)
About Me

Bienvenidos! I'm a USA ex-pat living in Bolivia for the past 10 years. Web development is my forte with a heavy lean for usability and optimization. I'm fluent in both English and Spanish. I guest write for the popular Python website Python Central. Visit my website.
My Blog Links
Recent Entries
-
-
-
-
How to create a signature form for iPad and mobile devices using HTML5 and Canvas.
on Nov 27 2012 08:15 AM
-
Recent Comments
-
laytonsdad
on Apr 30 2013 11:30 AM
Dream.In.Code Badge Generator! Share your flair on your site or blog.
-
-
Jstall
on Nov 04 2012 09:18 AM
The Pragmatic Bookshelf mega blowout sale - 40% off select Ruby on Rails books.
-
-
tylrwb
on Jun 26 2012 07:34 PM
C# and MVC3 - Uploading and parsing an Excel document is easier than it seems.
Categories
|
|



2 Comments








|