jquery and $.getJSON - mozilla is working great, ie chokes
Posted: Thu May 24, 2007 6:56 pm
I'm trying to use jquery to "get" a url and parse the json it returns. In firefox, it works seamlessly. Internet explorer chokes (what a shock!) Is there a specific header that needs to be returned by the url? Is there anything wrong with my json?
How about my javascript?
I HATE IE
Here's the url to the page:
http://store.tarmadesigns.com/product/a ... -wristband
Try toggling the color. It works so well in firefox. In Internet explorer sometimes the content on the right overlaps the image (WTF??) and the image swap is not working.
Code: Select all
{ 'img':'/mm5/public/images/products/100333.jpg' ,'bup':'/mm5/public/images/products/bup/100333.jpg' } Code: Select all
$(function(){
$("#product-colors .loading span").ajaxStart(function(){
$(this).html('Loading...');
$(this).fadeIn('fast');
});
$("#product-colors .loading span").ajaxComplete(function(){
$(this).fadeOut('slow', function(){
$(this).empty();
});
});
$("#product-colors .loading span").ajaxError(function(){
$(this).html('<span class="error attention">Sorry, an error has occured</span>');
$(this).fadeIn('fast');
});
$('#product-colors input:radio').focus(function(){
var code = $(this).attr('value');
$.getJSON("/widget/image-verify", {'Product_Code':code, bup:'1'}, function(json){
if (json.img != 'false')
{
$('#main_photo img').attr('src', json.img);
}
if (json.bup != 'false')
{
$('#main_photo a.thickbox').attr('href', json.bup);
}
});
});
});
I HATE IEHere's the url to the page:
http://store.tarmadesigns.com/product/a ... -wristband
Try toggling the color. It works so well in firefox. In Internet explorer sometimes the content on the right overlaps the image (WTF??) and the image swap is not working.