jQuery とAjaxを使用しています。ハイパーリンクをクリックすると、ポップアップ メニューに読み込まれる関連ドキュメントが正常に機能します。問題は、Ajax を使用するときに発生します。
私のコード
//index.html
....
jQuery.ajax({
type: 'POST',
url: ' my.php',
data: 'one=' + one,
success: function(data){
jQuery("#another").load("load.html");
//Pop up code for the Load.html
jQuery("a[rel='pop']").click(function (e) {
e.preventDefault();
var features = "height=700,width=800,scrollTo,resizable=1,scrollbars=1,location=0";
newwindow=window.open(this.href, 'Popup', features);
return false;
});
}//Success
}); //Ajax
戦略: ハイパーリンクを見た後、関連するコンテンツをポップアップに表示する必要があります。
Load.html
<a href="pdf/file1.pdf" id="pop" rel="pop"> click 1.</a>
<a href="pdf/file2.pdf" rel="pop">click2</a>
Load.html
では動的に読み込まれるためindex.html
、すべてのタグが PDF ファイルのリンクに関連付けられ、load.html
ファイルはポップアップにドキュメントを表示しません。上記の出力を行うようにコードを変更するにはどうすればよいですか?