How do I disable a link? in <A>

N

nntp

I have a set of links which I want search engines to crawl them, but I want
to disable them from my visitors, so I will ask the link owners to pay me to
let me enable them.

<a disabled href="#">bahbahbah</a>
Does not work, as it is still clickable. It only changes the color to grey.
 
K

Karl Groves

nntp said:
I have a set of links which I want search engines to crawl them, but I want
to disable them from my visitors, so I will ask the link owners to pay me to
let me enable them.

You're a fucking retard.
You'll make more money with a part time job than by doing stupid shit like
this.

-Karl
 
M

Michael Winter

[fixed top-post]

It's also invalid HTML, and likely to work only in IE.
I found the solution by changing the this.href as used here
http://www.aboutdatarecovery.com/data-recovery-links.shtml
all links look right, but they are not clickable as it will call onclick
fuction to change the href from whatever it is to #.

However, a user simply has to disable Javascript to bypass it. It can also
be disabled easily by other means.

Personally, I don't see the point. Is your site so popular that people
will want to *pay* you to link to them? No offence, but I doubt it.

Mike


Please don't top-post.
 
N

Neal

I have a set of links which I want search engines to crawl them, but I
want
to disable them from my visitors, so I will ask the link owners to pay
me to
let me enable them.

If the search engines can use them, so can your visitors. Not sure you've
thought this through.

One thing which can be done is make them regular free links until you've
verified the search engines have indexed them, then make them
password-access. When people are searching for content, they'll find your
page, but when they attempt to load it they must pay to see the content.

I don't believe this is likely to be a successful business endeavor,
though. Not much info is ONLY available by paying for it. Simply clicking
another page from the search engine results page is likely to be a cheaper
alternative for your visitor.
 
G

Grant Wagner

nntp said:
I found the solution by changing the this.href as used here
http://www.aboutdatarecovery.com/data-recovery-links.shtml
all links look right, but they are not clickable as it will call onclick
fuction to change the href from whatever it is to #.

You've got some silly ideas about your ability to control content once it has
been downloaded to a user agent.

*Before* I click on those "dead" links I simply right-click and pick "Open Link
in New Window" (or in my case "Open Link in New Tab"). I don't even need to
disable JavaScript to get around your "security".

Of course, your next question will be "how do I disable the right mouse
button?". Doesn't matter, even if you could disable the right mouse button
effectively in ever user agent, all the time (which you can't <url:
http://everything2.com/?node=right-click+trap />), I can click and hold with
the left mouse button, then hit the context menu key on my keyboard, then
choose "W" to "Open Link in New Window", "T" to "Open Link in New Tab" or "P"
to get the link properties which I can use to copy/paste the link back into the
browser.

So let's say you somehow manage to disable my context menu key. Still doesn't
matter, I can View > Source to obtain the links.

And let's get incredibly silly and somehow you could disable my ability to
right mouse button and my ability to do View > Source by removing all menus and
toolbars in a new window. It still does not matter, I can hit CTRL+N in
Internet Explorer and get a new window with full chrome pointing to the same
page.

And even if you manage to disable CTRL+N so I can't do that. It _still_ does
not matter, I will just go to a command prompt and execute "wget <yoursite>",
or I could disable JavaScript and revisit your page.


However, I'm sure none of my information will deter you from trying to charge
for content that is as easily accessible as anything else on the Internet. If
that is the case, can I have the URL to your page? I'd love to take a look at
what you consider valuable enough to charge for.
 
T

Thomas 'PointedEars' Lahn

nntp said:
I have a set of links which I want search engines to crawl them, but I
want to disable them from my visitors, so I will ask the link owners to
pay me to let me enable them.

ROTFL! YMMD!
<a disabled href="#">bahbahbah</a>
Does not work, as it is still clickable. It only changes the color to
grey.

The "a" element does not have a "disabled" attribute (in Valid HTML).


PointedEars
 
Joined
Feb 18, 2008
Messages
1
Reaction score
0
Not sure who originally posted this query (nntp?) because I can't see their name AND it's a very old post. However, I thought it best to leave a sensible reply for anyone else coming across this forum page like i did.

Firstly, may I apologise on behalf of all sensible programmers for the comments made by Karl and some others. They are most likely boys in their bedrooms or extreme techy geeks. These type of people don't seem to appreciate that there are other people in the world who are new to things and are climbing the ladder a bit further down than themselves.

Obviously, you are new to the whole programming world and Javascript is something new to you to just as it was to everyone else who now claims to be an expert these days. Javascript is a great means of creating dynamic content but in it's most basic form, I would recommend not using it for anything to do with security, simple because, Javascript can be disabled. Yes, there are servlets etc, but lets not get complicated techy geeks, this answer is for "newbies".

Now, for 50% of people your method might still work because not everyone knows Javascript or how to disable it. Lets face it, it's not exactly clear for a non-techy in Internet Explorer. But yes, those that have some I.T knowledge will already know that it can be disabled quite easily. I mean, the whole "disable right-click" is pointless because in Internet Explorer you can just right-click, keep the button held down, then press ENTER to remove the message, then let go of the button and hey presto...

Anyway...
I think what's missing from this entire page is someone who will actually give you an alternative. Techy geeks are extremely good at laughing in your face and running things down, but few of them ever actually give you proper help and guidance on a better solution. Notice the posts above? most just tell you WHY it won't work, but none actually give you any useful advice.

Anyway, if you truly want to venture into the area of only showing links to paid members, you really want to go about it using a server-side programming language like PHP or ASP. This will allow you to create Memberships with registration pages (like this forum). The big difference between doing this method in comparison to Javascript is that....

a). Javascript will still have to have the link stored somewhere in the HTML EVEN if you have disabled it where as PHP/ASP can decide before hand whether to show a link as they are producing the HTML.

Lets say you have a non-member looking at the page :

Javascript version would look like this:
============================

This is an important <a href='http://www.example.com' onclick="if(!member){alert('you are not a member');return false">link</a>

PHP/ASP version might look like this
=============================
This is an important <span class='disabledlink'>link</span>


As you can see the biggest difference is that, with PHP/ASP all of the working out has been done on the server so that a visitor can't see anything that's gone on and won't be able to find the link in the source. With the Javascript version, you could easily just view the source and get the link anyway.

SUMMARY
===========
To be honest, the idea of disabling links (using javascript) to non members is an odd choice because, firstly, in order to have members, you would have something setup already using PHP/ASP to let them login etc. So just don't print the link if they aren't members and avoid Javascript.

The only way I could see needing to use your method (for non-technical people) would be to have a Javascript dialogue box that first asked the user to enter a special password (that all members would know). If correct, you store a COOKIE. Then you could decide if links were enabled by checking the COOKIE? But that should be avoided at all costs!

So the answer is, no, don't use Javascript for security things.

AN ASIDE - XHTML
==============
If you are new to XHTML and the whole compliance thing then Javascript can be another downer. Basically, XHTML and W3C are creating restrictions to make sure people do things properly so that their solution is globally accessible.

So, if you use Javascript to do something, you have to make sure that if Javascript is disabled, the user can still perform the same task (or near enough).

Anyway,
Hope that helps someone if they come across this in 2012.
 
Last edited:
Joined
Mar 4, 2012
Messages
1
Reaction score
0
@gbm2007,

Thanks for your gracious reply to the original guy's question and your appropriate rebuke of the other guys - this world is filled with people who only say "You can't...", but never get around to mentioning what can be done.

Thanks again,
Joe in 2012 :)
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top