How do I disable a link? in <A>

Discussion in 'HTML' started by nntp, Sep 1, 2004.

  1. nntp

    nntp Guest

    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.
    nntp, Sep 1, 2004
    #1
    1. Advertising

  2. nntp

    Karl Groves Guest

    "nntp" <> wrote in message
    news:zKoZc.2036$...
    > 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
    Karl Groves, Sep 1, 2004
    #2
    1. Advertising

  3. nntp

    nntp Guest

    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 #.

    > 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.
    >
    >
    nntp, Sep 1, 2004
    #3
  4. On Wed, 01 Sep 2004 18:50:36 GMT, nntp <> wrote:

    [fixed top-post]

    >> 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.


    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.

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
    Michael Winter, Sep 1, 2004
    #4
  5. nntp

    Neal Guest

    On Wed, 01 Sep 2004 18:42:39 GMT, nntp <> wrote:

    > 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.
    Neal, Sep 1, 2004
    #5
  6. nntp

    Grant Wagner Guest

    nntp wrote:

    > 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.

    --
    Grant Wagner <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Grant Wagner, Sep 1, 2004
    #6
  7. nntp wrote:

    > 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
    --
    I Never Give Up Un Till They prave My Gun Out Of My Dead Cold Fingers
    Thomas 'PointedEars' Lahn, Sep 5, 2004
    #7
  8. nntp

    Max Menlove

    Joined:
    Sep 6, 2007
    Messages:
    1
    Javascript

    onclick="return false;"
    Max Menlove, Sep 6, 2007
    #8
  9. nntp

    gbm2007

    Joined:
    Feb 18, 2008
    Messages:
    1
    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: Feb 18, 2008
    gbm2007, Feb 18, 2008
    #9
  10. nntp

    yabwee

    Joined:
    Mar 4, 2012
    Messages:
    1
    @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 :)
    yabwee, Mar 4, 2012
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    814
    Kevin Spencer
    May 17, 2005
  2. John Grandy
    Replies:
    0
    Views:
    609
    John Grandy
    Sep 13, 2005
  3. Sn
    Replies:
    5
    Views:
    557
    Patricia Shanahan
    Jul 4, 2006
  4. K.
    Replies:
    0
    Views:
    482
  5. Plateriot
    Replies:
    3
    Views:
    1,545
    Plateriot
    Jul 4, 2008
Loading...

Share This Page