Bài đăng

Đang hiển thị bài đăng từ tháng 5 17, 2009

Any function in JavaScript can be used to create custom object classes

Any function in JavaScript can be used to create custom object classes function myobject() { this.containedValue = 0; this.othercontainedValue = 0; this.anothercontainedValue = 0; } var mything = new myobject(); And there you go, mything is now an instance of class myobject . It will have the following properties, all of which will be 0: mything.containedValue mything.othercontainedValue mything.anothercontainedValue tutorials/javascript/objects

The Navigator Object

The Navigator Object <>script type="text/javascript"> var browser=navigator.appName; var b_version=navigator.appVersion; var version=parseFloat(b_version); document.write("Browser name: "+ browser); document.write(" "); document.write("Browser version: "+ version); <>/script> <>script type="text/javascript"> function detectBrowser() { var browser=navigator.appName; var b_version=navigator.appVersion; var version=parseFloat(b_version); if ((browser=="Netscape"||browser=="Microsoft Internet Explorer") && (version>=4)) { alert("Your browser is good enough!"); } else { alert("It's time to upgrade your browser!"); } } <>/script>

thằng cô đơn

Bạn bè bảo tôi là thằng cô đơn vì tôi chưa từng có bạn gái. Nhưng tôi cũng đã từng có người con gái nguyện cùng tôi sống chết có nhau : "không trả nợ cho bà, bà thề sống chết với may`" . Cũng từng có người con gái cùng tôi hẹn ước đến kiếp sau : "muốn kua chị mày đây hả? Đợi kiếp sau đi kưng " . Và từng có người con gái cam lòng tự nguyện vì tôi mà chết : "Làm bạn gái ông? Tui thà chết còn hơn" ==> Nghĩ lại tôi thấy mình cũng đào hoa ra phết

Flash Player detection

Hình ảnh
Substituting an image for a Flash Player movie on the fly The following code will work on all browsers that understand either JavaScript or ActiveX. If the browser supports the MIME Type application/futuresplash, the script writes out an EMBED tag; otherwise, it writes an IMG tag. The OBJECT tag is invoked on any browser that supports ActiveX, regardless of which tag the JavaScript writes. The lines starting with "//" are comments, as are the lines enclosed in " " The browser ignores the former as "not part of the JavaScript to be executed," and the latter as "not part of the HTML to be displayed." CODEBASE="http://active.macromedia.com/flash/cabs/swflash.cab#version=3,0,0,11" WIDTH="220" HEIGHT="110" NAME="sw" ID="sw"> Make sure there are no line breaks in your EMBED or IMG tags, or the script will fail. If you'd like to use line breaks, put each line

test popup

[Test for popup windows]

Google Data APIs Samples

Google Data APIs Samples http://code.google.com/apis/ajax/playground/#expand_mode http://code.google.com/apis/gdata/samples.html#JSON http://code.google.com/apis/base/samples/javascript/js_query_generator/ http://code.google.com/apis/gdata/samples/blogger_sample.html alt Requests results in an alternative format Values: atom, rss, json, json-in-script Default: atom Example: ...&alt=rss callback Causes the specified JavaScript function name to be executed when the data from Google Base is loaded Default: None Notes: Only used when alt=json-in-script Example: ...&alt=json-in-script&callback=yourProcessResultsFunc orderby Define the ranking order for sorting queries Values: relevancy, modification_time, name(type):value, [] Default: relevancy Notes: The Ranking Language reference explains what you can do with this language and defines the language syntax. Example: ...&orderby=price(float USD) crowdby Limit repetitive results by placing a cap on similar items Values: attrib

Parameters in Blogspot feed

Parameters in Blogspot feed http://growyourblog.blogspot.com/feeds/posts/default get 20 entry http://growyourblog.blogspot.com/feeds/posts/default?start-index=3 get 3 entry http://growyourblog.blogspot.com/feeds/posts/default?max-results=10 get max 10 entry http://growyourblog.blogspot.com/feeds/posts/default?published-max=2009-01-01 &max-results=5 more... published-min, published-max, updated-min, updated-max http://yourblogname.blogspot.com/feeds/posts/ default/-/Label%20Name get items in label name http://yourblogname.blogspot.com/feeds/posts/ default/-/Label%20Name1/Label%Name2 get items in two labels like above for 3,4,5... code google

test thumbnail

