/[Frey]/branches/zimbardo/static/xpath.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /branches/zimbardo/static/xpath.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1172 - (hide annotations)
Sun Jul 5 21:40:16 2009 UTC (14 years, 9 months ago) by dpavlin
File MIME type: application/javascript
File size: 673 byte(s)
branch for localisation

1 dpavlin 175 document.onclick = function (e) {
2     if (!e) {
3     e=window.event;
4     }
5     if (e) {
6     e = e.target ? e.target : e.srcElement;
7     }
8     var oStr;
9     for(oStr=''; e && e.nodeName != '#document'; e=e.parentNode) {
10     if (e.nodeName!='#text') {
11     var oCount = 0;
12     for (oCount=0,oOb=e; oOb; oOb=oOb.previousSibling) {
13     if (oOb.nodeName == e.nodeName) {
14     oCount++;
15     }
16     }
17     oStr = e.nodeName + ( (oCount-1) ? ('('+oCount+')') : '') + ( oStr ? ('/'+oStr) : '' );
18     }
19     }
20     // location.href='http://www.someDomainOfYours.com/yourPage.php?url='+escape(location.href)+'&dompath='+oStr;
21     alert(escape(location.href)+'&dompath='+oStr);
22     return false; // don't follow stuff we click onto
23     }

  ViewVC Help
Powered by ViewVC 1.1.26