當我打算提交使用AJAX數據時IE顯示錯誤,如object doesn't support this property or method
IE顯示錯誤 - 對象不支持此屬性或方法
$("#savebasicInfo").live("click",function()
{
var lookingfor='';
var interestedIn='';
$(".lookingfor").each(function(i)
{
if(this.checked == true)
{
lookingfor= lookingfor+","+$(this).val().trim(); // error found here
}
i++;
});
$(".interestedIn").each(function(j)
{
if(this.checked == true)
{
interestedIn= interestedIn+","+$(this).val().trim(); // error found here
}
j++;
});
$.ajax(
{
type: "POST",
url: $("#cfgRoot").val()+'/accounts/basicInfoPost.php',
data:
{
city:$("#city").val().trim(),
hometown:$("#hometown").val().trim(),
interestedIn:interestedIn,
relationship:$("#relationship").val().trim(),
lookingfor:lookingfor,
political:$("#political").val().trim(),
religious:$("#religious").val().trim()
},
success: function(responce)
{
if(responce == 1)
{
$("#basicProfileMain").load("basicInfoMain.php");
$("#basicProfileMain").css({"height":"auto"});
}
}
});
});
IE不支持修剪看到這個問題http://stackoverflow.com/questions/2308134/trim-in-javascript-not-working-in-ie – 2013-02-12 06:56:04