您的位置:首页 > Web前端 > JQuery

jQuery - Utilities实用工具 - trim去掉字符串前后的空格

2007-10-28 18:10 766 查看

jQuery - Utilities实用工具 - trim去掉字符串前后的空格

[trim去掉字符串前后的空格示例]

<html>
<head>
<script src="jquery-1.2.js"></script>
<script>
var str = " lots of spaces before and after ";
alert("'" + str + "'");
str = $.trim(str);
alert("'" + str + "' - no longer");
</script>
</head>
</html>

[trim去掉字符串前后的空格文档]

http://docs.jquery.com/Utilities/jQuery.trim

[jQuery官方网站]

http://jquery.com/

[jQuery当前版本]

http://docs.jquery.com/Release:jQuery_1.2

[jQuery其他下载地址]

下载列表, http://docs.jquery.com/Downloading_jQuery 最新代码, http://code.jquery.com/nightlies/jquery-nightly.js

[jQuery相关论坛]

http://groups.google.com/group/jquery-en
http://WebDev.board.newsmth.net/
http://WebGeeks.board.newsmth.net/
http://bbs.pku.edu.cn/, homepage看版
http://forum.csdn.net/SList/JavaScript/

[jQuery关键词]

jQuery

[jQuery - Core核心]

each迭代, http://docs.jquery.com/Core/each

[jQuery的Ajax]

jQuery的Ajax文档, http://docs.jquery.com/Ajax/jQuery.ajax jQuery的Ajax选项,http://docs.jquery.com/Ajax/jQuery.ajax#options
dataType选项,设置返回值类型
timeout选项,用于设置超时
与PHP集成可以使用json_encode返回结果, http://www.php.net/manual/zh/function.json-encode.php

[jQuery特效]

jQuery淡入特效,http://docs.jquery.com/Effects/fadeIn

[jQuery - Selectors选择器]

表单元素选择器, http://docs.jquery.com/DOM/Traversing/Selectors#Form_Selectors 属性相等选择器,http://docs.jquery.com/Selectors/attributeEquals
checked选中, http://docs.jquery.com/Selectors/checked 选择器在选择body中出现的title标记时,会出现和预期不同的效果。

[jQuery常用函数]

attr访问自定义属性,减少javascript脚本中代码和数据的耦合
click, 绑定元素的onclick事件,http://docs.jquery.com/Events/click
filter, 用于在集合中过滤元素

[jQuery - Events事件]

hover, http://docs.jquery.com/Events/hover submit提交, http://docs.jquery.com/Events/submit

[jQuery - Traversing遍历器]

filter过滤, http://docs.jquery.com/Traversing/filter find查找, http://docs.jquery.com/Traversing/find

[jQuery - Tutorials教程]

Introducing $(document).ready(), http://docs.jquery.com/Tutorials:Introducing_%24%28document%29.ready%28%29

[jQuery - plugins插件]

Easing动画, http://jquery.com/plugins/project/easing jCarouseLite, 走马灯效果, http://jquery.com/plugins/project/jCarouselLite tableFilter, 表过滤器, http://jquery.com/plugins/project/tableFilter

[jQuery - Utilities实用工具]

trim去掉字符串前后的空格, http://docs.jquery.com/Utilities/jQuery.trim

[jQuery重要工具]

http://www.json.org/, http://www.json.org/json.js

[jQuery - 综合实例]

实现前一个和后一个效果
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: