I write this code in tampermonkey,

```js
var n = document.getElementsByTagName("a").length;
for (i = 0; i < n; i++) { 
    var urlm = document.getElementsByTagName("a")[i].href;
    //urlm.replace("#", "");
   // var v = "change('"+urlm+"')";
    // document.getElementsByTagName("a")[i].setAttribute("onclick", v);
    document.getElementsByTagName("a")[i].addEventListener('click', function(event){ alert(urlm); ajaxpagefetcher.load("ajax-div",urlm, true); }, false);
    document.getElementsByTagName("a")[i].setAttribute("href", "javascript:alert("+urlm+")");
}
```

when i excute this code i am getting differnt value for **urlm** . Suppose 
*var urlm = document.getElementsByTagName("a")[i].href;* Here urlm**strong text** returns *http://www.example.\com/page/page3.html*....

But, In this line *addEventListener('click', function(event){ alert(urlm); ajaxpagefetcher.load("ajax-div",urlm, true); }, false);* **alert(urlm);** shows only *http://www.example.\com/* but here *page/page3.html* is missing.... But in the next line *javascript:alert("+urlm+")");* it excutes as **javascript:alert("http:/www.example.\com/page/page3).** Please let me know what wrong i am doing.