Здравствуйте, такая проблема: есть переменная res, ей присваивается значение html кода:
$('#res').html('<div align="center" class="contentp"><img src="/upload/ok.png" style="margin-right:5px;">Вы прошли<b> ' + result + ' </b>тестов из 10 возможных! <a href="#" class="resultpodrr">Подробный Результат</a> <a href="javascript:location.reload(true)"><div class="closeres"><img src="/upload/close.png" style="float:right; margin-right:10px;"></div></a></div>');
<a href="#" class="resultpodrr">Подробный Результат</a>
Вот эта ссылка то и не работает, т.е. при нажатии ничего не происходит, а должно появляется что-то на подобии ajax окошка.
Если эту ссылку расместить вне java кода, тогда всё нормально...
Вот код этого ajax окна, к которому привязана ссылка:
jQuery(function ($) {
var OSX = {
container: null,
init: function () {
$("a.resultpodrr").click(function (e) {
e.preventDefault();
$("#osx-modal-content").modal({
overlayId: 'osx-overlay',
containerId: 'osx-container',
closeHTML: null,
minHeight: 80,
opacity: 65,
position: ['0',],
overlayClose: true,
onOpen: OSX.open,
onClose: OSX.close
});
});
},
open: function (d) {
var self = this;
self.container = d.container[0];
d.overlay.fadeIn('slow', function () {
$("#osx-modal-content", self.container).show();
var title = $("#osx-modal-title", self.container);
title.show();
d.container.slideDown('slow', function () {
setTimeout(function () {
var h = $("#osx-modal-data", self.container).height()
+ title.height()
+ 20; // padding
d.container.animate(
{height: h},
200,
function () {
$("div.close", self.container).show();
$("#osx-modal-data", self.container).show();
}
);
}, 300);
});
})
},
close: function (d) {
var self = this; // this = SimpleModal object
d.container.animate(
{top:"-" + (d.container.height() + 20)},
500,
function () {
self.close(); // or $.modal.close();
}
);
}
};
OSX.init();
});
Содержимое ajax окна пишется вне java кода, просто div'ом:
<div id="osx-modal-content">
<div id="osx-modal-title">Ваши результаты в подробном виде</div>
<div class="close"><a href="#" class="simplemodal-close">x</a></div>
<div id="osx-modal-data">
<iframe src="/result.txt" width="568" height="510" style="border:none;"></iframe>
</div>
</div>
</div>
Пожалуйста, скажите, что не так...