I am trying to get IE8 (and other IEs) to work with a page that uses the JQuery/AJAX $.get() method to display a value from an external php file. Firefox, Chrome and Safari all work fine. I've boiled my big problem down to this small example
Here's the javascript code:
function get_number () {
$.get(
"test5.php",
{},
function (response) {
var number = (response.number);
$("#number_display").html(number);
},
"json"
)
}
$(document).ready(function(){
$('#get').click(function(){
get_number ();
});
})
and it inserts into the following html element:
<body style='text-align:center;'>
<p>Number = <span id='number_display'></span></p>
<button id='get'>Get Number</button>
Here is the external php code:
$num = rand (1,10);
$result = array();
$result['number'] = $num;
echo json_encode($result);
My jquery library sourse is http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js, if that matters.
Thanks so much in advance for your help!