Home  >  Article  >  Web Front-end  >  A simple and detailed explanation on the problem of text line wrapping in the alert pop-up window in js_Basic knowledge

A simple and detailed explanation on the problem of text line wrapping in the alert pop-up window in js_Basic knowledge

DDD
DDDOriginal
2016-05-16 17:46:452046browse

1. Pop-up window in js file:


<script type="text/javascript"> 
$(document).ready(function () { 
alert("Hello \r\n Javascript!"); 
alert("Hello \n Javascript!"); 
}); 
</script>


2. In. The js pop-up window spliced ​​in the background of the cs page

LiteralResult.Text = string.Format("<script>alert(&#39;添加成功!\ 您已选择赠送{0}(积分:{1}分)&#39;);location.href=http://www.hake.cc/kf/201111/&#39;VIPList.aspx&#39;</script>", strGift, jifen);



Please use "n"
If this is not possible, then " \n"
For example:


<script type="text/javascript">alert("hello \n world!");</script>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn