JavaScriptを使用して、特定のdivをページから新しいページにコピーしています。新しいページの各テーブルのID属性を削除する必要があります。jQueryセレクタフォーカスとしての変数
最初のページからコンテンツをコピーしているので、2番目のページに書き込まれる前にその文字列からIDを除外できます。 jQueryは変数を「フォーカス」として取り入れることができますか? DOM全体を操作する代わりに、特定の文字列を操作しますか?
私は私が話しているかの非作業バージョンを持っている:
var currentContent = window.open('','currentContentWindow');
var htmlToCopy = '<html><head><title></title></head><body>' + window.frames[0].document.getElementById('PageContentPane').innerHTML + '</body></html>';
$("table", htmlToCopy).removeAttr('id');
currentContent.document.open();
currentContent.document.write(htmlToCopy);
currentContent.document.close();
_Please、**いいえ** ._ http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 – SLaks
REGEXを使用する必要があります。 "ID ="と "XX ="のような無意味な属性タグを入れ替えてください。 –