Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function startswith(haystack, needle) {
- return( haystack.substr(0, needle.length) == needle );
- }
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.overrideMimeType('application/xml');
- xmlhttp.open("GET", "/discussion/questions/", false);
- xmlhttp.send();
- var xmldoc = xmlhttp.responseXML;
- var cr = xmldoc.getElementById('ContentRight');
- for each(var a in cr.getElementsByTagName('a')) {
- var lnk = a.getAttribute('href');
- if(!startswith(lnk, '/discussion/users/')) continue;
- console.log(a); break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement