Q:

Loading a page using jquery and replacing the page content

I am loading a page using jquery so it will not refresh the page. What I want to do is when I click on a link, it will load a page into the current page. I can do this. The problem now is that when the new content is loaded, the link that loaded the content remains on the page. Is there a way to remove this link once the new content is loaded? I can do this with php but not with jquery. My codes are shown below:
HTML (the link)
<a href="#" id="lik1">Link1</a>

JavaScript
$(document).ready(function(){
    $('#lik1').click(function(){
        $('#target').load('example.php');
    });
});

A:

This can be done by adding a complete function that hides the element:
$(document).ready(function(){
    $('#lik1').click(function(){
        $('#target').load('example.php', function(){
           $('#lik1').hide();
        });
    });
});

For more info, see http://api.jquery.com/load/.

