我的守则是打开通过加亚装一页的轮胎箱:
$( tr.record ).click(function() {
var record_id = $(this).attr("id");
var link = http:// + window.location.hostname + /expenses/expenses_edit/ + record_id;
$.fancybox({
transitionIn : fade ,
transitionOut : none ,
type : ajax ,
href : link,
onClosed : function() {
parent.location.reload(true);
}
});
$.bind("submit", function() {
$.fancybox.showActivity();
$.ajax({
type: "POST",
cache: false,
data: $(this).serializeArray(),
success: function(data) {
$.fancybox(data);
}
});
return false;
});
});
轮胎箱内的网页有一种形式,包括有果园的文字领域:
<form>
...
<textarea name="exp_det" cols="90" rows="12" id="exp_det"></textarea>
<span id="charLeft">150</span> characters left
</form>
The parent page loads this via header:
$( #ext_det ).keyup(function() {
var len = this.value.length;
if (len >= 150) {
this.value = this.value.substring(0, 150);
}
$( #charLeft ).text(150 - len);
});
因此,问题是,这一char(和其他 j,如鉴定,日期pi)在ancy子内没有工作。 如果该网页没有轮胎箱装满,或者该网页通过轮胎箱装上。
我理解这似乎是一个合理的共同问题,但我尝试了所有解决办法,没有人为我工作。
我受审
- using diferent IDs for the ajax page
- placing the char count script at the end of ajax page (it didn t even show
- on Firebug)
- placing the char count script as a function within
success
- other crazy iterations
The problem seems related to re-init ing the jQuery functions after the ajax page has loaded, since these elements were not there when the parent page was loaded.
Any suggestions?