dhtml

Applying DIV/Span tag to a word by specific co-ordinates

早过忘川 提交于 2019-12-04 19:12:01
Sample HTML Data <body style="width:300px;"> <h3>Long-Text</h3> A simple tool to store and display texts longer than a few lines. The search button will highlight all the words matching the name of objects that are members of the classes listed in searchedClasses, itself a member of the KeySet class. The highlighted words are hypertext. Edit invokes wscripts/acedb.editor, which by default launches emacs. Edit that file to start another editor in its place. Save will recover from the emacs but will not destroy it. Read will read a text file, so you could Search it. **general** grep is a way to

Prototype plugin for dynamically expanding textarea

自作多情 提交于 2019-12-04 19:09:38
Does anyone know of a good plugin for prototype which allows textareas to automatically expand / contract based on how much text there is in them (e.g. a line is added the area gets bigger, a line is removed it gets smaller)? I need one thats free to use (e.g. some form of GPL type license). This uses Prototype: <textarea id='t1' cols="40" rows="7" style='overflow:hidden;font-size:14px;font-family:"Times New Roman", Times, serif'></textarea> <script type="text/javascript"> function activateResize(element) { Event.observe(element, 'keyup', function() { updateSize(element) }); updateSize(element

How to get complete HTML body using browser helper object (BHO) in case of DHTML/AJAX page?

余生颓废 提交于 2019-12-04 18:15:36
I'm writing a BHO that analyze the HTML taken from the 'onDocumentComplete' event of 'DWebBrowserEvents2' . Currently it works fine, unless I have a DHTML/AJAX page, where HTML handle is delivered too soon. For sample, I tried using it on 'http://www.google.com' . From the 'onDocumentComplete' event I can get most of the page but in the topmost link/anchors, the 'href' for maps, videos, orkut etc. is not available (normally it is javascript:void(0) ). Has anyone any ideas how to capture it when the page is fully loaded rather than just when the frame/body is loaded? Thanks, UPDATE It seems

Free-Form Date Picker - like RTM

纵然是瞬间 提交于 2019-12-04 16:58:09
I'm looking for a way to have a textbox that allows users to type in a date in any format and turns around and formats that date in a 'mm/dd/yyyy' format. So the user could type in "Today" and it would turn the date as 02/24/2009 or they could type in Wednesday Feb 24 and formatting would automatically pick up. Remember the Milk does this (but I believe server side). This is asp.net so I could do via ajax web service call but I would prefer to do this via Javascript. I'm looking for a general technique or existing library to help with this. Check out http://www.datejs.com/ 来源: https:/

Table to horizontal bar graph in jquery

孤人 提交于 2019-12-04 16:07:21
I have a table : 1-joe-234 2-bob-432 3-sean-654 I would like to take it and make a bar graph with it. Not that there is no lib on the net, but is prototype or flash xml file. -- The solution I am working on is a jquery plugin that will generate a html link for google chart... not pretty but KISS (really simple) and ugly. -- Here is one of my inspirations : http://www.dumpsterdoggy.com/articles/?jquery-horizontal-bar-graph This is entirely JavaScript, so if you have your data in other format you'll first have to convert to JS: <script type="text/javascript" src="http://ajax.googleapis.com/ajax

Creating a dynamic grid of divs with Javascript

☆樱花仙子☆ 提交于 2019-12-04 14:07:15
问题 I want to create a grid of HTML divs that will have the same number of rows and columns but with the number of rows/columns being based on a particular number that would be passed to the Javascript function. e.g. if the number is 3 the grid will be 3 rows and 3 columns if the number is 4 the grid will be 4 rows and 4 columns..etc in the case of 3 the outputted code would need to look something like: <div class="row"> <div class="gridsquare">1</div> <div class="gridsquare">2</div> <div class=

insertRow vs. appendChild

a 夏天 提交于 2019-12-04 05:13:40
Which method is preferred for adding a row to a table? var tr = tbl.insertRow(-1); or var tr = document.createElement('tr'); tbl.appendChild(tr); ? insertRow would be the much better. It is supported by grade A browsers and it's less verbose and a cleaner API. insertRow might be argued as more reliable since it's DOM[1]. The appendChild method is consistently faster (albeit marginally) across all tested browsers (IE6/7, FF3, Chrome2, Opera9) when operating outside of the DOM, but when trying to modify tables within the document (a more common endeavour) it's significantly slower . In other

IE is not submitting dynamically added form elements

浪子不回头ぞ 提交于 2019-12-04 03:05:37
I wrote some JavaScript to allow editing a list of items within an HTML form, including adding and removing items. Got it working in Firefox. When trying it in Internet Explorer, I found that any added items were not being submitted with the form. Long story short... lots of simplification, debugging, figured out what line is triggering IE to ignore the new form input. So the behavior problem is solved. But now I must ask: Why? Is this an IE bug? Here is the simplified code: <html> <head> <title>Test</title> <script type="text/javascript"> function add() { div = document.getElementById("mylist

文本滚动元素 marquee 研究报告

回眸只為那壹抹淺笑 提交于 2019-12-03 20:11:20
本文我在 CSDN 也发表过,地址是: http://blog.csdn.net/shanelooli/article/details/7611942 同样,在 ITeye 也发表过,地址是: http://surmounting.iteye.com/admin/blogs/1543868 不知道各位 JavaScript 开发者有没有关注过 W3C 在中国的官方教学网站: http://www.w3school.com.cn/ 此网站非常全面,并且内容也很完整丰富。不过今天不是广告时间,因为我发现了一个 FireFox, Chrome, IE, Safari 都能支持的某 HTML 标签,这个网站上竟然没有介绍! 那就是 <marquee> ,多么常用的文字滚动标签啊~接下来是我对此元素的分析结果,经考察公网上常见资料,已经很全了。 把 marquee 元素放入 FireBug 中观察,可以看到如下几个比较特别的属性和方法。 标签属性 behavior 滚动方式,有三种支持的值。 ="scroll" 按指定方向从空白开始滚动。一次滚动完毕后会追加空白,直至内容完全滚掉,然后从头开始第二次滚动,往复。 ="slide" 按指定方向从空白开始滚动一次并停止 ="alternate" 按指定方向滚动到头后转为反向滚动,二种方向交替 direction 滚动方向,有二种支持的值。 =

Replacing all children of a HTMLElement?

血红的双手。 提交于 2019-12-03 14:37:49
问题 In my code, I fairly frequently need to replace all children of a certain HTML container with a new list of children. What is the fastest way to do this? My current approach is collecting all new elements into a DocumentFragment. The only way I've found to then actually replace the children is to remove all the children one by one, and append the fragment. Is there no faster way? Note: the solution needs not be cross-browser, but should preferably not require 3d-party components such as