Disable link - I'll pay for your help

Discussion in 'JavaScript' started by willrs, Dec 26, 2009.

  1. #1
    Issue Solved!

    Hi guys,

    I have a premium Wordpress theme and need to disable a link. However, the code is encrypted and I can't edit the HTML.

    See the code below (I got it from the browser, it's not possible to edit it with dreamweaver):

    <div id="header"><!-- START LOGO LEVEL WITH RSS FEED --> 
                     
                    <h1><a href="http://priteshparmar.com/"><img src="http://newestmarketing.com/thesocialhacker/wp-content/uploads/2009/12/banner.jpg" alt="" /></a></h1> 
                     
                    <!-- Top Ad Starts --> 
                                            <!-- Top Ad Ends --> 
                     
            </div><!--/header -->
    HTML:
    I want to make that link not clickable, but can't use id, class or name.

    I was trying to insert a piece of code after the div "header" (in another div), but it didn't work. See what I was trying:

    <script type="text/javascript">
    document.getElementById('header').getElementsByTagName('a')[0].onclick = 'return false;';
    </script>
    HTML:

    Thank you,
    William
     
    Last edited: Dec 26, 2009
    willrs, Dec 26, 2009 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Try this:

    Write this script after closing tag </body>

    
    <script type="text/javascript">
    remove_link = document.getElementById('header').getElementsByTagName('a')[0];
    header_banner_image = remove_link.getElementsByTagName('img')[0];
    remove_link_parent =  remove_link.parentNode;
    
    remove_link.parentNode.removeChild(remove_link);
    remove_link_parent.appendChild(header_banner_image);
    </script>
    
    Code (markup):
     
    s_ruben, Dec 27, 2009 IP
  3. spiderman3

    spiderman3 Peon

    Messages:
    177
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    How much you pay for this, I researched WP themes and on WP, i know these problems and have a good solution.
     
    spiderman3, Jan 9, 2010 IP