후 내가 jQuery를 BlockUI를 사용하고 작동하지 않습니다 새로운 페이지에서자바 스크립트가 다음 자바 스크립트로 쿼리 데이터베이스의 많은에 약간의 시간이 소요 새로운 웹 페이지를 여는 document.write를
function productSheet(url2) {
$.blockUI.defaults.overlayCSS = {};
$.blockUI({ });
$.ajax({
url: url2,
success: function (respones) {
var win = window.open();
with (win.document) {
open();
write(respones);
close();
}
}
});
};
전 일부 jQuery JavaScript 및 외부 jQuery 스크립트에 대한 참조가있다. 그러나 위의 JavaScript를 페이지를 렌더링 할 때 내 스크립트에서 "$ undefined"오류가 발생합니다. 페이지를 새로 고칠 수 있으며 모든 작업이 시작되고 스크립트 오류가 발생하지 않습니다.
이 문제는 Firefox 9에서 디버깅 할 때만 발생합니다 (모든 JavaScript 오류 및 스크립트 작동).
문제가 무엇이 될 수 있는지에 대해 아는 사람이 있습니까?
편집 :
페이지 iam 렌더링은 MVC 3보기입니다. 그래서 위의 스크립트는이 뷰를 반환하는 MVC 조치로 이동 :
@model WebApplication.Controllers.ProductSheetModel
<!DOCTYPE html>
<html>
<head>
<title>Sheet - @Model.ArticleMain.ArticleMain.T0018_BENAM</title>
<script src="../../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>
<link href="../../css/ProductSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
@if (Model.IsPDFExport == false)
{
@Html.DisplayFor(model => model.ArticleMain, "ProductSheetHeader")
}
... some more partical views...
</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function() {
var tabelheight1 = $("#divNutritiveValues").height();
var tabelheight2 = $("#divMarking").height();
if (tabelheight1 > tabelheight2) {
$("#divMarking").css("height", tabelheight1 + "px");
$("#divNutritiveValues").css("height", tabelheight1 + "px");
}
if (tabelheight2 > tabelheight1) {
$("#divNutritiveValues").css("height", tabelheight2 + "px");
$("#divMarking").css("height", tabelheight2 + "px");
}
var tableheightStore = $("#divStore").height();
var tableheightCooking = $("#divCooking").height();
if (tableheightCooking > tableheightStore) {
$("#divCooking").css("height", tableheightCooking + "px");
$("#divStore").css("height", tableheightCooking + "px");
}
if (tableheightStore > tableheightCooking) {
$("#divCooking").css("height", tableheightStore + "px");
$("#divStore").css("height", tableheightStore + "px");
}
var tableInfoProvid = $("#divInformationProvider").height();
var tableManufac = $("#divManufacturer").height()
if (tableInfoProvid > tableManufac) {
$("#divManufacturer").css("height", tableInfoProvid + "px");
$("#divInformationProvider").css("height", tableInfoProvid + "px");
}
if (tableManufac > tableInfoProvid) {
$("#divInformationProvider").css("height", tableManufac + "px");
$("#divManufacturer").css("height", tableManufac + "px");
}
});
나는 여기서 세 가지를 보지 못했다 - jQuery 1.3을 사용하여'with'를 사용하고'document.write'를 사용한다 ... – Alnitak