Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backbone.js web application is unusable on Internet Explorer

I have developed my web application w/o testing it on IE. Though it worked fine on all the browsers viz. Chrome, Firefox, Safari but when it comes to IE there is a strange behavior.

Sometimes the app loads and some times a blank page is loaded as if none of the "bind" events had any effect.

And the lucky times when the app loads, the nav panel is partially missing. I can't show you the code right now coz I am not sure what part to show and where I am doing it wrong.

If anyone of you can provide me a checklist of what to check and what tools would be ideal for debugging on IE then it would be great.

And if anyone of you can tell me most common backbone.js bugs on IE then that too would help.

PS: Version of IE I am testing with: IE8

like image 549
Shiv Deepak Avatar asked Feb 10 '12 22:02

Shiv Deepak


People also ask

Is Backbone JS still used?

Backbone. Backbone has been around for a long time, but it's still under steady and regular development. It's a good choice if you want a flexible JavaScript framework with a simple model for representing data and getting it into views.

Is Backbone JS frontend or backend?

Backend Synchronization BackboneJS is use with the front-end and back-end systems, allows the synchronization with the backend to provide support to RESTful APIs.

Does backbone need jQuery?

You can use the Backbone. Model without jQuery, but Backbone. View will require either jQuery or Zepto, just like the docs state.

What is backbone JS used for?

BackboneJS allows developing of applications and the frontend in a much easier way by using JavaScript functions. BackboneJS provides various building blocks such as models, views, events, routers and collections for assembling the client side web applications.


1 Answers

Some issues in IE are:

Trailing commas on Objects:

E.g.

 App.model = Backbone.Model.extend({
   url: "/foo/bar",

   validate: function() {
   },
 });

Should be:

 App.model = Backbone.Model.extend({
   url: "/foo/bar",

   validate: function() {
   }
 });

The use of functions that are not available in IE such as lastIndexOf()

A third thing to check for is invalid HTML. IE can be particularly picky about your HTML structure. Be sure that all open tags either have a matching close tag, or are self closing with />

If you are using JSON methods such as JSON.parse() and JSON.stringify() then be sure to include a JSON library such as JSON2.

like image 154
Gazler Avatar answered Oct 13 '22 00:10

Gazler