質問
私は、PHPスクリプトによって作成されたいくつかのオプションを使用して、選択制御の中わたのHTMLを置き換えxajaxので作成した簡単なのビットを持っています。
これはFirefoxで罰金とダンディですが、それはIE7で動作しません。
私は基本的に「本当にdoesntの言うこののを見つけたxajaxのフォーラムでみますIEでの仕事、div要素を使用し、完全なselect文 "
とその内側のHTMLを置き換えますこれをしなかった、と私はjQueryのセレクタは今、もはや作品の選択制御、に取り組んでいたことを除いて、それは、大丈夫です。
誰もが任意のアイデアを得た、または誰もがjQueryのを使用してAjaxのビットを行う方法の良いjQueryの例に私を指すことができますので、私は完全にxajaxのを捨てることができますか?
<時間>EDIT:
<div id=imgselect>
<select id="images">
<option value="">Then select an image</option>
</select>
</div>
Picture Preview:<br><br>
<div class="img-preview" id='preview'></div>
<script type='text/javascript'>
$('#images').change(function()
{
var image = $(this).val();
var img = $('<img/>').attr('src', image);
$('#preview').html(img);
document.getElementById('picsmall').value = image;
});
</script>
問題が来るimgselect
のdiv
の内容はAJAX呼び出しに置き換えられたときに、
解決
このは現在使用して解決されます。
$objResponse->script
コマンド
完全を期すために、誰が将来的に見たい場合は、私は上記のように設定し、元のページを持っています
<div id=imgselect>
<select id="images">
<option value="">Then select an image</option>
</select>
</div>
そして、私のxajaxのPHPのファイルでI持っています。
function getphotos()
{
$objResponse = new xajaxResponse();
//this include assigns all the options to the select controll into the $output var
include "photos.photosselect.php";
$objResponse->assign("imgselect", "innerHTML", "$output");
$objResponse->script("$('#images').change(function() {var image = $(this).val(); var img = $('<img/>').attr('src', image); $('#preview').html(img); document.getElementById('picsmall').value = image;});");
return $objResponse;
}
所属していません StackOverflow