I'm using this javascript to replace all of my links with registration messages:
<script>
function replaceLinks() {
var links = document.querySelectorAll('.restore a:link');
for (var i = 0; i < links.length; i++) {
links[i].innerHTML = 'DOWNLOAD register here.';
links[i].href = 'register.php';
}
}
</script>
The problem:
It's replacing all thumbnail images (that link to their full-size images), too. I can't apply a specific CSS selector to just links because I'm using vBulletin and it would apply it to both links and images inside of the post content.
Does anyone know how I can...
forbid this Javascript from applying to links that end with .jpg, .gif, etc -- so it only rewrites the links, and not the thumbnails that link to their full sized images?
<a id="attachment234234234" rel="Lightbox_5234234" href="http://www.domain.com/attachments/filename123123123.png"> <img class="thumbnail" border="0" pagespeed_url_hash="2832013083" style="float:CONFIG" alt="Blah blah blah" src="http://www.domain.com/attachments/filename123123123.png" title="blah blah blah"></img>