자바 스크립트를 사용하여 특정 div를 페이지에서 새 페이지로 복사하고 있습니다. 새 페이지의 각 테이블에 대한 ID 속성을 제거해야합니다.jQuery 선택기 포커스로 변수
첫 페이지의 내용을 복사하고 있기 때문에 두 번째 페이지에 쓰여지기 전에 문자열에서 ID를 필터링 할 수 있습니다. jQuery가 '포커스'로 변수를 사용할 수 있습니까? DOM 전체를 조작하는 대신 특정 문자열을 조작 하시겠습니까?
당신은$(html)
를 호출하여 jQuery를 객체를 생성을 조작해야
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, ** no ** ._ http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 – SLaks
누가 이것을 위해 REGEX를 사용해야합니다. 그냥 "ID ="를 "XX ="같은 의미없는 속성 태그로 바꾸십시오. –