Y星人の工作語錄

別理我, 我只是一個愛發勞騷的Y星人

10月
29

jquery-plugin-validation super!

Posted by YuanYuan under jQueryPlugins

when we made web pages, we always make some survey form or new user register form, and many many form…

oh, God! We spend too much time to write form Validate javascript, Now, jquery-plugin-validation can give us much help. you just need spend a few times, nerver spend  a lot of time to write Validate script.

so, you need jquery-plugin-validation

what jquery-plugin-validation do for us ?

few code, few time, few sit on chair(hahaha)….

for easy example:

  1. $(document).ready(function(){
  2. $("#myForm").validate()
  3. });

and put some

  1. class="required"

in your input filed tag, and add some css

  1. input.error {border: 1px solid red;display: block;}

now, form Validation so easy.
go take a look jquery-plugin-validation now.

super example:

Syntetic examples

Real-world examples

Testsuite

10月
16

url maximum length ?

Posted by YuanYuan under Html

with my project, I just test a try send2garmin. get some problems. I always think the method GET length 0~255 in url , but the real url GET should be

結論
Microsoft Internet Explorer 有 2,083 個字元的最大統一資源定位器 (URL) 長度。 Internet Explorer 也有 2,048 個字元的最大路徑長度。 這項限制適用於同時 POST 要求和 GET 要求 URL。

如果您使用 GET 方法,您僅限於最多 2,048 個字元,減的實際路徑中的字元數。

不過,POST 方法不受送出名稱 / 值組的 URL 的大小。 這些配對被傳輸在標頭,而不是在 URL。

RFC 2616,「 超文字傳輸通訊協定–HTTP / 1.1,”沒有指定任何 URL 長度需求。

http://support.microsoft.com/kb/208427

oh, no. :(  I think I forget about this correct maxium url length.
so, with GET method , you can send more parameter to other program. but url ugly..hahah..:)

and I find some interest about different browser’s url maximum length  - What is the maximum length of a URL?

so fun.

browser | characters
IE  | 2048
Firefox | > 65536
Safari | > 80000
Opera | >190000
Apache(server) | 8192
IIS (server) | 16384

Recommendations

Extremely long URLs are usually a mistake. URLs over 2,000 characters will not work in the most popular web browser. Don’t use them if you intend your site to work for the majority of Internet users.

When you wish to submit a form containing many fields, which would otherwise produce a very long URL, the standard solution is to use the POST method rather than the GET method. ~ from BOUTELL.com

10月
16

Firefox bug ? from 1.x until 3.x

Posted by YuanYuan under browser

a long time ago, this bug (maybe not.) from 1.x util now 3.x.

  1. <!-- <input type="checkbox" id="btn-chkall" name="chkall"><label for="btn-chkall">全選</label> -- -->

this html comments have 2 dash line in html, — –>
IE show the correct , hide <– xxxxxx –>
but
FF show all html <!– <input type=”checkbox” id=”btn-chkall” name=”chkall”><label for=”btn-chkall”>全選</label> — –> ,

I don’t know why ?