jquery - IE 7 crashes when calling javascript function -


i have jqgrid in asp.net mvc 4 view , in view define type used jqgrid. jqgrid within jquery tab (i have jquery tab component).

the jqgrid in tab inserted follows:

  <div id="jqgrid">       @html.partial("../grids/_mygrid")   </div> 

this called ajax call in same view follows:

@using (ajax.beginform("search", "item",    new ajaxoptions    {        httpmethod = "get",        insertionmode = insertionmode.replace,        updatetargetid = "jqgrid",        onsuccess = "showgriditems()"    })) {     // stuff } 

in same view have defined type used jqgrid follows:

<script type="text/javascript">     var paramfromview = {         deleteallcaption: '@resource.captionpagerdeleteall',         cleargridurl: '@url.content("~/item/cleargriddata")',         deleteallconfirmationmessage: '@resources.resource.itemdeletealldataconfirmation',         url: '@url.content("~/item/getdata")',         width: @width,         height: @height,         caption: '@resources.resource.itemindextitle',         itemname: '@resources.resource.itemindexname',         itemaddress: '@resources.resource.itemindexaddress',         itemtype: '@resources.resource.itemindextype',         actions: '@resources.resource.itemindexactions',         pagesize: @pagesize,     };  </script> 

the partial view _mygrid above indicated looks following in same view:

<table id="_itemgrid" cellpadding="0" cellspacing="0"> </table> <div id="_itempager" style="text-align: center;"> </div> 

when ajax call executed (see above ajax code) , result success, below javascript function called onsuccess:

function showgriditems() {     $('#_itemgrid').jqgrid({         caption: paramfromview.caption,         colnames: ['id', paramfromview.itemname, paramfromview.itemaddress, paramfromview.itemtype, paramfromview.actions],         colmodel: (...) } 

this function defined in js file , included in same view below:

@section scripts {     @content.script("/grids/itemgrid.js", url) } 

it working in ie8, ie9 , ie10 in ie7 crashes in showgriditems. error saying paramfromview not defined! not know why because ie8 ie10 working not ie7. what's happening?

updated caused comma after pagesize. have removed , works.

remove last comma (,) script.

<script type="text/javascript"> var paramfromview = {     deleteallcaption: '@resource.captionpagerdeleteall',     cleargridurl: '@url.content("~/item/cleargriddata")',     deleteallconfirmationmessage: '@resources.resource.itemdeletealldataconfirmation',     url: '@url.content("~/item/getdata")',     width: @width,     height: @height,     caption: '@resources.resource.itemindextitle',     itemname: '@resources.resource.itemindexname',     itemaddress: '@resources.resource.itemindexaddress',     itemtype: '@resources.resource.itemindextype',     actions: '@resources.resource.itemindexactions',     pagesize: @pagesize }; 


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -