当前位置: 代码迷 >> ASP.NET >> <script>alert换行,该如何解决
  详细解决方案

<script>alert换行,该如何解决

热度:8675   发布时间:2013-02-25 00:00:00.0
<script>alert换行
C# code
Response.Write("<script>alert('"+ 1 + "<br>" + 2 + "<br>" + 3 +"')</script>");

效果
http://img.my.csdn.net/uploads/201210/25/1351143008_9814.jpg
应该怎样实现

------解决方案--------------------------------------------------------
Refer:

C# code
string s = @"+ 1 + \n\r + 2 + \n\r + 3 +";        Response.Write("<scr" + "ipt>alert('" + s + "')</scr" + "ipt>");
------解决方案--------------------------------------------------------
Response.Write("<script>alert(\"1\\r\\n2\")</script>");
  相关解决方案