[英]Very technical- Modal takes time to load. How to reduce the load time?
我有一个跨度为“单击以打开对话框”的文件。 它以模式视图打开网页。 该网页在var perlURL="..../cgi-bin/test/web_editor.pl";
下面的url部分中提到var perlURL="..../cgi-bin/test/web_editor.pl";
请注意,这是一个包含网格数据的perl文件。 大量的JavaScript和数据。
我的查询是-当我单击“单击以打开对话框”对话框时,大约需要7分钟才能将整个perl文件加载到模式中。
谁能分享我如何减少加载时间。 如果我使用基本的html文件,它会立即加载。 但是这个1200行代码的perl文件,要在模式中加载需要7秒钟。 请在此处说明如何缩短加载时间。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css">
<script>
$(function() {
var dialogW = 1130;
var dialogH = 700;
$( "#dialog" ).dialog({
autoOpen: false,
modal: true,
title: '',
width: dialogW,
height:dialogH,
draggable: true,
resizable: true
});
$( "#opener" ).click(function() {
$("#dialog").html("<span>Loading...</span>").dialog("open");
var perlURL=".../test/web_editor.pl";
$("#dialog").load(perlURL);
});
});
</script>
</head>
<body>
<span style="cursor:pointer" id="opener" >Click to Open Dialog </span>
<div id="dialog" title=""> </div>
</body>
</html>
打开您的Perl代码,在模态之外单独运行它,并确定在那里的加载时间。 很可能是Perl代码的性能不佳,根据上面的详细信息,我将从调用读取数据的数据源开始。 读取数据的脚本中的性能可能会很差,或者网络性能可能会很差。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.