2006年12月06日

经常在网页上看见“复制本页网址,给你的朋友分享”之类的话,点按钮,在IE下能复制成功,而在firefox和opera等其他浏览器就不行
下面的例子使用flash(as)+javascript实现了在不同浏览器里复制的功能,这样做的好处就是规避了浏览器兼容的问题。也就是说支持firefox,IE,OPERA

看演示:用firefox和ie分别测试
点这个页面最下面的复制按钮,然后粘贴在QQ,或者MSN等文本框内

怎样使用?
1.先下载这个FLASH文件:下载,右键另存

2.代码如下:
<html>
<head>

<title>用flash+javscript实现网页上的文本复制</title>

</head>
<body>
<script type="text/javascript" language="javascript">
function copyit(textit) {
if (window.clipboardData) {
window.clipboardData.setData("Text",textit);
} else {

var flashcopier = ‘flashcopier’;
if(!document.getElementById(flashcopier)) {
var divholder = document.createElement(‘div’);
divholder.id = flashcopier;
document.body.appendChild(divholder);
}
document.getElementById(flashcopier).innerHTML = ”;
var divinfo = ‘<embed src="_clipboard.swf" FlashVars="clipboard=’+textit+’" width="0" height="0" type="application/x-shockwave-flash"></embed>’;
document.getElementById(flashcopier).innerHTML = divinfo;
}
}
//copyit("")

</script>
<input type="text" value="用flash+javscript实现网页上的文本复制" id="g">
<a href="javascript:copyit(document.getElementById(‘g’).value);">复制一下</a>
</body>
</html>

2006年08月16日
  1. Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell
  2. AJAX – microlink pattern tutorial : A microlink is a link that opens up content below it.
  3. Ajax BBC News RSS Reader : demo by Nigel Crawley
  4. AJAX Chat in Python with Dojo : at AquaAjax
  5. Ajax Chess : multiplayer chess
  6. Ajax examples at BackBase : examples demonstrating several aspects of the Backbase technology.
  7. Ajax examples at Rico : Inner HTML, JavaScript updater etc.
  8. Ajax examples using ColdFusionMX, SQLServer, SOAP : Contact Manager, NOAA 7 Day Forecast code and demos.
  9. Ajax Feed TV : News feed
  10. Ajax inline dictionary : Highlight any text on this site then right click. A tooltip containing the definition of the selected word should show up.
  11. Ajaxload : Ajax loading gif generator.
  12. Ajax Login Demo : Creating a secure login system using XMLHttpRequest
  13. Ajax Newsletter Signup : A newsletter signup form that shows Thank You on the same page.
  14. ajaxProject : Project Management applicaiton with rich UI
  15. Ajax Rater : A star rating system that uses Ajax.
  16. AJAX-S : An Ajax-based slideshow system.
  17. AJAX Spell Checker : spell check text / form content.
  18. Ajax Toolbox : Tools for the Ajax Developer
  19. Amazon Catalog Tree : Amazon Catalog Tree
  20. Amazon Zuggest : Amazon product suggestion (like google suggest)
  21. Askeet by symfony : Digg-like AJAX interactions; open source
  22. Backbase – Ajax Demos : Ajax demos at BackBase
  23. Basic Ajax Examples : Ping, track changes, drop down, Google suggest hack etc at Clearnova
  24. Behaviour : Fading lists, Sortable lists, Dropout boxen, Shaky lists
  25. chat.app : ajax chat
  26. Chihuahua Word Puzzle : daily word puzzles
  27. Coloir : Ajax Slideshow
  28. DHTML arcade/action games : a collection that demonstrate the power of DHTML
  29. DomAPI : Windows Desktop, Outlook-like, RSS Reader
  30. Drag and Drop Shopping Cart Demo : at CyberDummy
  31. Easy AJAX inline text edit 2.0 : edit a piece of text inline
  32. FileChucker : File upload and progress bar at Encodable.com
  33. Gmail Style Check Username AJAX Demo : at CyberDummy
  34. Google Web Toolkit Example Projects : Hello World, Dynamic Table, Desktop App Clone etc
  35. GreyBox : Pop up window using idea of light box.
  36. FiftyFourEleven: Ajax Examples
  37. IntuiCat – ajax Catalogue : Ajax-based Catalogue Demo
  38. jsLINB programming demos : LINB(Lazy INternet and Browser)
  39. JSlog : Ajax logging tool.
  40. JS/UIX Unix Shell : JS/UIX is an UN*X-like OS for standard web-browsers, written entirely in JavaScript.
  41. Lace : free web chat application
  42. Lightbox : simple, unobtrusive script used to overlay images on the current page.
  43. Leightbox : Light Box with inline div’s instead of AJAX calls.
  44. Live Quote Demo : Simple way of creating an updating stock quote table in ajax.
  45. Magnetic Poetry : drag and drop poetry
  46. Metatron Chat Engine : PHP/MySQL/JavaScript powered chat engine
  47. Monket Calendar : online calendar
  48. Multi List Drag Drop Demo : at CyberDummy
  49. NetDirector : open and extensible framework for managing configurations of common open source network services.
  50. nexImage : Image processing demo
  51. Opera Platform : Enabling AJAX applications on mobile phones
  52. Orbeon examples : various examples illustrating the capabilities of OPS, from the OPS Tutorial examples to XForms examples
  53. OVO Suite : Online Virtual Office : virtual office limited demo
  54. phpFreeChat : php Free Chat
  55. S5: A Simple Standards-Based Slide Show System : S5 is a slide show format based entirely on XHTML, CSS, and JavaScript.
  56. script.aculo.us Reflector : image reflector script that uses uses opacity-based fades
  57. Slider Bar Demo : at CyberDummy
  58. SmallestAjax : Smallest Ajax example in the world?
  59. Spell Check demo : by Primal Grasp
  60. Super Maryo World : Japanese game demo
  61. Tacos : Tacos provides a library of useful Tapestry components. This application provides some examples to get you started.
  62. theList : to-do list / bug-tracker
  63. ThickBox : ThickBox is a Lightbox than can show html pages as well as images.
  64. Tooltip.js : Tooltip.js is a simple class to make it possible to add tooltips to your page.
  65. Treehouse Chat : ajax chat
  66. Tudu Lists : open-source to-do lists
  67. WeBoggle : Ajax Boggle
  68. XHTML live Chat : ajax chat
  69. YahooSearchAsYouType : Yahoo search as you type
  70. ZK Demo : demo programs for various components
