随笔分类 -  JavaScript+Jquery+AJax+Json

摘要:Server.UrlDecode();Server.UrlEncode();Server.HtmlDecode();Server.HtmlEncode(); 阅读全文
posted @ 2014-03-07 17:30 Seaurl 阅读(213) 评论(0) 推荐(0) 编辑
摘要:var panel = new Ext.container.Viewport({ items: { xtype: 'gridpanel', id: 'gridPanel', store: store, height: document.documentElement.clientHeight, columns: [ { header: "Id", hidden: true, flex: 1, sortable: false, dataIndex: '... 阅读全文
posted @ 2014-03-06 16:46 Seaurl 阅读(734) 评论(0) 推荐(0) 编辑
摘要:IE中:document.body.clientWidth ==> BODY对象宽度document.body.clientHeight ==> BODY对象高度document.documentElement.clientWidth ==> 可见区域宽度document.documentElement.clientHeight ==> 可见区域高度FireFox中:document.body.clientWidth ==> BODY对象宽度document.body.clientHeight ==> BODY对象高度document.documentEle 阅读全文
posted @ 2014-03-05 11:01 Seaurl 阅读(244) 评论(0) 推荐(0) 编辑
摘要:Ext.container.ViewportExt.panel.PanelViewport 它的布局会占用整个 body,也应该是这样,它会随着浏览器的高度和宽度的变化而变化。Panel 布局时需要提供一定的高度和宽度值,这个值是固定的,它不会随着浏览器的变化而变化。接下来,我来演示下,这两者布局的差异,也是我在工作时遇到的问题然后解决之:html:" %> 博客管理 Viewport:Ext.onReady(function () { Viewport();});function Viewport() { var v... 阅读全文
posted @ 2014-03-05 10:43 Seaurl 阅读(5564) 评论(9) 推荐(2) 编辑
摘要:function Ajax_GetCourseAndResource(data) { $(".ol-course-list").empty(); var html = ""; var len = data.Data.length; for (var i = 0; i ' + '' + data.Data[i].Title + '' + ' '; for (var j = 0; j ' + '' + data.Data[i]... 阅读全文
posted @ 2014-01-17 16:28 Seaurl 阅读(641) 评论(0) 推荐(0) 编辑
摘要:定义和用法decodeURI() 函数可对 encodeURI() 函数编码过的 URI 进行解码。语法decodeURI(URIstring)参数描述URIstring必需。一个字符串,含有要解码的 URI 或其他要解码的文本。返回值URIstring 的副本,其中的十六进制转义序列将被它们表示的字符替换。实例在本例中,我们将使用 decodeURI() 对一个编码后的 URI 进行解码:输出:http://www.w3school.com.cn/My%20first/http://www.w3school.com.cn/My first/ 阅读全文
posted @ 2014-01-16 10:26 Seaurl 阅读(771) 评论(0) 推荐(0) 编辑
摘要:function bootstrappage() { var options = { currentPage: currentPage, totalPages: totalPages, size: 'normal', itemContainerClass: function (type, page, current) { return (page === current) ? "active" : "pointer-cursor"; }, itemTexts: function (t... 阅读全文
posted @ 2014-01-14 17:02 Seaurl 阅读(594) 评论(1) 推荐(0) 编辑
摘要:首先在你的js文件里添加这段代码: /*** 日期时间格式化方法,* 可以格式化年、月、日、时、分、秒、周**/Date.prototype.Format = function (formatStr) { var week = ['日', '一', '二', '三', '四', '五', '六']; return formatStr.replace(/yyyy|YYYY/, this.getFullYear()) .replace(/yy|YY/, (this.getYear() % 阅读全文
posted @ 2014-01-08 15:41 Seaurl 阅读(205) 评论(0) 推荐(0) 编辑
摘要:作为“30 HTML和CSS最佳实践”的后续,本周,我们将回顾JavaScript的知识 !如果你看完了下面的内容,请务必让我们知道你掌握的小技巧!1.使用 === 代替 ==JavaScript 使用2种不同的等值运算符:===|!== 和 ==|!=,在比较操作中使用前者是最佳实践。“如果两边的操作数具有相同的类型和值,===返回true,!==返回false。”——JavaScript:语言精粹然而,当使用==和!=时,你可能会遇到类型不同的情况,这种情况下,操作数的类型会被强制转换成一样的再做比较,这可能不是你想要的结果。2.Eval=邪恶起初不太熟悉时,“eval”让我们能够访问Ja 阅读全文
posted @ 2013-12-12 09:06 Seaurl 阅读(180) 评论(0) 推荐(0) 编辑
摘要:我们可以用javascript获得其中的各个部分1,window.location.href全部URl字符串(在浏览器中就是完整的地址栏)本例返回值:http://www.x2y2.com:80/fisker/post/0703/window.location.html?ver=1.0&id=6#imhere2,window.location.protocolURL的协议部分本例返回值:http:3,window.location.hostURL的主机部分本例返回值:www.x2y2.com4,window.location.portURL的端口部分假如采用默认的80端口(update 阅读全文
posted @ 2013-12-05 08:31 Seaurl 阅读(548) 评论(0) 推荐(0) 编辑
摘要:如果你还在为 ajax 调用 .net 类库还束手无策的话,相信这篇博客将帮助你解决这个世纪问题!因为Visual Studio 内置了asp.net mvc ,不过当你添加asp.net mvc项目时,你会发现,controller,model和views放在同一个根目录下,就像这样:图一:所以当我把根目录下的controlelr,model删除,另建两个类库,controller,model这样更方便操作,如图二:因为是学习asp.net mvc,所以这样的方式是根据《ASP.NET 设计模式》的,有兴趣的朋友可以买来看看,非常好的一本书!图三:虽然我这样做的,但是出现了一个问题,就是vi 阅读全文
posted @ 2013-12-04 17:20 Seaurl 阅读(391) 评论(0) 推荐(0) 编辑
摘要:var downloadarray = new Array(); //是否要下载的数组(保存的是是否要下载文件,isflag=true)Array.prototype.indexOf = function (val) { for (var i = 0; i -1) { this.splice(index, 1); }};//删除数组元素 mydata = { action: 'SaveUpgradeMachine', jqid: selectmachine[0].JqId, ... 阅读全文
posted @ 2013-12-02 14:24 Seaurl 阅读(196) 评论(0) 推荐(0) 编辑
摘要:var height = document.body.scrollHeight; parent.document.all("rightFrame").style.height = height; parent.parent.document.getElementById('contentFrame').style.height = height + 100; 阅读全文
posted @ 2013-11-15 17:38 Seaurl 阅读(221) 评论(0) 推荐(0) 编辑
摘要:后台:using System;using System.Collections.Generic;using System.Linq;using System.Reflection;using System.Web;using System.Web.Script.Serialization;using HotelCheckIn_PlatformSystem.DataService.BLL;using HotelCheckIn_PlatformSystem.DataService.Bll;using HotelCheckIn_PlatformSystem.DataService.Dal;usin 阅读全文
posted @ 2013-11-15 09:14 Seaurl 阅读(404) 评论(0) 推荐(0) 编辑
摘要:1 function remotecontrol() { 2 var progressbar = $("#progressbar"); 3 $.ajax({ 4 url: myurl, 5 type: mytype, 6 data: mydata, 7 contentType: commonType, 8 dataType: jsonType, 9 success: function (data) {10 var ret = data.d.replace(/... 阅读全文
posted @ 2013-10-10 09:52 Seaurl 阅读(1063) 评论(0) 推荐(0) 编辑
摘要:1、结构BOM是Browser Object Model的缩写,简称浏览器对象模型BOM提供了独立于内容而与浏览器窗口进行交互的对象由于BOM主要用于管理窗口与窗口之间的通讯,因此其核心对象是windowBOM由一系列相关的对象构成,并且每个对象都提供了很多方法与属性BOM缺乏标准,JavaScript语法的标准化组织是ECMA,DOM的标准化组织是W3C(WHATWG,WebHypertextApplicationTechnologyWorkingGroup——网页超文本应用程序技术工作组目前正在努力促进BOM的标准化)BOM最初是Netscape浏览器标准的一部分结构图如下:2、BOM的作 阅读全文
posted @ 2013-09-30 17:25 Seaurl 阅读(825) 评论(0) 推荐(0) 编辑
摘要:var date = new Date(); var months = new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"); var year = date.getFullYear(); var month = months[date.getMon 阅读全文
posted @ 2013-09-29 11:04 Seaurl 阅读(174) 评论(0) 推荐(0) 编辑
摘要:jslever 阅读全文
posted @ 2013-09-27 16:53 Seaurl 阅读(318) 评论(0) 推荐(0) 编辑
摘要:最近在做项目时用到了定时执行的js方法,setInterval与setTimeout时间长了不用有些生疏了,所以自己总结了一下,记下来,以便以后使用。Document自带的方法:循环执行:var timeid = window.setInterval(“方法名或方法”,“延时”);window.clearInterval(timeid);定时执行:var tmid = window.setTimeout(“方法名或方法”, “延时”);window.clearTimeout(tmid);举例说明:A.当要执行的方法中不需要参数时复制代码代码如下:B.当要执行的方法中需要参数时复制代码代码如下: 阅读全文
posted @ 2013-09-27 14:57 Seaurl 阅读(345) 评论(0) 推荐(0) 编辑
摘要:JavaScript创建类/对象的几种方式在JS中,创建对象(Create Object)并不完全是我们时常说的创建类对象,JS中的对象强调的是一种复合类型,JS中创建对象及对对象的访问是极其灵活的。JS对象是一种复合类型,它允许你通过变量名存储和访问,换一种思路,对象是一个无序的属性集合,集合中的每一项都由名称和值组成(听起来是不是很像我们常听说的HASH表、字典、健/值对?),而其中的值类型可能是内置类型(如number,string),也可能是对象。一、由一对大括号括起来varemptyObj={};varmyObj={'id':1,//属性名用引号括起来,属性间由逗号隔 阅读全文
posted @ 2013-09-25 17:24 Seaurl 阅读(238) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示