随笔分类 - JS
摘要:;(function (window, document, ns, undefined) { var Node = function (data, parentNode) { this._childCount = 0; this.data = data; this.parentNode = pare
阅读全文
摘要:对比其它框架 Angular 选择 Vue 而不选择 Angular,有下面几个原因,当然不是对每个人都适合: 在 API 与设计两方面上 Vue.js 都比 Angular 简单得多,因此你可以快速地掌握它的全部特性并投入开发。 Vue.js 是一个更加灵活开放的解决方案。它允许你以希望的方式组织
阅读全文
摘要:$(function () { var test1 = function (args) { args.name = "lcc2"; args = { name: "lcc3" }; ...
阅读全文
摘要:var populatePullUpHtml = function (id) { var html = '\ 上拉加载更多...\ '; return html; }
阅读全文
摘要:public static void GenerateCanvas(string imgSaveName, int canvasWidth, int canvasHeight, string imgData) { try { if (string.IsNullOrEmpty(imgData)) return; if (imgData.StartsWith("data:image/png;base64") == false) return; ...
阅读全文
摘要:记录下: var newObj = fabric.util.object.clone(obj); decDoc.dropCanvas.add(newObj.set({ left: 0, top: 0 }));
阅读全文
摘要:var html = $("#summaryTemplate").html(); var imageMath = /]*(?=target-type=("|')replace("|'))[^/,]*\/>/; var scriptMath = /]*(?=target-type=("|')replace("|'))[^/,]*>/; var linkMath = /]*(?=target-type=("|')replace("|'))[^/,]*\/>
阅读全文
摘要:$(".step4TagList .albumShow", "#divStep4").delegate(" .abmFct .icoRt", "click", function () { alert("ok")});与 $(".step4TagList .albumShow .abmFct", "#divStep4").delegate(" .icoRt", "click", function () { alert(
阅读全文
摘要:LoadItems: function () { if (!options.itemDatas) return; tm.ReSortItems(options.itemDatas); $.each(options.itemDatas, function (i, itemData) { tm.AddImg(itemData); }); }, ReSortItems: function (it...
阅读全文
摘要:一直老忘记,备份下:var Index=list.indexOf(keyword);list.splice(Index, 1);
阅读全文
摘要:(function () { alert("222"); })();JS匿名方法。DecColorPicker.Properties.Resources.colorPicker);引用Dll中资源。(通过属性资源添加)
阅读全文
摘要://call function A() { name = "abc"; this.ShowName = function (val) { alert(name + "," + val); } } function B() { name = "def"; } var a = new A(); var b = new B(); a.ShowName.call(b, "123"...
阅读全文
摘要:Swfupload 在普通上传下,对于IE chrome firefox等有很好的兼容性。但一旦与其他控件组合,很容易出现无法上传,帮顶事件丢失的情况。例如Layer与Swfupload,上传一个正确文件(ok),再上传个错误文件提示错误(ok),再将swfupload关闭再显示后,swfupload无法上传(此问题只出现在IE,其他正常)。解决方法正在研究,结论:layer将初始化后包裹的swfupload 的外围删除,导致swfupload失效。。。。方案:layer.close后 destroy上传,layer后重新加载上传
阅读全文
摘要:$(function () { var queueList = [ function () { $("div").animate({ height: 80, top: 40 }, "fast", nextqueue); }, function () { $("div").animate({ height: 20, top: 100 }, "fast", nextqueue); }, function () { $("div").animate({ height: 40, ...
阅读全文
摘要:一般获取图片高度宽度的写法:var img = new Image();img.src = imgsrc;var imgWH = CalcImgTiple(img.width, img.height);但chrome中测试 无法获取到。img.width, img.height都为0原因:当图片不是本地图片,而是网络图片onload 在成功地装载了图像时调用的事件处理程序。在做web开发,其中有一个需求:利用Javascript获取要加载的图片的尺寸,所以很自然的,想到了img的onload方法,在firefox下开发完成后,到IE下调试,发现img的onload事件很多情况下都不被调用。最初
阅读全文
摘要:<td class="val"> <input type="hidden" id="List_UpMsg" /> <input type="hidden" id="List_AttachName" /></td>如果用 $.find(":text,textarea,:hidden") 将只会找到1个如果用 $.find(":text,textarea,input[type=hidden]") 2个都会找到。看
阅读全文
摘要:<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <script> $(function () { $("#hTest").click(function (ev) { //触发 aTest的 点击事件 $("#aTest").trigger("click"); ev.stopPropagation(); }); ...
阅读全文
摘要:客户端用javascript获取文件大小实现代码如下:<script type="text/javascript" language="javascript"> function getFileSize(fileName) { if(document.all)//判断是否是IE浏览器 { window.oldOnError = window.onerror; window.onerror = function(err) { if(err.indexOf('Automation')!=-1) { alert('没有访问文
阅读全文
摘要:var qq = {};qq.extend = function (first, second) { for (var prop in second) { first[prop] = second[prop]; }};qq.FileUploaderBasic = function (o) { this._options = { data: false, url: false, msg: { typeerror: "类型错误", sizeerror: "大小错误", maxfile: "限额错误" } }; qq.extend(this
阅读全文

浙公网安备 33010602011771号