I guess I'm not up-to-date or am missing something really simple. I have the javascript code below, which uses ajax to connect to an external php file which reads the form post'd variables and pulls pricing from a sql database and returns the price, which is updated on the current page. The machine I am testing on uses Windows 7 and the latest version of Chrome browser. The ajax call ALWAYS works. I was in a different office yesterday and tested the code on a Windows 10 machine running the latest Chrome browser and the ajax call seems to never work and no price is updated. I also tried the latest Internet explorer browser on the same Windows 10 machine and it did NOT work. I found another Windows 7 machine at the same location using Chrome and it worked fine on it. What's even crazier is this morning, I tried the code on a Windows 10 machine running the latest Chrome and the first time the page loaded it worked but then quit again.
I keep checking the code and don't see anything, as it works fine on some machines. Any ideas or thoughts would greatly be appreciated.
I am using jQuery v1.12.4. I thought maybe this might have an issue so I tried using 3.1.1 even and nothing changed.
What am I missing? How would I be able to debug the ajax call to see what is actually happening on the computer that it isn't working?
THE JAVASCRIPT CODE:
<script type='text/javascript'>
// Monitor changes to Quantity form field
$('#Quantity').on('keyup', function(event) {
$.ajax({
url: 'updatePrice.php',
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: $('#OrderDetails').serialize(),
datatype: 'json',
success: function(response) {
$("#showPrice").text('$' + response);
}
});
});
function updatePrice() {
$.ajax({
url: 'updatePrice.php',
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: $('#OrderDetails').serialize(),
datatype: 'json',
success: function(response) {
$("#showPrice").text('$' + response);
}
});
}
</script>
THE SHORTENED HTML CODE RELATED TO THE JAVASCRIPT:
Quantity<br><input type="text" name="Quantity" id="Quantity" class="textWidth2" value="">
<img src="images/B&WSelected.png" id="BWimage" onclick="changeImage3(); updatePrice();">
<div class="border-top-color quote_panel">
<span class="quote_title">Your Price:</span>
<span id="showPrice" class="quote_price">$0.00</span>
</div>