如何使用jQuery去除HTML标签?(How to strip HTML tags with jQuery?)
我想从字符串中删除HTML标签。 例如假设我们有字符串:
<p> example ive got a string</P>
如何编写一个删除
<p><p>
的函数,并返回“example ive has a string”?I want to remove HTML tags from a string. For example assume we have the string:
<p> example ive got a string</P>
How can I write a function that removes the
<p><p>
and returns just "example ive got a string"?
原文:https://stackoverflow.com/questions/13140043
更新时间:2024-01-06 15:01
最满意答案
Ubuntu上的默认nginx版本是
nginx/1.1.19
。 我将其更新为nginx/1.8.0
。 问题已经解决了。Default nginx's version on Ubuntu was
nginx/1.1.19
. I updated it tonginx/1.8.0
. The problem is solved.
相关问答
更多-
棘轮WebSocket(失败:WebSocket打开握手超时)(Ratchet WebSocket (failed: WebSocket opening handshake timed out))[2022-05-05]
您错误地连接到websocket。 websocket不仅仅是您连接的文件,它必须是自己的进程。 在命令行运行中,导航到RatchetWebSocketServer.php存储和运行的目录 php RatchetWebSocketServer.php 然后在javascript连接到127.0.0.1:8888并且WebSocket应该工作。 不要忘记每次更改WebSocket代码时都需要停止php xx命令并重新启动它。 You are connecting to your websocket incor ... -
Ubuntu上的默认nginx版本是nginx/1.1.19 。 我将其更新为nginx/1.8.0 。 问题已经解决了。 Default nginx's version on Ubuntu was nginx/1.1.19. I updated it to nginx/1.8.0. The problem is solved.
-
WebSocket握手不起作用(WebSocket handshake not working)[2022-03-28]
本世纪的愚蠢解决方案,显然在握手响应结束时有两个“\ r \ n”换行符。 Dumb solution of the century, apparently two "\r\n" newlines are expected at the end of the handshake response. -
完成! 从http://blog.honeybadger.io/building-a-simple-websockets-server-from-scratch-in-ruby/找到答案,它的工作完美! 代码: public ClientSocket(Socket socket) { try { this.socket = socket; this.input = new BufferedReader(new InputStreamReader(socket.getI ...
-
我终于找到了问题所在。 我使用nginx前端服务器作为代理。 由于一些奇怪的原因,该服务器的默认配置阻止了我的wss。 I finally found where the problem was. I was using an nginx front server as a proxy. The default configuration of that server was blocking my wss for some weird reason.
-
服务器违反了WebSocket协议。 Chrome很可能在版本20中更加正确地遵守该标准,并且揭示了服务器中的错误。 问题在于服务器在响应中发回“Sec-WebSocket-Protocol”头,但这只有在客户端在请求中发送相同头时才合法。 如果客户端没有发送Sec-WebSocket协议,那么服务器应该在响应中省略标题。 请参阅rfc6455第4.2.2节中的第22页上的/ subprotocol / description The server is violating the WebSocket pr ...
-
我已经把它整理出来了 - 当有连接时我发送它,但这是在握手被发送之前。 所以我在做: client connected send message receive handshake request send handshake response ... 我只是在发送握手时触发了我的库的connect事件,这是在确实建立了WebSocket连接的时候改变了我的代码。 作为旁注,我想提一下,调试WebSocket连接时,chrome:// net-internals /是一个非常有用的页面(您可以轻松查看请求 ...
-
我找到了解决问题的可能方法。 通过Eclipse,我可以将Java项目Export到一个可运行的jar(将库“打包”到jar中)。 然后使用java -jar
运行它将在服务器上运行,并且与本地计算机上的功能相同。 但是,我注意到一些性能问题(启动缓慢),所以我不认为这是最好的解决方案,但它是一个解决方案。 I figured out a possible solution to my problem. Through Eclipse, I can Export the Java ... -
WebSocket规范(RFC6455) 要求兼容的客户端在每个连接上生成随机密钥。 强制要求特定密钥的服务器不符合规范。 AutobahnAndroid中没有挂钩来设置特定的密钥(我们不会添加这样的东西)。 请修复您的服务器或使用合规的服务器。 您可以在此处找到用于生成新闻密钥的代码。 The WebSocket spec (RFC6455) requires a compliant client to generate a random key on each and every connection. ...
-
你不应该用钥匙回答吗? 尝试在响应中添加Sec-WebSocket-Accept:sha1(Sec-WebSocket-Key +魔术字符串) shouldn't you respond with the key? try to add Sec-WebSocket-Accept: sha1(Sec-WebSocket-Key + magic string ) on your response