我正在尝试使用来自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;
}
任何帮助将不胜感激。