0

嗨,试图让这个工作。

在 div 中有一个 iframe。我正在加载 iframe:

 <iframe src="abc.com" id="divtoshow" border="0" scrolling="no" allowtransparency="true"></iframe>

输入 id 是否足以告诉 iframe 仅加载该 div 并忽略页面上的其他 div 代码。

下一部分是删除 iframe 加载的表中的列和行。如何删除每个超过 1 个?删除行是否相同?

$('table tr').each(
    function(tr_idx,el){
        $(el).children('td').each(
            function(td_idx,el2){
                //i'm removing first columns..
                if(td_idx == 0){
                    el2.remove();
                }
        });//inner each
});//outer each

谢谢你

4

1 回答 1

0

Dwhizz,

Unless you are loading an iframe from the same domain it is HIGHLY unlikely (read as : impossible) to muck around with the contents of the iframe using any scripting language. This is baked into the browsers and is a security issue.

So the quick answer is "No, you will not be able to do this, stop trying"

If you can get at the domain you are trying to load via AJAX then you might have some luck using jquery's AJAX.load shortcut.

reading: http://developer.chrome.com/extensions/xhr.html and do some google on "cross domain AJAX" or "cross domain iframe"

于 2013-03-08T22:16:43.950 回答