asp.net mvc - jQuery issue with identical call when triggered from tab and button -


i have mvc page jquery-ui tabs. when user selects relevant tab jquery ajax call executed load select list. works fine. user can reload list clicking button perform same call once again.

when called button ajax call fails!! tried swap order , skip call on tab display, in order make button load first event. still gave same error.

the ajax call isolated in same function being called. how can different when called different events?

this related code:

$("#tabs").tabs({     show: function (event, ui) {         var tabname = $(ui.tab).attr("href");         if (tabname == "#tabresult")             loadresults();     } });   $("#btnloadresults").click(function () {     loadresults(); });   function loadresults() {     var testcaseid = $("#testcase_id").val();     $.getjson("api/testsapi/getresults", { testcaseid: testcaseid })             .done(function (data) {                 $("#lstresults").empty();                 $.each(data, function (index, item) {                     $("#lstresults").append("<option value='" + item.id + "' data-response='" + item.response + "'>" + item.starttime + "</option>");                 });                 $("#txtresult").val("");                 $("#lstresults").prop("selectedindex", 0);             }); } 

the call tab show works. call button click works when executed in debug environment, not when deployed on intranet.

i checked in fiddler both calls identical in request , response.

the resulting querystring looks weird, if whole current form somehow submitted ....

i noticed jquery-ui states tab show event "deprecated" , "activate" used now. tried activate not work. versions jquery-ui-1.8.24.js , jquery-1.10.2.min.js

here comes feedback issue.

it turns out whole problem missing type attribute of button. default behaviour turned out different in different browsers. in internet explorer default type="submit". when running on local machine somehow fine, on remote machine did not work. have specified type="button" , fine again!

i found out jquery-ui tab event has changed name version 1.8 1.9. in 1.8 "show" , in 1.9 , onwards "activate".


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -