首页 \ 问答 \ 如何使用jQuery去除HTML标签?(How to strip HTML tags with jQuery?)

如何使用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 to nginx/1.8.0. The problem is solved.

相关问答

更多
  • 您错误地连接到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.
  • 本世纪的愚蠢解决方案,显然在握手响应结束时有两个“\ 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

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)