Could anyone help me with a function for JavaScript which searches the source code and compares all of the links on the site with the specific link I am looking for.
You can use document.links to get the anchors, then just loop through grabbing the href, like this:
var arr = [], l = document.links; for(var i=0; i
See here.
Then loop through the array to check for your specific link.