4
jQuerys load을 사용하여 다른 페이지에서 특정 요소를 가져 오는 기능을 만들었습니다. 프로토 타입과 함수의 동일한 종류의 것이 무엇jQuery로드에 해당하는 프로토 타입
$j('#result').load('http://thesite.com .desiredClass')
: 같은
뭔가? Ajax.Request
new Ajax.Request('/your/url', {
onSuccess: function(response) {
var html = response.responseText;
var div = new Element("div");
div.innerHTML = html;
var content = Element.select(div, ".desiredClass");
$("content").appendChild(content);
}
});
두려워은 "낮은 수준"의에서
이
왜 [이 Ajax.Updater (http://api.prototypejs.org/ajax/Ajax/Updater/)? – clockworkgeek
@dockworkgeek 당신이 정확합니다.'Ajax.Updater'가 더 좋을 것입니다. – Raynos
이 중 어느 쪽이 지정된 요청에서 정의 된 클래스를 가져 오는 지 이해할 수 없습니다. @Raynos 또는 clockworkgeek, 이러한 방법을 사용하여 격리 된 요소를 포함하는 구문을 보여 주시겠습니까? – Zac