http://www.asual.com/jquery/address/에서 주소 플러그인을 사용하려고하는데 링크 또는 해당 트리거를 클릭 한 객체에 액세스 할 수 있어야합니다. $ .address.change 함수. 그래서 기본적으로
,이처럼 보이는 링크가 있습니다
<a href="#" class="active" rel="address:/show-my-activity">Activity</a>
을 그리고 나는이처럼 보이는 $ .address.change 기능이 : 이미 루프 한
<script language="javascript">
$.address.internalChange(function (e) {
// this is where I need to get the obj of what was clicked to trigger it
// find out what the e.value is, and do the ajax needed
});
</script>
을 "e"의 모든 속성을 통해 표시되지만 클릭 한 객체를 다시 참조하는 것을 찾을 수 없습니다. "e"변수에서 되돌아 오는 것은 다음과 같습니다 ...
undefinedtype value :change
timeStamp value :1317227369056
jQuery1317227368799 value :true
value value :/show-my-activity
path value :/show-my-activity
pathNames value :show-my-activity
parameterNames value :
parameters value :[object Object]
queryString value :
result value :undefined
target value :[object Object]
currentTarget value :[object Object]
handler value :function (e) {
var str;
var obj = e;
for (prop in obj) {
str += prop + " value :" + obj[prop] + "\n";
}
alert(str);
if (e.value === "/showMyActivity") {
}
}
data value :undefined
handleObj value :[object Object]
preventDefault value :function() {
this.isDefaultPrevented = Z;
var a = this.originalEvent;
if (a) {
a.preventDefault && a.preventDefault();
a.returnValue = false;
}
}
stopPropagation value :function() {
this.isPropagationStopped = Z;
var a = this.originalEvent;
if (a) {
a.stopPropagation && a.stopPropagation();
a.cancelBubble = true;
}
}
stopImmediatePropagation value :function() {
this.isImmediatePropagationStopped = Z;
this.stopPropagation();
}
isDefaultPrevented value :function Y() {
return false;
}
isPropagationStopped value :function Y() {
return false;
}
isImmediatePropagationStopped value :function Y() {
return false;
}
어떤 도움을 주시면 감사하겠습니다.
그래도 구현 방법은 올바르지 않습니다. 값으로 주소를 전달해야하므로 플러그인은 어떤 URL로 가야하는지 알고 있습니다. 이 경우 "/ show-my-activity"를 전달합니다. 전체 객체를 전달한 경우 URL의 가치는 무엇입니까? – vipergtsrz
예, 방금 확인한 결과로이 플러그인의 기능이 완전히 중단되었습니다. URL에 값이 전달 될 것으로 예상됩니다. – vipergtsrz
그냥 명확히하기 위해 클릭 한 링크의 jQuery 객체를 참조 할 수 있어야합니까? – Jack