2006年07月15日

<script language="javascript" type="text/javascript">

function closeWindow() {

window.open(”,’_parent’,”);

window.close();

}
</script>

引用:<a href="javascript:closeWindow();">Close</a>

2006年05月17日

PAWA同学的要求,我GOOGLE了一下资料,改吧了一下,支持FF,IE,,opera,其他browser去没试.
如果只是页面上非FORM中元素的SELECTED,就没那么复杂,看这个:http://www.quirksmode.org/js/selected.html


测试一下


代码:




2006年03月23日

作者站点链接;
http://pro.html.it/niftycube/

例子:
http://pro.html.it/niftycube/nifty2.html

在做WEB设计的时候,,一般遇见圆角效果都用图片来实现.其实也可以用css+javascript实现
至于直接用圆角图片,,还是用JAVASCRIPT+CSS来模拟圆角效果,,那个更好,个人认为用图片来的简单一点,从代码量和圆角图片大小的对比来说,,也是图片小很多,,不过用JS也有好处,,就是不会PS的人可以偷懒,还有写成通用的类,可以随时引用
有兴趣的人可以从这个效果的JS和CSS,学到不少东西
作者说;:
Now, Nifty Corners are fully supported also
in Internet Explorer 5.5, covering a very wide range of modern
browsers: the examples that we’ll see in this article have been
successfully tested
in IE6, IE5.5, Opera 7.6, Firefox 1.0 and Safari 1.1.

另外一个我觉得也比较BT的JS+CSS模拟效果

http://www.webreference.com/programming/css_borders/examples/krazy.htm

2006年01月06日

从介绍看,还是很有吸引力去了解一下这个JAHAH,http://www.blogmatrix.com/tls/jahah/

What is JAHAH?

JAHAH is an AJAX-like technology for ‘mashing’ web pages together.

  • It is easy for web page authors to include JAHAH documents
  • It is easy for content producers to create JAHAH documents
  • JAHAH documents can be included "cross-domain", unlike most AJAX technologies
  • JAHAH documents are search engine friendly

Where does JAHAH come from?

JAHAH is based on existing ideas and technology:

  • AHAH is technology for directly including HTML fragments using AJAX
  • JSON is a scripting-language friendly way of transmitting
    data across the web (that works cross-domain)
  • JSONP is an incremental improvement to JSON that allows
    the document requestor to specify an arbitrary prefix to be returned
    prepended to the result

JAHAH Web Service Description

A web service that provides JAHAH documents must behave as following:

  • If there is a ‘jsonp’ parameter, it must return:

    • the value of that parameter, followed by
    • if everything’s OK: a JSON dictionary with ‘html’ containing the payload
    • if there’s a problem: a JSON dictionary with ‘error’ containing the error message
  • If there is no ‘jsonp’ parameter, or it is empty, the webservice must
    return an HTML document, where the BODY of the document is the payload

It is also acceptable, though not encouraged, to return only a string with the payload rather than
a dictionary. It is OK to return other values with the dictionary, excepting that
all single letter keys are reserved
.

How do I include JAHAH in my document?

You are free to do this anyway you like if you don’t care for what we’ve done here.
However, we do provide some pretty nifty tools if you want to try them. Note that
do not add the ‘jsonp’ parameter to URIs here — our code provides this function
automatically to callback to the correct places.

NOTE: our JAHAH tools use MochiKit. We include a copy
in our little source distribution for now, but we may take it out
if this thing starts rolling.

2005年12月22日

写了个SlideShow的原型,利用image的complete,判断图片是否调用完全,调用完全以后才显示,否则是LOADING的图片,还考虑的是
1.每调用一张图片之前先出现loading的过程,
2.调用图片中不会因为网速和图片过大而未显示全,直接跳到下一张,要按顺序一张一张播放.
3.第一次 播放的时候,因为调用图片会慢一点,重新播放是调用CACHE里的,速度就快了

代码如下:

在线运行演示


2005年07月28日

某人提出的要求,我在网上找的代码,改了一下,FF和IE都支持
这个脚本的用处就是你在input 输入框里面输入英文字母(比如D)的时候,旁边的SELECT里面有相应这个字母D开头的就会标蓝选中,如果是单选就会出现在最上面,可以应用在邮件系统里面的输入邮件地址那里。


在线运行演示