<(|申菲博娱乐平台黑钱吗这个怎样?知不知道它黑钱吗?|)&gt

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似乎已经做了,但我不知道如何。
解决方案 请参阅,并考虑(查看
本文地址: &
扫一扫关注官方微信读者&&人是什么&&
人是具有情感和理性智慧的高等动物!
为您推荐:
其他类似问题
扫描下载二维码

我要回帖

更多关于 新宝娱乐平台会黑钱吗 的文章

 

随机推荐