<(|北京赛车投注平台官网在网怎么注册|)>

mysql-如何在textarea输入的内容,每段都被&p&&/p&包裹起来?
如何在textarea输入的内容,每段都被&p&&/p&包裹起来?
我是一个粉刷匠
输入完后转成:
'&p&'我是一个粉刷匠'&/p&'
'&p&'大家好'&/p&'
'&p&'啦啦啦'&/p&'
js替换下就好了,入库的时候存储替换过的
&textarea id="ta"&&/textarea&
&br /&&input type="button" value="输入完毕" onclick="replaceText()" /&
function replaceText() {
var v = document.getElementById('ta').value.replace(/r/g, '');
if (v != '') {
v = '&p&' + v.replace(/n*$/g, '').replace(/n/g, '&/p&&p&') + '&/p&';
解决方案二:
可以用富文本编辑器实现,具体可以看看ueditor.
解决方案三:
不明白你的需求。既然是textarea输入框,为什么又需要用html的p标签包裹呢?这是两个不同的html元素,怎么能交叉呢?
解决方案四:
$arr = explode(PHP_EOL, $content);
$result = array();
foreach ($arr as $v) {
$result[] = '&p&' . $v . '&/p&;
echo implode('', $result);Shouldn't a browser's textarea display raw text? Look at the following snaps from , and pay attention to the &script& tag:
1- We can see the angled brackets around the script word:
2- Now look at the source of the page. We can see the angled brackets are represented by their HTML entities:
3- Click to edit the post and you'll see that the angled brackets are visible in the textarea--NOT their HTML entities:
4- Look at the XHR response from the server (when we clicked edit), we can see the HTML entities and NOT the angled brackets we see in the textarea:
How is it possible that the textarea--when editing the post--displays the angled brackets and not their HTML entities? Shouldn't textareas display raw text? I tried this on my site, and the textarea shows the HTML entities, and not brackets, with identical source code.
The post page also shows the angled brackets even when they are inside code and pre tags. Shouldn't they be output as raw text too? I also tried this on my site, and the page shows the HTML entities, and not the angled brackets.
What I am missing here?
I'm asking because struggling with implementing a feature on my site. I want to show people the encoded entities when they go to edit something, but I want to store a raw version. SO seems to have done, but I have no idea how.
解决方案 See
and consider
in HTML (take a peek at the
although do note it is insufficient to entirely describe HTML).
The script (and style) elements have such a CDATA designation while textarea does not. Store the data as it ("unescaped") but make sure to HTML-encoded outside of CDATA sections in the HTML (and even inside, take care to guard against terminators like &/anything -- the & and / characters must be separated to be entirely legal in HTML). See
for some more details.
Happy coding.
本文地址: &
浏览器的textarea是否应显示原始文字?查看,并注意& script& 标记:
1-我们可以看到围绕脚本字的尖括号:
2-现在看一下页面的源代码。我们可以看到尖括号由它们的HTML实体表示:
3-单击以编辑帖子,您会看到尖括号可见textarea
- 不是其HTML实体:
4-看看服务器的XHR响应(当我们点击编辑)可以看到HTML实体,而不是我们在textarea中看到的尖括号:
- 显示尖括号而不是它们的HTML实体?应该不是textareas显示原始文本?我尝试在我的网站上,并且textarea显示HTML实体,而不是括号,具有相同的源代码。
帖子页也显示了尖括号,即使他们是代码和 pre 标签。它们不应该作为原始文本输出吗?我也在我的网站上试过这个,页面显示的是HTML实体,而不是尖括号。
这里缺少什么?
我问,因为在我的网站上实现一个功能。我想在编辑实体时向他们显示编码实体,但我想存储一个原始版本。 SO似乎已经做了,但我不知道如何。
解决方案 请参阅,并考虑(查看
本文地址: &
扫一扫关注官方微信网站页面信息
网站标题:
网站简介:
SEO基本信息
#:百度权重 BR: | PR: | sogou SR: | baidu收录:3
| baidu快照:
| 百度索引量:3 |
| google收录:0
| sogou收录:0
| soso收录:0
| 360收录:1
| bing收录:0
| 服务器站点: | Alexa排名:- | Alexa Link: | Dmoz: | 网站年龄:2年 | whois:
页面优化分析
文件大小76.9KB,下载速度120.201毫秒;页面H3标签11个,H2标签3个,未检测到frame/frameset/iframe等Frame信息,符合baidu的建议;内部javascript有14个,建议进行合并跟压缩;外部javascript有6个,是否可以进行合并?可以减少dns的请求次数;Img标签101个,有alt描述的1个,alt简要的文字说明也是页面优化的一部分;
Alexa排名及流量
平均停留时间(s)
访问一个页面(%)
搜索引擎流量(%)
域名基本信息
Whois服务:
域名状态:
注册时间:
T01:39:43Z
到期时间:
T01:39:43Z
域名注册商:
HICHINA ZHICHENG TECHNOLOGY LTD.
DNS服务器:
F1G1NS1.DNSPOD.NET,F1G1NS2.DNSPOD.NET
发表对该站点的评论
与www.kdzx.cc相类似站点
网站性能测试(pagespeed)
Copyright (C) 2012 闽ICP备号整除&练习题&_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
整除&练习题&
阅读已结束,下载文档到电脑
想免费下载本文?
定制HR最喜欢的简历
你可能喜欢}

我要回帖

更多关于 北京赛车pk10官方网站 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信