say the container that will display the loaded content, i.e, your iframe
becomes

<div id="menu">
<a href="page/to/load.html" class="ajaxLink">click me</a>
<a href="page/to/load2.html" class="ajaxLink">click me 2</a>
<div id="ihateiframes">
<p>this will be replaced</p>
</div>


your javascript will be:

$(document).ready(function(){
$('a.ajaxLink').click(function(){
var url = $(this).attr('href');
$('#ihateiframes').empty().load(url);
});

});

On Mon, Dec 22, 2008 at 6:51 AM, Ayan <ios...@gmail.com> wrote:

>
> Hi
>
> Currently my page has a iFrame (loads an external web-page) in it.
>
> I have seen this tutorial that uses simple AJAX to replace this
> iFrame.
> http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
> (see the small DEMO, I want exactly the same with just 2 Links)
>
>
> My question is - How can I do the same using jQuery's AJAX to do the
> same ?
>
> Thats is, when these 2 Button/Link hit, it will fetch corresponding
> remote html and paste it in a DIV. Thats it.
>
> Please do reply.....
>
> Ayan Debnath
> INDIA.
>

Reply via email to