2011-08-24 189 views
1

我GOOGLE了jQuery中的一個問題,發現補丁文件形式的jQuery的網站的。我已經下載了它。它有以下4行代碼。如何應用jQuery的補丁文件

572c572 
<   if (inst.input[0].type != 'hidden') 
--- 
>   if (inst.input[0].type != 'hidden' && inst.input[0].disabled == false  && $(inst.input[0]).is(":visible") == true) 

有人可以幫助我在現有的jquery庫中應用此修補程序。我試圖在庫中搜索以上文本,但無法找到它。

回答

3

你必須在你的代碼改變

 if (inst.input[0].type != 'hidden') 

 if (inst.input[0].type != 'hidden' && inst.input[0].disabled == false && $(inst.input[0]).is(":visible") == true) 

。您發佈整個代碼被稱爲「差異」輸出

+0

你可以用'patch' – Flexo

+0

@awo應用來進行比較:哇,真的嗎?不知道,謝謝! – genesis

+0

不是100%確定,如果你是諷刺性的,但問問題的人最有可能不知道,並且不值得再寫一個答案。 – Flexo

0

糾正我,如果我錯了,但要做到這一點,你應該首先下載jQuery庫(發展)的非壓縮版本,然後搜索這行代碼

if (inst.input[0].type != 'hidden') 

而與此一個

if (inst.input[0].type != 'hidden' && inst.input[0].disabled == false  && $(inst.input[0]).is(":visible") == true) 

替換然後保存新補丁的文件,您可能需要使用的許多壓縮工具繳費網上一個重新壓縮。

+0

哎呀......它不存在在jQuery庫.. – Raghav

+0

確保您下載的補丁已經爲建立正確的jQuery的版本。 –

+0

inrrespective的版本,inst.input [0] .TYPE應該有..這也是不存在庫中的... – Raghav