随笔分类 - 前端踩坑
摘要:function getURLParameter(name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1]....
阅读全文
摘要:Jquery UI Menu 默认是纵向展示的。Jquey UI Menu 设置API,http://api.jqueryui.com/menu/#option-position修改对应的CSS可以设置为横向展示。.ui-menu:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}.ui-menu .ui-menu-item { display: inline-block; float: left; ...
阅读全文
摘要:<button>get current</button>current tab: <span id="current"></span><div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li>
阅读全文
摘要:I'm searching for the answer for three days in a row already. The matter is that I have a page, links on which should load Colorbox with AJAX content that in its turn contains links that should be loaded in the same Colorbox modal window. So far I managed to make it work (partially) by this:<
阅读全文
摘要:$(document).ready(function () { $("a").each(function () { var textValue = $(this).html(); if (textValue == "XX概况" || textValue == "服务导航") { $(this).css("cursor", "default"); $(this).attr('href', '#'); //修改<a>的 href属性值为 # 这样状态栏不会
阅读全文
摘要:1.发帖回复如果没有积分提示的动画请单生成_pageheader.htm和showtopic.htm模版,问题解决.2.如果问题还没解决,检查_pageheader.htm模版下有无下面这段代码<script type="text/javascript"> var creditnotice='{Scoresets.GetValidScoreNameAndId()}'; var forumpath = "{forumpath}"; </script>如果没有就在{link}和<script type="
阅读全文
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb23
阅读全文
摘要:javascript禁用浏览器滚动条的方法相信网络已经有比较多的方案,这里就总结一下js禁用浏览器滚动的代码,当然修改一下也可以让去jquery达到一样的效果:很多人用document.body.scroll = "no";这样的方法是不符合W3C标准的,当然标准有时候没那么重要,能用即可。不过IE6以及更老版本是不支持的。禁用浏览器滚动条的解决方案:document.body.parentNode.style.overflow="hidden";//隐藏且禁用document.body.parentNode.style.overflow="s
阅读全文
摘要:1, 首先构建该JQuery教程实例中的index.html文件。代码如下:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>JQuery实例 - 生成年月日</title>
阅读全文
摘要:<script type="text/javascript"> $(document).ready(function() { $("input[name*='$txtReturnFile']").each(function(i, input) { $(input).bind("blur", function() { alert("bind successfully."); //TODO:some...
阅读全文
摘要:------解决方案--------------------------------------------------------试试把validate.js里的两行代码return $([]).add(this.currentForm.elements).filter(":input")改成return $([]).add(this.currentForm).find(":input")
阅读全文
摘要:1.打开thickbox.js 文件.2.搜索urlNoQuery找到如下代码:if(url.indexOf('TB_iframe') != -1){urlNoQuery = url.。。。之类把这里的 urlNoQuery句替换为:urlNoQuery=url;这是因为原文件中语句删除了url的所有参数,为了传递参数,必须使用原来的url。修改后的部分: if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window //urlNoQuery = url.split('T...
阅读全文
摘要:javascript的实现代码如下: function QueryString(fieldName) { var urlString = document.location.search; if(urlString != null) { var typeQu = fieldName+"="; var urlEnd = urlString.indexOf(typeQu); if(urlEnd != -1) { var paramsUrl = u...
阅读全文
摘要:限制用户输入不符合规范的数字与小数点导致不好计算价格问题,特整理了下面的代码,需要的朋友可以参考下。<html> <head> <title>text 数字</title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"> </head> <script type="text/javascript"> function check(event) { var e = win
阅读全文
摘要:如下html代码:<input id="rad" name="rad" type="radio" value="1"/><input id="rad" name="rad" type="radio" value="2"/><input id="rad" name="rad" type="radio" value="3"/>
阅读全文
摘要:在最近的项目中使用到了ajax来批量导入更新数据,第一次提交正常,后面提交同样的订单就有问题了。订单明明已经处理了,可是界面还是提示没有处理。
查找了下原因,原来是ajax的缓存问题造成。
解决方法如下:
阅读全文
摘要:javascript获取到textarea文本框中的字符串中,如果包含有回车换行符,在字符串中表现为“\n”,而不是我们通常所见的“\r\n”。
阅读全文
摘要:图片为本博客所有,代码来源: http://www.cnblogs.com/zengxiangzhan/archive/2009/11/13/1602397.html <!DOCTYPE htm...
阅读全文
摘要:JavaScript弹出新窗口居中显示 代码如下: <script language="javascript"> function openWin(u, w, h) { ...
阅读全文
摘要:ThickBox运行需要的文件 官方下载: Download thickbox.js or thickbox-compressed.js, ThickBox.css, and the loading graphic (loadingAnimation.gif) to your local machine (or cut and paste the code from the tabs). Alon...
阅读全文
