jquery子串函数 [英] jquery substring function

查看:61
本文介绍了jquery子串函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



i在我的代码中使用jquery。

i有一个字符串,其中包含< html> / 标签也。我想将原始字符串子串。在这样做时,它认为html / span标签也显示不正确的输出。有没有办法在使用子字符串时替换或避免这些标记?



谢谢

解决方案

< blockquote>原始字符串的来源是什么?是来自其他地方,还是使用 innerHTML 属性从网页本身提取它?



如果是 innerHTML 属性,则将其更改为 innerText (对于IE)和 textContent (对于其他浏览器)


hi all,

i am using jquery in my code.
i have a string which comtains <html>/ tags also. i want to substring the original string. while doing that it considers html/span tags also showing improper output. is there any way to replace or avoid these tags while using substring?

thanks

解决方案

what is the source of your original string ? Whether it is coming from another location, or you are extracting it from the web page itself using innerHTML attribute?

If its innerHTML attribute, then change it to innerText (for IE) and textContent (for other browsers)


这篇关于jquery子串函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