IE9 调试javascript SCRIPT5007: 属性“ShowLink”的值为 null、未定义或不是 Function 对象
SCRIPT5007: 属性“ShowLink”的值为 null、未定义或不是 Function 对象
IE9 调试结果如下:
<script language="javascript" type="text/javascript">ShowLink('word');<
可是我的代码如下,请问哪儿有错啊?
aspx代码如下
———————————————————————————————————————————————————————
<%
switch (i_NewsType)
{
case 0:
ExecuteJs("ShowLink('word');");
break;
case 1:
ExecuteJs("ShowLink('pic');");
break;
case 2:
ExecuteJs("ShowLink('url');");
break;
default:
ExecuteJs("ShowLink('word');");
break;
}
%>
.cs的代码如下
——————————————————————————————————————————————_____
protected void ExecuteJs(string sentence)
{
Context.Response.Write("<script language=\"javascript\" type=\"text/javascript\">");
Context.Response.Write(sentence);
Context.Response.Write("</script>");
}
javascript代码如下
____________________________________________________________________________________________________________
function ShowLink(NewsType)
{
switch (NewsType)
{
case "word":
document.getElementById('div_showad').style.display='';
document.getElementById('div_URLaddress').style.display='none';
document.getElementById('div_PicURL').style.display='none';
document.getElementById('div_Content').style.display='';
document.getElementById('div_Templet').style.display='';
document.getElementById('div_Souce').style.display='';
document.getElementById('NewsProperty_CommTF').style.display='';
document.getElementById('NewsProperty_DiscussTF').style.display='';
document.getElementById('NewsProperty_FILTTF').style.display='none';
document.getElementById('isFiles_div').style.display ="";
document.getElementById('isFiles_div1').style.display ="";
document.getElementById('div_vURL').style.display = "";
break;
case "pic":
document.getElementById('div_showad').style.display='';
document.getElementById('div_URLaddress').style.display='none';
document.getElementById('div_PicURL').style.display='';
document.getElementById('div_Content').style.display='';
document.getElementById('div_Templet').style.display='';
document.getElementById('div_Souce').style.display='';
document.getElementById('NewsProperty_CommTF').style.display='';
document.getElementById('NewsProperty_DiscussTF').style.display='';
document.getElementById('NewsProperty_FILTTF').style.display='';
document.getElementById('isFiles_div').style.display ="";
document.getElementById('isFiles_div1').style.display ="";
document.getElementById('div_vURL').style.display = "";
break;
default :
document.getElementById('div_showad').style.display='none';
document.getElementById('div_URLaddress').style.display='';
document.getElementById('div_PicURL').style.display='';
document.getElementById('div_Content').style.display='none';
document.getElementById('div_Templet').style.display='none';
document.getElement