jquery里append问题

$("#b").append(" <iframe. frameborder='0' border='0' style='width:expression(this.nextSibling.style.width);height:expression(this.nextSibling.style.height);position:absolute;z-index:1;top:0;left:0;'>  </iframe>").append($("a")).css({position:"absolute"}); 


jquery报错,怎么才能使expression正常使用。

  • skyworld - 1年前

    $("#b").append(" <iframe. frameborder='0' border='0' style='width:expression($(this).scrollWidth);height:expression($(this).scrollHeight);position:absolute;z-index:1;top:0;left:0;'>  </iframe>").append($("a")).css({position:"absolute"}); 


    你的问题不在于jquery,而在于expression的用法,一般用scrollHeight和scrollWidth获取高宽度。