Hide Anchor Tags which call a specific Javascript Function?

T

Test Test

Hello all,

Need help. How do I create a javascript to check the whole page, and
hide all <a> tags which look like this one?

<a tabindex=1
href="javascript:RemoveAttachmentFromServer('{044D83CB-912A-428E-87A0-
D2F746557DD5}',1)">Delete</a>

Basically I am trying to hide the delete option where the
javascript:RemoveAttachmentFromServer is being called.

Many thanks
BM
 
M

Martin Honnen

Test said:
Need help. How do I create a javascript to check the whole page, and
hide all <a> tags which look like this one?

<a tabindex=1
href="javascript:RemoveAttachmentFromServer('{044D83CB-912A-428E-87A0-
D2F746557DD5}',1)">Delete</a>

Basically I am trying to hide the delete option where the
javascript:RemoveAttachmentFromServer is being called.

Which browsers do you target?
 
V

VK

Hello all,

Need help. How do I create a javascript to check the whole page, and
hide all <a> tags which look like this one?

<a tabindex=1
href="javascript:RemoveAttachmentFromServer('{044D83CB-912A-428E-87A0-
D2F746557DD5}',1)">Delete</a>

Basically I am trying to hide the delete option where the
javascript:RemoveAttachmentFromServer is being called.

function hideEXA() {

var lnk = document.links;
var len = lnk.length;

for (var i=0; i<len; i++) {
if (lnk.href.indexOf('RemoveAttachment') != -1) {
lnk.style.display = 'none';
// or some other way of hiding
}
}

}

..
 
T

Test Test

Hello all,
Need help. How do I create a javascript to check the whole page, and
hide all <a> tags which look like this one?
<a tabindex=1
href="javascript:RemoveAttachmentFromServer('{044D83CB-912A-428E-87A0-
D2F746557DD5}',1)">Delete</a>
Basically I am trying to hide the delete option where the
javascript:RemoveAttachmentFromServer is being called.

function hideEXA() {

 var lnk = document.links;
 var len = lnk.length;

 for (var i=0; i<len; i++) {
  if (lnk.href.indexOf('RemoveAttachment') != -1) {
   lnk.style.display = 'none';
   // or some other way of hiding
  }
 }

}

.


This works great! thanks for the great help!
 
D

Dr_Kral

Need help. How do I create a javascript to check the whole page, and
hide all <a> tags which look like this one?

Your question reminds me of an old doctor joke.
Man: It hurts when I lift my arm like this. <whice>
Dr.: Then don't do that.

If you can control the JS to suppress the display, then why not remove it
from the source? Or control the display with CSS by defining a class with
"display:none".

Both the above and the JS suggestion could leave you with the text about a
link that is not there anymore.

K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top