页面加载顺序jQuery
2014-06-29 14:02
176 查看
刚才做了一个功能。其他功能中的js方法如下
function PreviwDialogRep(obj) {
var objs = "<%=_strFilePath%>";
//$("#DivPrev").window({
// title: "长期预报",
// width: 800,
// height: 550,
// collapsible: false,
// minimizable: false,
// modal: true
//});
//$("#DivPrev").window('center');
$("#DivPrev").html("<iframe id='RepIfrm' src='../Consultation/ViewPage.aspx?path=" + objs + "></iframe>");
}
后台代码为:
if (!IsPostBack)
{
string strDocName = string.Empty;
DataSet ds = CQYB.GetDocDataSet(null);
if (ds != null && ds.Tables.Count > 0)
{
if (null != ds.Tables[0] && ds.Tables[0].Rows.Count > 0)
{
strDocName = ds.Tables[0].Rows[0]["imgname"].ToString();
//strDocName = ds.Tables[0].Rows[0]["remark1"].ToString();
// string strImgPath = HttpContext.Current.Server.MapPath("~/QueryAnalyse/DOC/TianQiYuBao");
_strFilePath = strDocName;
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>PreviwDialogRep('" + _strFilePath + "');</script>");
}
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('暂无长期预报!')</script>");
}
}
这种方式无法进入展示SWF的页面ViewPage.aspx。
之后调整为:
$(document).ready(function () {
var objs = "<%=_strFilePath%>";
$("#DivPrev").html("<iframe id='RepIfrm' src='../Consultation/ViewPage.aspx?path=" + objs + "' width='100%' height='100%'></iframe>");
// $("#DivPrev").html("<iframe id='RepIfrm' src='../Consultation/ViewPage.aspx?path=月底前工作计划.swf' width='100%' height='100%'></iframe>");
});
原因好像是加载顺序不同导致无法进入指定页面。
function PreviwDialogRep(obj) {
var objs = "<%=_strFilePath%>";
//$("#DivPrev").window({
// title: "长期预报",
// width: 800,
// height: 550,
// collapsible: false,
// minimizable: false,
// modal: true
//});
//$("#DivPrev").window('center');
$("#DivPrev").html("<iframe id='RepIfrm' src='../Consultation/ViewPage.aspx?path=" + objs + "></iframe>");
}
后台代码为:
if (!IsPostBack)
{
string strDocName = string.Empty;
DataSet ds = CQYB.GetDocDataSet(null);
if (ds != null && ds.Tables.Count > 0)
{
if (null != ds.Tables[0] && ds.Tables[0].Rows.Count > 0)
{
strDocName = ds.Tables[0].Rows[0]["imgname"].ToString();
//strDocName = ds.Tables[0].Rows[0]["remark1"].ToString();
// string strImgPath = HttpContext.Current.Server.MapPath("~/QueryAnalyse/DOC/TianQiYuBao");
_strFilePath = strDocName;
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>PreviwDialogRep('" + _strFilePath + "');</script>");
}
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('暂无长期预报!')</script>");
}
}
这种方式无法进入展示SWF的页面ViewPage.aspx。
之后调整为:
$(document).ready(function () {
var objs = "<%=_strFilePath%>";
$("#DivPrev").html("<iframe id='RepIfrm' src='../Consultation/ViewPage.aspx?path=" + objs + "' width='100%' height='100%'></iframe>");
// $("#DivPrev").html("<iframe id='RepIfrm' src='../Consultation/ViewPage.aspx?path=月底前工作计划.swf' width='100%' height='100%'></iframe>");
});
原因好像是加载顺序不同导致无法进入指定页面。
相关文章推荐
- jQuery中$(function()与(function($)、$(function(){ }) = $(document).ready(function(){ })及页面加载顺序
- 从html页面加载顺序来更好的理解jquery初始化
- jquery的 $(function(){ }) = $(document).ready(function(){ }) ,及页面的加载顺序
- js和jquery页面初始化加载函数的方法及先后顺序
- jquery的 $(function(){ }) = $(document).ready(function(){ }) ,及页面的加载顺序
- js在页面中的加载顺序及多个jquery $(document).ready() 的执行顺序
- js和jquery页面初始化加载函数的方法及先后顺序
- jquery的 $(function(){ }) = $(document).ready(function(){ }) ,及页面的加载顺序
- js和jquery页面初始化加载函数的方法及先后顺序
- 【JQuery】初始化页面当异步加载时构建页面元素的顺序
- 使用jQuery在Div中加载其他页面
- Javascript在页面加载时的执行顺序
- 【原】HTML页面元素加载顺序研究报告(5)----Script标签在Firefox下对背景图片的影响
- 【原】HTML页面元素加载顺序研究报告(4)----用JavaScript插入图片
- 关于asp.net中页面事件加载的先后顺序
- Javascript在页面加载时的执行顺序
- 一个bug引发的思考 --- ASP.NET页面加载顺序讨论
- Javascript在页面加载时的执行顺序
- asp.net页面的加载顺序
- 【原】HTML页面元素加载顺序研究报告(3)----Script标签与背景图片