Dec
12
2007
Bookmark the following links: Select and Search For Google, Select and Search For Yahoo. Now, on any webpage, highlight some text, and click on the bookmark item. It will bring you to Google / Yahoo search with query as the text you just selected.
If you are already on Yahoo search, click the Google link, it will bring you the google search result with the same term, vice verse.
Nov
27
2007
This should work on pages with most of the different encodings :-)
window.Utf8Encode = function(string) {
string = string.replace(/\\r\\n/g,"n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
}
else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
}
<pre />
Nov
02
2007
And the code is:
<div style="border: 1px solid #ff0000; width: 580px">
<div style="border: 1px solid #00ff00; float: left">Left</div>
<div style="border: 1px solid #0000ff; float: right; text-align: right">Right</div>
</div>
It seems Firefox handles nested DIV differently from IE. FF has the height of the outer DIV as 0 in this case.
For a more detailed demo on CSS layout, follow this link.
Oct
31
2007
So far, Lee's Code Highlighter is the best I found. Download it at http://ideathinking.com/wiki/index.php/WordPress:CodeHighlighterPlugin
To install the plugin:
- Unzip the plugin archive
- Upload the directory to the /wp-content/plugins/ directory
- Activate the plugin through the 'Plugins' menu in WordPress
It is useful to add a border on the code section. To achieve so, in your themes folder /wp-content/themes/yourTheme/
Add the following to your style.css
pre {
font-size: 12px;
background:#f8f8f8;
padding:4px;
border:#c96 1px dotted;
}
Oct
29
2007
The demo can be found at http://answersy.com/ajax/widgetYCN.html. All you need is to copy the javascript code in the textarea and paste it on your page.
This version is implemented using iframe. I have a demo to use Ajax, but it will fail on other sites because XMLHttpRequest or ActiveXObject can only request data from the same domain. There is workaround, but not simple.
To implement UI widgets using javascript:
(1) include a piece of javascript code
(2) the code will do document.write("<iframe src = Service.html />");
Oct
22
2007
Use el.style.cursor = "pointer"; instead! It works for both IE and FF.
See also http://www.permadi.com/tutorial/cssCustomCursor/ for a more detailed explanation.
Oct
11
2007
将下面的链接作成书签:雅虎全能搜! or Omni Search!
如果是使用IE, 请加在 Favorite "Links"中,如下

如果使用Firefox,请加在Bookmarks Toolbar上,如下

这样,当你在Baidu.com,或者Google.cn搜索时,只要点击一下书签工具栏上的“雅虎全能搜!”,就可以看到雅虎全能搜索在相同关键字上的结果了。我进一步修改了一下程序,现在,在任何网站的页面上,只要你选择了一段小于200字的文字,书签工具栏上的“雅虎全能搜!”,你就可以用你选择的文字作为关键字在雅虎全能搜索上做一次搜索。
Oct
10
2007
If you search the web, you will get the following anwser: add the follow code to your HTML
<link rel="shortcut icon" xhref="http://www.domain.com/dir/favicon.ico" />
If you use Firefox, you can use any image format like gif, bmp, etc., but IE will only accept windows .ico format.
You can create a .ico file with Photoshop, however, you need to download a plugin to do so.
Go to http://www.telegraphics.com.au/sw/, download the right version in the section ICO (Windows Icon) Format. For Windows, the file name is ICOFormat-1.6f9-win.zip, extract the file and follow the instruction in README.html:
- Move the plugin into the "File Formats" folder inside your Photoshop Plugins folder:
- On Windows, ICOFormat.8bi
- On OS X/Classic, icoformat (CS2/Mac version is ICOFormat_cs2.plugin)
- On 68K MacOS, icoformat(68K)
- Quit and relaunch Photoshop, if it's already running.
Now you shall be able to save an image in Windows icon format.
Oct
09
2007
I have found this pretty interesting
Both IE (7.0) and Firefox handle {background-color:#ffffff;} and {background-color:#fff;} in a CSS style sheet correctly.
But IE does not like <tr bgColor = "fff"> in HTML, and tr.bgColor = "fff"; in Javascrip.
It seems Firefox handles it correctly.