javascript - Using jquery from local file work only if work connection to internet -


i have local library jquery

<script src="/js/jquery.js" type="text/javascript"></script> 

i have ajax request

.post('/default/ajaxasinc/addnew',{'new':$("#name").val()},function(data){ for(var i;i< data.length.i++) {  } },'json'); 

but work if connection internet active if connection down

i see next exception

data null [break on error] for(var i=0;i<data.length;i++)  

any idea solve problem ?

ps browser firefox not fetch data site data responce local

from looking @ code, place data referenced in callback function "the response of $.post().

i check data valid , contains data before trying for() loop through it.

$.post('/default/ajaxasinc/addnew', {'new':$("#name").val()}, function(data) {     if(data !== undefined && data.length > 0) {         for(var i=0;i< data.length.i++) {          }     }  },'json'); 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -