Я использую jQuery, чтобы показать / скрыть контейнер div (#pluginOptionsContainer) и загрузить в него страницу (./plugin_options.php) с отправленными необходимыми переменными POST.
Данные POST отправляются на основе значения списка выбора (#pluginDD) и нажатия кнопки (#pluginOptionsBtn) ...
Он отлично работает в Firefox, но не работает в IE. Похоже, что запрос '$ ("# pluginOptionsContainer"). Load () никогда не заканчивается в IE - я вижу сообщение о загрузке всегда ...
bind (), empty () и append (), кажется, работают нормально в IE. Но не load () ..
Вот мой код:
// wait for the DOM to be loaded
$(document).ready(function() {
// hide the plugin options
$('#pluginOptionsContainer').hide();
// This is the hack for IE
if ($.browser.msie) {
$("#pluginDD").click(function() {
this.blur();
this.focus();
});
}
// set the main function
$(function() {
// the button shows hides the plugin options page (and its container)
$("#pluginOptionsBtn") .click(function() {
// show the container of the plugin options page
$('#pluginOptionsContainer').empty().append('<div style="text-align:center;width:99%;">Loading...</div>');
$('#pluginOptionsContainer').toggle();
});
// set the loading message if user changes selection with either the dropdown or button
$("#pluginDD,#pluginOptionsBtn").bind('change', function() {
$('#pluginOptionsContainer').empty().append('<div style="text-align:center;width:99%;">Loading...</div>');
});
// then update the page when the plugin is changed when EITHER the plugin button or dropdown or clicked or changed
$("#pluginDD,#pluginOptionsBtn").bind('change click', function() {
// set form fields as vars in js
var pid = <?=$pid;?>;
var cid = <?=$contentid;?>;
var pDD = $("#pluginDD").val();
// add post vars (must use JSON) to be sent into the js var 'dataString'
var dataString = {plugin_options: true, pageid: pid, contentid: cid, pluginDD: pDD };
// include the plugin option page inside the container, with the required values already added into the query string
$("#pluginOptionsContainer").load("/admin/inc/edit/content/plugin_options.php#pluginTop", dataString);
// add this to stop page refresh
return false;
}); // end submit function
}); // end main function
}); // on DOM load
Любая помощь будет с благодарностью! Я ненавижу IE!