2011-09-10 2 views
-2

jQuery를 사용할 때 load() 우리는 콘텐츠에로드하려는 외부 페이지에 DIV를 정의 할 수 있습니다.외부 페이지의 jQuery.get() div 데이터 htx

외부 페이지에서 특정 DIV의 html 데이터를 가져 오는 유사한 방법이 있습니까? 이게 뭔가요?

var url = someurl; 
var div = specificdiv 
    $.get(someurl+' '+specificdiv , function(data) { 
     $('#target_div').html(data); 
    }); 
+1

이것은 AJAX를위한 일이다! 교차 도메인 URL에 문제가 있는지 확실하지는 않지만 BTW :이 도움이 될 수 있습니다 - http://stackoverflow.com/questions/2496491/jquery-ajax-success-function-not-rendering-html-with-jquery-ui-elements –

+0

감사. 빨리되었습니다. 잠시 내 질문을 업데이트하십시오. – elbatron

답변

-2
$('#target').load('http://example.com/someurl.html #specificdiv'); 
관련 문제