나는 index.html을 또 다른 DIV (#result)에로드 할 외부 파일 (test.html를)에서 콘텐츠 (#content)이 있습니다JQuery와 간단한 아약스로드
인 test.html를 :
<div id="content">This text should not be loaded with its DIV. <strong> May contain other tags</strong></div>
JQuery와 :
$('#result').load('test.html #content');
index.html을 결과, 예상치 못한 :
<div id="result"><div id="content">This text should not be loaded with its DIV. <strong> May contain other tags</strong></div></div>
index.html을 결과는 예상 :
<div id="result">This text should not be loaded with its DIV. <strong> May contain other tags</strong></div>
당신 만의 래퍼하지 않고, 다른 태그를 포함 할 수 #content의 실제 내용/HTML을로드하려면 어떻게 DIV (#content)? 이유는 실수로 다른 스타일의 DIV와 충돌 할 수있는 불필요한 부분을 단순히 피하는 것입니다.
힌트는 대단히 감사하겠습니다. 감사합니다
이 따라 업데이트 JNE에 의해 P의 xD을 당신은'.load와 그렇게 할 수 없습니다 – Shyju
감사합니다 ("폐쇄 누락) 깨진 것 같다 – swan
()' – zerkms