-1

I have problem with AHAH Jquery method load(). I want to after clicking links in a table

<table class="table table-hover" style="background: white;">
<tbody>
<tr>
<td><a title="Dominikana" href="../../oferty-hotelowe/tajlandia"><img src="../../upload/getbyid/175094/Thailand-Flag-icon (1).png" alt="Dominikana"></a></td>
<td><a title="Dominikana" href="../../oferty-hotelowe/tajlandia">Tajlandia</a></td>
<td class="arrow"><a title="Dominikana" href="../../oferty-hotelowe/tajlandia">&gt;</a></td>
</tr>

link should opens in an iframe, but it doesn't work, only alert pops up.

<iframe id="64704528" src="" width="100%" height="720"></iframe>


var $widget = $(".table-hover");

$widget.find("a").on('click', function(e) {
    e.preventDefault; 

    var $frame = $("iframe#64704528");

    $frame.load("http://comfort31.traffics-ibe.com/tibet.php?target=%2Fuslugi%2Fzakwaterowanie%2F&amp;ixp=hotel&amp;typ=H&amp;cfg=0080017030000000&amp;stp=2&amp;rmask=1&amp;hmask=2&amp;tps=t5&amp;xP=0000%2B0000&amp;lng=pl&amp;dsi=ALLE&amp;opi=&amp;htn=&amp;vnd = 20.05.2011 &amp; BSD = 20 czerwca 2011 i EPC = 2-enc = UTF-8-NTC = 1", function() {
  alert( "Load was performed." ); 
    });
  });  
kyun
  • 9,710
  • 9
  • 31
  • 66
krieng
  • 1
  • 3

1 Answers1

-1

.load() is for setting the HTML of an element, but you can't put HTML directly into an iframe. You should set the src to point to the URL.

$frame.attr("src", "http://comfort31.traffics-ibe.com/tibet.php?target=%2Fuslugi%2Fzakwaterowanie%2F&amp;ixp=hotel&amp;typ=H&amp;cfg=0080017030000000&amp;stp=2&amp;rmask=1&amp;hmask=2&amp;tps=t5&amp;xP=0000%2B0000&amp;lng=pl&amp;dsi=ALLE&amp;opi=&amp;htn=&amp;vnd = 20.05.2011 &amp; BSD = 20 czerwca 2011 i EPC = 2-enc = UTF-8-NTC = 1")
    .on("load", function() {
        alert("Load was performed.");
});
Barmar
  • 741,623
  • 53
  • 500
  • 612