javascript - Firefox's App object eqivalent in other browsers -



javascript - Firefox's App object eqivalent in other browsers -

i'm not js guy, barely touched when needed need create changes mvc3 app, uses javascript, , when seek run in ie, gets errors on first line of scripts, in code below :

app.listloan = new function;

it works in ff.

what should equivalent, or "browser safe" code this?

edit:

actually, after investigating code more, discovered app object defined.

in _layout.cshtml, have defined:

<script src="@url.content("~/scripts/app/app.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/app/listenvelope.js")" type="text/javascript"></script>

the code in app.js

/* main component */ var app = { init: function () { /* ....*/ }

and in listenvelope.js have cpde shown works in ff not in ie

can tell me problem?

thanks

if(typeof app === 'undefined') { // no app namespace, create 1 var app = {}; }

javascript cross-browser

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -