当前位置: 代码迷 >> ASP.NET >> 指定doctype后,js脚本不起作用,该怎样修改解决思路
  详细解决方案

指定doctype后,js脚本不起作用,该怎样修改解决思路

热度:1825   发布时间:2013-02-25 00:00:00.0
指定doctype后,js脚本不起作用,该怎样修改
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head runat="server">
  <title></title>
  <script type="text/javascript"><!--
  function cellkeydown(event) {
  if (event.ctrlKey && event.keyCode == 86) {
  var ss = document.getElementById("TextArea1");
  ss.focus();
  ss.select();
  // 等50毫秒,keyPress事件发生了再去处理数据 
  setTimeout("dealwithData()", 50);
  }
  }
  function dealwithData(event) {
  var ss = document.getElementById("TextArea1");
  alert(ss.value);
  //document.getElementById("<%=Button2.ClientID %>").click();
  ss.blur();
  } 
// --></script> 
</head>
<body onkeydown="return cellkeydown(event)">


------解决方案--------------------------------------------------------
LZ后缀改了么
------解决方案--------------------------------------------------------
VB.NET code
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Testerror.aspx.vb" Inherits="Testerror" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">    <title>Test</title>    <script type="text/javascript">        function cellkeydown(event)        {                  if (event.ctrlKey && event.keyCode == 86) {          var ss = document.getElementById("TextArea1");          ss.focus();          ss.select();          // 等50毫秒,keyPress事件发生了再去处理数据            setTimeout("dealwithData()", 50);          }  }  function dealwithData(event) {  var ss = document.getElementById("TextArea1");  alert(ss.value);  ss.blur();        }            </script></head><body  onkeydown="return cellkeydown(event)">   <textarea id="TextArea1" name="TextArea1"></textarea></body></html>
  相关解决方案