Browse by Tags

All Tags » JavaScript (RSS)

How Current Display Html for Runtime Preview by jawance

如何运行时预览html 页面内容 1。使用控件的xx.innerHTML 进行负值。 2。还可以使用IFrame <IFram sc="blank" .....> 近段时间要开发用户实时编辑的HTML格式编辑器,还要在IE上面预览;然后采用了FreeTextBox 这个免费控件 发觉里面使用预览上面挺好的。拷贝里面的代码出来看看 A : iframe.document.body.innerHTML = this.StoreUrls(html); B : iframe.document.open(); iframe.document.write("<html>" + "<head>" + ((this.designModeCss != '' && FTB_Browser.isGecko) ? "<style type='text/css'>@import url(" + this.designModeCss + "...
Filed under:

How Let overstep textbox or input area character hidden by jawance

如何让超出文本框长度的字符自动隐藏 <div> 自动隐藏超过长度的字段,鼠标移动上去显示完整的信息<br /> <table border="1"> <tr title="ID: 697443 Created: 2007-03-06 14:38:00 PM Created By: jawance_du_gy Modified: 2007-04-17 14:49:51 PM Modified By: johnking_zhang_k" class="sgvDataRow" > <td class="sgvDataCell" align="right" style="display: none;"> 697443 </td> <td class="sgvDataCell" align="right" style="display: none;">...
Filed under:

Wrong Way Get Session Value by open or showModelessDialog by jawance

step 1 : Click 'Click Me button' Open Window by Windows.showModelessDialog||showModalDialog or Windows.open , and Defalut Set Session['test'] value. step 2 : Click 'Click Me2 button' if showModelessDialog||showModalDialog ==> window.open then in Default3 page ,Session['test'] is null if showModelessDialog||showModalDialog ==> window.showModelessDialog||showModalDialog then in Default3 page ,Session['test'] is get successfully value = select * from bs_unit...
Filed under:

IE post new value to anther IEwindows by JavaScript and WinObj by jawance

open a IE window , double check cost centre, then input new value ,and save . pop window close ,then pass new value to IE window.
Filed under:

Html Page Handle Error Good Solution. by jawance

Extracting error information Simply knowing that an error occurred is of little use to a programmer without the error details. Fortunately, the onerror event handler provides three pieces of information to identify the exact nature of the error: ❑ Error message — The same message that the browser would display for the given error ❑ URL — The file in which the error occurred ❑ Line number — The line number in the given URL that caused the error This information is passed as three parameters into the...
Filed under:

一般javascript 判断objcet 是否可以使用的误区 by jawance

一般javascript 判断objcet 是否可以使用的误区 if (typeof(Admin_Default) == "undefined") 如果这个值是 true 的话。 if (Admin_Defalut == null) 判断会出错的 , 因起最好的判断是 if (typeof(Admin_Default) == "undefined") == true 就不必要再判断 Admin_Defalut==null 反过来,如果不判断是否"undefined"而直接 判断 if (Admin_Defalut == null) 是错误的做法哦。 最好的是这样... function selfToBeExecute() { if (typeof(Admin_Default) != "undefined" && Admin_Default !=null) { divUseFullLink.outerHTML =Admin_Default.GetHtmlTable("").value;...
Filed under:

没见过这么长的JS代码 by jawance

function TinyMCE_Engine() { var ua; this.majorVersion = "2"; this.minorVersion = "1.1.1"; this.releaseDate = "2007-05-14"; this.instances = []; this.switchClassCache = []; this.windowArgs = []; this.loadedFiles = []; this.pendingFiles = []; this.loadingIndex = 0; this.configs = []; this.currentConfig = 0; this.eventHandlers = []; this.log = []; this.undoLevels = []; this.undoIndex = 0; this.typingUndoIndex =- 1; this.settings = []; ua = navigator.userAgent; this.isMSIE...
Filed under:

用HTC文件,为按钮添加 link 和 target 属性 by jawance

用HTC文件,为按钮添加 link 和 target 属性 做WEB程序的时候经常需要用一个按钮来跳转到一个页面,或打开新窗口;由于按钮没有link属性,所以经常要写脚本来控制,感觉有些麻烦,最近看了一些关于HTC的文档,发现HTC可以为按钮添加属性,所以就写了个例子。 文件:test.htm <link href="style.css" rel="stylesheet" type="text/css"> <input type=button link="http://www.sina.com.cn" value="打开新浪"> <input type=button link="http://www.sina.com.cn" value="新窗口打开新浪" target="_blank"> 文件:style.css Input{behavior:url('input.htc');...
Filed under:

三句标准的Dynamic Html 创建进度条 by jawance

<HTML> <HEAD> <TITLE>Recalc Example</TITLE> <STYLE> BUTTON {font-size:14;width:150} </STYLE> <SCRIPT> var timerID = null; var seconds = 0; // // This function is called when the page loads. // It sets up a couple of expressions. // function init() { A.style.setExpression("width","seconds*10"); B.setExpression("innerText","seconds.toString()"); } // // This function gets calls once a second and updates the seconds /...
Filed under:

JavaScript浮点运算的问题 by jawance

2007-05-30 10:33:14 作者: 梦想年华 浏览: 7 评论: 0 条 字号:【 大 】【 中 】【 小 】 评分:0 RSS 最近在做一个工资核算的系统,所有的运算全部在前台进行,因此用了的是JS来做。 做完以后,经手工核算,发现一个奇怪的问题。就是JS算出来的结果跟用计算器算出来的结果有差距。 想了很久,也没有想出问题出在哪里。 问题这样的: 37.5*5.5=206.08 (JS算出来是这样的一个结果,我四舍五入取两位小数) 我先怀疑是四舍五入的问题,就直接用JS算了一个结果为:206.08499999999998 怎么会这样,两个只有一位小数的数字相乘,怎么可能多出这么小数点出来。 我Google了一下,发现原来这是JavaScript浮点运算的一个bug。 比如:7*0.8 JavaScript算出来就是:5.6000000000000005 网上找到了一些解决办法,就是重新写了一些浮点运算的函数。 下面就把这些方法摘录下来,以供遇到同样问题的朋友参考: //除法函数,用来得到精确的除法结果 //说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显...
Filed under:

WebResource.axd里面的数据Js 数据,有些奥妙在里面.ajax的原来版本 by jawance

function WebForm_PostBackOptions(eventTarget, eventArgument, validation, validationGroup, actionUrl, trackFocus, clientSubmit) { this.eventTarget = eventTarget; this.eventArgument = eventArgument; this.validation = validation; this.validationGroup = validationGroup; this.actionUrl = actionUrl; this.trackFocus = trackFocus; this.clientSubmit = clientSubmit; } function WebForm_DoPostBackWithOptions(options) { var validationResult = true; if (options.validation) { if (typeof(Page_ClientValidate) ==...
Filed under: ,

javascrpt出现脚本溢出,内存不足一般都可以参考一下 by jawance

A 问题 1, 以及解决办法 出现这个问题是因为 javascript 浪费用户的内存空间,没有回收造成。 例子. 改正办法 A2 同样的问题, --------- 处理办法,以下。 B 问题 2 , 请 检测每个报表里面脚本是否有 “;”结束了。 有个附件。
Filed under: