Wow. That seems like a whole lot of code for a simple task. It's
difficult to check, since the page you reference is password locked.
But, assuming the link only appears once per page, something like this
should work. (This is completely untested, of course.)
// usual header stuff here
var link = document.evaluate("//a[@href = 'LINK-URL-GOES-HERE']",
document, null, XPathResult.FIRST_ORDERED_NODE_TYPE,
null).singleNodeValue;
if (link) {
link.href = 'http://www.facebook.com/AMVQA';
link.firstChild.data = 'Step 2 CK';
}
If it's possible that the link can appear multiple times, the XPATH will
need to be adjusted, and you'll need to loop through the results. And if
the page is AJAX in nature, that's another ball of wax.
On 8/12/2011 2:43 PM, Harman Hundal wrote:
Please help, My area of expertise is Encryption. But I need a little
help with Javascript. I have learnt the basics of HTML but javascript
is a bit harder for me to understand. However I need help urgently.
I want to alter the target of a link on the webpage
https://oasis2.ecfmg.org/srinfo.asp. The title of the link is Step 2
CS - I want to change the title to Step 2 CK and the target to
http://www.facebook.com/AMVQA.
I have found a userscript that seems to be useful once I've figured
out how to suitably modify it. And this is where I am facing trouble.
I have gone to a lot of forums to read more about it, tried many
different scripts and spent a lot of hours trying to figure this out -
But have failed. I do not have much time left - So Please help.
Please let me know how should I alter this userscript for my purpose.
I need to the same thing i outlined above on many pages, if you guide
me with the first one, I'll be able to modify the script myself
thereon. I'd be grateful if you could modify the script I have pasted
below and return it to me.
I'd be deeply indebted if you could help me on this right now. I have
literally no time to learn it myself or experiment on it (as I'd like
to if I had time on my side).
Here is the Script :
[snipped]
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en.