在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>"
答案 0 :(得分: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事件一起使用,那么它开始变得非常混乱,您可能会发现存在冲突< / p>