SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Non-Member
    Join Date
    Oct 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need this script

    Is there any Script that auto UN-LINK the links in page??

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    You can hijack the mouse click and cancel it when people click on a link. Is that what you want to prevent? Or are you wanting the presentation of the link to also not be shown, so that the links aren't blue and underlined?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Addict
    Join Date
    Jul 2007
    Location
    San Jose, California
    Posts
    355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you include jquery just use:
    Code JavaScript:
    $('a').click(function(e){e.preventDefault();});
    This part is a guess i'm not sure about the syntax
    Code Javascript:
    arr = document.getElementsByTagName( "a" );
    foreach(var x in arr) {
       arr.x.addEventListener('click', function(e){e.preventDefault();}, false);
       arr.x.addEventListener('mouseDown', function(e){e.preventDefault();}, false);
    }

  4. #4
    Non-Member
    Join Date
    Oct 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @baileylo plz can you tell me where to put this code ?

  5. #5
    SitePoint Addict
    Join Date
    Jul 2007
    Location
    San Jose, California
    Posts
    355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    before the closing <body> tag put this in
    Code JavaScript:
    <script type="text/javascsript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
    <script type="text/javascript">$(document).ready(function(){$('a').click(function(e){e.preventDefault();})});</script>

  6. #6
    Non-Member
    Join Date
    Oct 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Let me try it


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •