asp.net mvc - What would unhook my View and Controller from each other in Chrome and IE but not in Firefox? -
i have tested mvc functionality in app in chrome have recenlty tested in ie (10) , firefox.
when mash submit button on page sends model values controller running query , generating report, works in firefox (each of 3 browser indeed have own peculiar characteristics -- shine or "dull" in relation cohorts (gleaming in purple , gold) -- chrome , firefox seem have lost connection between submit button's click handler , corresponding controller's method.
the app seems hang after mashing submit button in chrome , ie; breakpoints have -- first of @ beginning of corresponding [httppost] actionresult in controller class -- not reached. in fact, app seems freeze after mashing button -- right-clicking submit button after not give me "inspect element" in context menu.
[httppost] public actionresult receiptcriteria(salesreceiptcriteriamodel model) { if (modelstate.isvalid) // <-- there breakpoint here; firefox reaches { . . .
in firefox, runs, , breakpoints hit.
what possibly cause chrome , ie fail in way, wheras firefox soldiers on?
update
in response moby's request, here jquery view in question:
the html in view pretty generic; jquery is:
$("#submit_button").click(function() { // http://stackoverflow.com/questions/18192288/how-can-i-compare-date-time-values-using-the-jqueryui-datepicker-and-html5-time var begd = $.datepicker.parsedate('mm/dd/yy', $('#begindate').val()); var endd = $.datepicker.parsedate('mm/dd/yy', $('#enddate').val()); if (begd > endd) { alert('begin date must before end date'); $('#begindate').focus(); return false; } else if (begd.tostring() == endd.tostring()) { var dtestring = begd.getfullyear() + "/" + (begd.getmonth() + 1) + "/" + begd.getdate(); var begt = new date(dtestring + " " + $('#begintime').val()); var endt = new date(dtestring + " " + $('#endtime').val()); if (begt > endt) { alert('begin date must before end date'); $('#begintime').focus(); return false; } } $("#numberofresults").css("visibility", "visible"); $("#numberofresults").html("please wait..."); enablebutton("submit_button", false); // if selected, don't enumerate them; set @ "all" (change of case, 'all' 'all', shows logic did execute) var deptslist = $('#depts').checkedboxes(); if (deptslist.length < deptsarray.length) { $('#deptheader span').html(deptslist.join(", ")); } else if (deptslist.length == deptsarray.length) { $('#deptheader span').html("all"); } // " " var siteslist = $('#sites').checkedboxes(); $('#sitesheader span').html(siteslist.join(", ")); if (siteslist.length < sitesarray.length) { $('#sitesheader span').html(siteslist.join(", ")); } else if (siteslist.length == sitesarray.length) { $('#sitesheader span').html("all"); } $('#hiddendepts').val(deptslist); $('#hiddensites').val(siteslist); var upcs = $('#upc').val(); if (upcs == "all") { $('#upc').val("1"); // take (1 , greater) } var resultstext = jquery.trim($("#spannumberofresults").text()); if (resultstext != "") { $("#numberofresults").css("visibility", "visible"); if (resultstext == "0") { $("#numberofresults").css("color", "red"); } else { var href = '/@configurationmanager.appsettings["thisapp"]/tldcriteria/loadreport'; var report_parms = { guid: "@model.guid", serialnumber: "@model.serialnumber", reportname: "@model.reportname" }; window.open(href, "report_window", "resizable=1, width=850, left=" + (screen.width / 2 - 425)); } } }); // end of submit button click function enablebutton(id, enable) { if (enable) { $("#" + id).removeattr("disabled") .removeclass("bottombuttondisabled") .removeclass("bottombuttonenabled") .addclass("bottombuttonenabled"); } else { $("#" + id).attr("disabled", "true") .removeclass("bottombuttondisabled") .removeclass("bottombuttonenabled") .addclass("bottombuttondisabled"); } }
update 2
something else may or may not shed light on problem .js , .css references:
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" type="text/javascript" defer > </script> <script src="@url.content("~/scripts/jquery.validate.min.js")" type="text/javascript" defer> </script> <script src="@url.content("~/scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript" defer> </script> <script src="@url.content("~/scripts/jquery-migrate-1.2.0.min.js")" type="text/javascript"> </script> <script src="@url.content("~/scripts/anytime.compressed.js")" type="text/javascript"> </script> <script src="@url.content("~/scripts/dynamiccheckboxes.js")" type="text/javascript" > </script>
. . .
<link href="http://code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" /> <link href="@url.content("~/content/dynamiccheckboxes.css")" rel="stylesheet" type="text/css" /> <link href="@url.content("~/content/anytime.compressed.css")" rel="stylesheet" type="text/css" /> <!--[if lt ie 9]> <script src="/scripts/html5shiv.js"> </script> <![endif]-->
update 3
the network tab in chrome developer tools looks middle of wyoming (a whole lot of nothing), msg bottom informing me "no requests captured. reload page see detailed information on network activity."
when dutifully mashed f5, showed .js , .css files accessed, , (at top), page i'm gawking at. mashing "view report" causes no more activity in tab, though. see console.log() msg placed @ end of submit button click handler, though, wit: "made end of submit button click"
there is 1 err msg in console, too, this:
failed load resource: server responded status of 400 (bad request) http://localhost/%3c%=%20system.configuration.configurationmanager.appsettings[%22thisapp%22]%20%%3e/content/images/sscssprite.png
would fail load resource, not wreak other mayhem, right?
update 4
based on simon halsey's hint, found that, on stepping though jquery in chrome, fails test:
if (resultstext != "") {
...obviously it's not in firefox, , assume fails in ie (i'll czech sure in both cases, , update this).
later: it's "" in firefox, too...and first time through, failed-wouldn't continue on. second time through, got through, though...???
there 2 options:
- there no request due javascript error
- your request signature doesnt math controller method
a. browsers have different behaivior javascript functions. thats 1 of reasons why jquery popular.
the efficient way find debug javascript line line in each browser.
likely reason.
b. javascript quite exotic me. guess catching sumbit button click , modifying inputs values on fly.
i recommend use $.post or $.ajax , preventdefault instead. make javascript more clear , simple.
c. analyze requests sent browser recommend use fiddler. http://fiddler2.com/
Comments
Post a Comment