【问题标题】:Classic ASP Response write statement经典 ASP 响应写入语句
【发布时间】:2015-05-31 04:13:00
【问题描述】:

在 html 中这些都在工作,我如何编写一个代码,它在下面的 HTML 语句中使用经典 asp 中的响应写入语句?

<div id="the_div" style="border: 1px solid red"><iframe src=asp3.asp> <br><br></div>

<a href="#" onclick="hide('the_div');return false;">Hide the div until this link is click again.</a><br>

<a href="#" onclick="remove('the_div');return false;">Remove the div until this link is click again.</a>

我在下面尝试了但没有成功,是吧?

  response.write "<div id='the_div'><iframe src=asp3.asp> </iframe><br><br></div>"


  response.Write "<a href='#' onclick='hide('the_div');return false;">"Hide the div until this link is click again.</a><br>"

  response.Write "<a href='#' onclick='remove('the_div');return false;">"Remove the div until this link is click again.</a>"

【问题讨论】:

    标签: asp-classic


    【解决方案1】:

    如果您需要在 Response.Write 语句中转义双引号,请使用双引号,即

    Response.Write "<div id=""the_div"" style=""border: 1px solid red""><iframe src=""asp3.asp""> </iframe><br><br></div>"
    
    Response.Write "<a href=""#"" onclick=""hide('the_div');return false;"">Hide the div until this link is click again.</a><br>"
    
    Response.Write "<a href=""#"" onclick=""remove('the_div');return false;"">Remove the div until this link is click again.</a>"
    

    您可以像尝试那样使用单引号而不是双引号,但是如果您已经将它们与 JS onclick 事件一起使用,它开始看起来非常混乱,并且您可能会发现存在冲突

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多