Home > Web Front-end > JS Tutorial > body text

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

DDD
Release: 2024-04-07 15:18:46
Original
2046 people have browsed it

1. Pop-up window in js file:


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


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);
Copy after login



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


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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template