다음과 같이 jQuery 코드가 있습니다. 제가jQuery DOM 선택기 문제
document.getElementsByTagName ("A") [0] .getAttribute ("타겟")을 작성하는 경우
$("#"+iframeId).attr("src",url); //works perfect
$("a[target="+iframeId+"]").attr("href", url); //does not return anything. not sure why?
여기 iframeId 그것을, 방화범 관리자에서 "swcontent"
<a target="swcontent" href="xyz.html" class="standardMenu_on">Link</a>
를 얻을 대상 "swcontent"를 찾지 못합니다
이제 JS가 포함되어 있습니다.
jQuery.extend = jQuery.fn.extend = function() {
// copy reference to target object
var target = arguments[0],
a = 1;
// extend jQuery itself if only one argument is passed
if (arguments.length == 1) {
target = this;
a = 0;
}
var prop;
while (prop = arguments[a++])
// Extend the base object
for (var i in prop) target[i] = prop[i];
// Return the modified object
return target;
};
이 어떤 문제가 발생 할 수 그래, 어떻게이 문제를 해결할 경우 다음이 작동합니다
는'iframeId' 확실히'swcontent'가 sorrounding와 경우가 완벽하게 작동? – lonesomeday
예 ... 맞습니다 ..... – testndtv