Hình ảnh
Siêu tăng tốc BlogSpot Người gửi: Et Chào các bạn, Ẹt xưa nay chỉ quen Copy & Paste, ít khi tự viết bài. Hôm nay sẽ ngồi viết 1 bài kinh thiên động địa chơi :D. Mà Thư giãn 360 xưa nay toàn Xxx (dân tình đổ oan thế), hôm nay đăng tut Blogger chơi :D. 2 sự kiện khác thường đó đều nhân dịp đang stress, thầy bắt về tự đọc mấy chương, mai báo cáo, mà giờ không có sách :)) Vào đề như thế là đủ, giờ bắt đầu. Như các tín đồ của BlogSpot đã biết, khi vào trang chủ thì nó show hết sạch n bài viết gần đây, trông rất xấu mà lại load rất lâu. Bác Anh Võ ở Việt webguide có nhiều Tut hack để làm đẹp blog, trông giống như Portal mà bây giờ rất nhiều người dùng. Đỉnh cao là tạo Summary post có hỗ trợ ảnh đại diện. Tuy nhiên hack đó chỉ làm gọn blog chứ không cải thiện tốc độ load trang, thậm chí là chậm hơn chút xíu. Dựa trên hack đó thì Ẹt cải tiến 1 chút. Cụ thể thì anh em nào biết tí xíu code có thể thấy ngay phần thay đổi. Còn anh em không rõ khoản này có thể hiểu đơn giản là: trước đây n

I found this nice syntax highlighter on google code.

1. Download SyntaxHighlighter here 2. Unzip and upload the following files to your webspace (googlepages is a great place) 1. SyntaxHighlighter.css 2. shCore.js' 3. shBrushCpp.js (or whatever code you wish to use on your blog) 3. Go to your Dashboard/Layout/Edit HTML 4. Add the following code right after the tag < !-- end outer-wrapper -- > < link href='YOUR_GOOGLE_PAGES/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/ > < script language='javascript' src='YOUR_GOOGLE_PAGES/shCore.js'/ > < script language='javascript' src='YOUR_GOOGLE_PAGES/shBrushCpp.js'/ > < script language='javascript' > dp.SyntaxHighlighter.BloggerMode(); dp.SyntaxHighlighter.HighlightAll('code'); < /script > < pre name="code" class="Cpp" > ...insert code here... < /pre > P

CSS Drop Shadow

< div class="dropshadow2"> < div class="innerbox"> < h4>Test 2< /h4> < p>This has two wrapping div's. one for the shadow, and one for the border.< /p> < div> < div> .dropshadow2{ float:left; clear:left; background: url(images/shadowAlpha.png) no-repeat bottom right !important; background: url(images/shadow.gif) no-repeat bottom right; margin: 10px 0 10px 10px !important; margin: 10px 0 10px 5px; width: 500px; padding: 0px; } .innerbox{ position:relative; bottom:6px; right: 6px; border: 1px solid #999999; padding:4px; margin: 0px 0px 0px 0px; } .innerbox{ /* IE5 hack */ \margin: 0px 0px -3px 0px; ma\rgin: 0px 0px 0px 0px; } .innerbox p{ font-size:14px; margin: 3px; } Phần đầy đủ

FIREFOX / IE Word-Wrap, Word-Break, TABLES FIX

/* this will force a column to be no wider than 300px, breaking words in the middle of a long word if necessary. */ .HardBreak{ width: 300px; white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ } You could also replace the .HardBreak class designator above with td { and the style would automatically apply to all TD elements. Remove the width attribute in that case, and set the width in the TD element itself. Phần đầy đủ

Code Converter

Code Converter Code Converter Phần đầy đủ

Display CSS codes and Scripts in unique Style - Blogger Post Styling hack

All of you might have noticed that in my blogger posts I use a custom CSS style to show CSS codes , Scripts and other important notes. After looking at this cool features one of my reader asked me how to do this. So I am Posting this " Post Styling Hack for blogger to display scripts and CSS codes in unique style " . Step 2 : Add This CSS code above this line ]]> .codeview { margin : 15px 35px 15px 15px; padding : 10px; clear : both; list-style-type : none; background : #f9f9f9 url(http://i263.photobucket.com/albums/ii150/mohamedrias/cv-1.gif) no-repeat right bottom; border-top : 1px solid #eeeeee; border-right : 2px solid #cccccc; border-bottom : 2px solid #cccccc; border-left : 1px solid #eeeeee; } .codeview li { font-size : 13px ; line-height : 24px; font-family : "Courier New", "MS Sans Serif", sans-serif, serif; color : # 333333 ; font-weight : normal ; margin : 0; padding : 0; } See Screenshot Below for Instructions: Step 3 : Whenever you create n