jQuery对象不支持此属性或方法
我有这样一个代码:jQuery对象不支持此属性或方法,jquery,Jquery,我有这样一个代码: $(function() { if ($("div#ProductDetail_ProductDetails_div2 table tbody tr").text().trim() == '') { $("div#ProductDetail_ProductDetails_div2").css("border", "0px"); $("div#ProductDetail_ProductDetails_div").css({'border-bottom-left-
$(function() {
if ($("div#ProductDetail_ProductDetails_div2 table tbody tr").text().trim() == '') {
$("div#ProductDetail_ProductDetails_div2").css("border", "0px");
$("div#ProductDetail_ProductDetails_div").css({'border-bottom-left-radius' : '5px', '-moz-border-bottom-left-radius' : '5px', '-webkit-border-bottom-left-radius' : '5px', 'border-bottom-right-radius' : '5px', '-moz-border-bottom-right-radius' : '5px', '-webkit-border-bottom-right-radius' : '5px'});
}
});
基本上,它说如果
中没有嵌套内容,请运行一些CSS修改
然而,在IE8的调试控制台中,它在这一行上显示if($($($)div#ProductDetail(ProductDetails)ProductDetails(u div2 table tbody tr)).text().trim()=''{
“对象不支持此属性或方法”我不知道这是什么意思
这导致网站上的其他jQuery出现了一些问题。我知道,当我对它进行注释时,该网站工作得很好。有人能告诉我IE抱怨的代码出了什么问题吗?谢谢。jQuery trim函数就是这样的
jQuery.trim( str )
if ($.trim($("div#ProductDetail_ProductDetails_div2 table tbody tr td:first").text())=="")
{
// Rest of the code
您可能需要获取td文本值进行比较
像这样改变它
jQuery.trim( str )
if ($.trim($("div#ProductDetail_ProductDetails_div2 table tbody tr td:first").text())=="")
{
// Rest of the code
jquery trim函数是这样的
jQuery.trim( str )
if ($.trim($("div#ProductDetail_ProductDetails_div2 table tbody tr td:first").text())=="")
{
// Rest of the code
您可能需要获取td文本值进行比较
像这样改变它
jQuery.trim( str )
if ($.trim($("div#ProductDetail_ProductDetails_div2 table tbody tr td:first").text())=="")
{
// Rest of the code
它的意思完全是它所说的。问题是哪个属性或方法不受支持。所以我恰好知道答案,但你真的应该学会自己调试这些琐碎的问题。它的意思完全是它所说的。问题是哪个属性或方法不受支持。所以碰巧我只知道答案,但你真的知道吗你应该学会自己调试这些琐碎的问题。他是对的。我没有仔细看他的代码。给Shyju打电话很好。+1这里没有
,这就是为什么.trim()
首先在那里他是对的。我没有仔细看他的代码。给Shyju打电话很好。+1这里没有
,这就是为什么.trim()
首先有没有