I have a javascript function is an ASP.NET application that is rendering different results based on whether I build with Chrome or build with IE. Specifically, I've noticed that when I change the code in Visual Studio, the changes to the code are captured in IE, but are not in Chrome.
// js function
$(optA).change(function () {
var flag = $(this).val();
var security_name = $(optType).val();
var extract = security_name.substr(0,security_name.indexOf('-'));
$.ajax({
type:"POST",
url: "relevant_class.asmx/GetTerms",
data: "{ 'security_name': '" + security_name + "', 'flag': '" + flag + "'}", //Line that doesn't change in chrome but does in IE.
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
// sets some other terms
}
failure: function (msg) {
alert(msg);
}
})
});
public List<int> GetTerms(string security_name, string flag)
{
Debug.WriteLine(security_name);
Debug.WriteLine(flag);
}
If I change the AJAX data line
data:"{ 'security_name': '" + security_name + "', 'flagBOGUSENTRY': '" + flag + "'}"
When I go the inspect element --> network tab and look at the request body of the GetTerms call function, in Chrome I see
{'security_name': 'Apple', 'flag' : 'two-week'},
whereas in Internet Explorer I see
{'security_name': 'Apple', 'flagBOGUSENTRY': 'two-week'}
i.e. Internet Explorer has reflected my changes, but not Chrome. Why might this be happening?