0

我在我的页面加载事件中注册脚本以打开厚盒页面。但有时只出现灰色背景,而不是厚框页面。如果我遗漏了什么,请告诉我。下面是注册厚盒的代码。任何帮助将不胜感激。

 Dim sb As New StringBuilder()
            sb.AppendLine("<script type=""text/javascript"">")
            sb.AppendLine("jQuery(document).ready(function($)")
            sb.AppendLine("{")
            sb.AppendLine("tb_show(null, ""Thickbox.aspx?TB_iframe=true&height=500&width=500&modal=true"", null)")
            sb.AppendLine("});")
            sb.AppendLine("</script>")
            Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "RegisterWidgetScript", sb.ToString())

我是论坛的新手..让我知道是否有类似的帖子有解决方案?

谢谢加比

4

1 回答 1

0
I have fixed this issue.

In IE the imgLoader variable is null since I am calling the tb_show from the asp.net code behind. So I added the below code to check if the object is null and then initialize and assign the image url.

//Check if the image loader is null, this occurs when we call the tb_show method from the code behind
    if ( typeof imgLoader === 'undefined')
            {
                imgLoader = new Image();// preload image
                      imgLoader.src = tb_pathToImage;//Animated loader gif image.
            }
于 2009-08-24T18:18:32.623 回答