Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在ASP页面上的jquery函数之间分配ASP变量?_Jquery_Asp Classic - Fatal编程技术网

如何在ASP页面上的jquery函数之间分配ASP变量?

如何在ASP页面上的jquery函数之间分配ASP变量?,jquery,asp-classic,Jquery,Asp Classic,有没有办法在jquery函数执行之间分配ASP变量 <% txtDescription = Replace(strBody,vbCrLf,"<br/>") %> <script type="text/javascript" language="JavaScript"> var bodyDefault = '<%=strBodyDefault%>'; var txtDescription = '<%=txtDescription

有没有办法在jquery函数执行之间分配ASP变量

<%
txtDescription = Replace(strBody,vbCrLf,"<br/>")
%>
<script type="text/javascript" language="JavaScript">
    var bodyDefault = '<%=strBodyDefault%>';
    var txtDescription = '<%=txtDescription%>';
    $(document).ready(function() 
    {
      $("#obj_edit_editBox").focus(function()
      {
          if (txtDescription == bodyDefault)
          {
        //Do something here
          }
      });                          
    });
</script>

var bodyDefault='';
var txtDescription='';
$(文档).ready(函数()
{
$(“#对象编辑框”).focus(函数()
{
if(txtDescription==bodyDefault)
{
//在这里做点什么
}
});                          
});

一旦服务器结束生成页面并将其发送到客户端,ASP变量就会消失。在那里(在客户端),您可以使用javascript,然后(通过post或GET)发回服务器以处理信息。

您的代码应该可以正常工作。你有什么问题吗?嗨,罗瑞,在这里做点什么。。如何将asp变量赋值为空,即
txtDescription=“”
。。我在这一点上被卡住了..如果ASP变量
txtDescription
为空或null,然后在
响应中不会输出任何内容。write
var txtDescription='
将被写入页面。您在
中试图完成什么?Siva:在您的情况下,我认为您需要创建一个名为
Description
输入
字段,并设置其中的值。然后,您需要向服务器提交(使用
表单POST
)值。我认为您不了解web开发是如何工作的。