-1

Is there any way I could make specific text strings "invisible" on my web page?

For example,

If I were to specify the string "hxxp://nullrefer.com/?", I would need that text to appear invisible on my page everywhere it's mentioned, automatically.

So, if the url "hxxp://nullrefer.com/?hxxp://www.Amazon.com" were to be mentioned on my page, viewers would only be able to see the "hxxp://www.Amazon.com" portion of it. Almost as if you were to turn the Opacity of to the text down to 0% for that specific string only, everywhere it appears on the page, automatically. I need it to still physically be there, but be as invisible as possible.

Are there any scripts out there for something like this?

Thomas
  • 1
  • 1
  • 2
  • *Are there any scripts out there for something like this?* Why don't you write one? – flowfree Jun 04 '12 at 05:59
  • I don't know where to begin...? I'm not sure of how to specify the text string and what function should be used to cloak the text. I'm new. – Thomas Jun 04 '12 at 06:02
  • You don't just want opacity 0% because that would leave an empty space where the invisible letters are. Given that you are talking about URLs can't you use standard anchor elements: `hxxp://www.Amazon.com`? – nnnnnn Jun 04 '12 at 06:25

1 Answers1

1

This will replace all of the links on your page with whatever you specify instead of nullrefer.. Also if you only want it to affect a certain id/class you can do it with

a[i].parentNode.id == "someid" a[i].parentNode.className == "someid"

Pretty basic and awful but it'll do what you want. Add it to the bottom of your page.

<script type="text/javascript">

var a = document.getElementsByTagName('a');
for(i=0;i<a.length;i++)
{
    if(a[i].parentNode.id == "someid")
    a[i].href = "hxxp://www.nullrefer.com/?" + a[i].href;
}
</script>
Steve
  • 2,936
  • 5
  • 27
  • 38
  • I'm putting this script on my page, but it seems to do nothing... I've experimented changing the "someid" to "http://" and still have no luck. Any ideas? – Thomas Jun 05 '12 at 23:04