{"id":734,"date":"2012-08-12T14:10:43","date_gmt":"2012-08-12T06:10:43","guid":{"rendered":"http:\/\/www.youthtribe.com\/?p=734"},"modified":"2012-08-12T14:10:43","modified_gmt":"2012-08-12T06:10:43","slug":"jquery%e5%ae%9e%e7%8e%b0input%e6%a1%86%e8%87%aa%e5%b7%b1%e9%bb%98%e8%ae%a4%e6%96%87%e5%ad%97%e7%9a%84%e5%8f%98%e5%8c%96-%e5%85%b3%e9%94%ae%e6%98%af%e7%84%a6%e7%82%b9%e7%9a%84%e5%a4%b1%e5%8e%bb","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/734","title":{"rendered":"jquery\u5b9e\u73b0input\u6846\u81ea\u5df1\u9ed8\u8ba4\u6587\u5b57\u7684\u53d8\u5316-\u5173\u952e\u662f\u7126\u70b9\u7684\u5931\u53bb\u4e0e\u83b7\u5f97"},"content":{"rendered":"

\u7f51\u4e0a\u6709\u597d\u591a\u8fd9\u6837\u7684jb\u5e94\u7528\uff1a\u5373\u5f53\u9f20\u6807\u70b9\u5230\u641c\u7d22\u6846\u65f6\uff0c\u9ed8\u8ba4\u7684\u6587\u5b57\u5c31\u4f1a\u6d88\u5931\u4e86\u3002\u9f20\u6807\u79bb\u5f00\u5c31\u4f1a\u53c8\u51fa\u73b0\u9ed8\u8ba4\u7684\u63d0\u793a\u6587\u5b57\u3002\u975e\u5e38\u5b9e\u7528\u3002\u5176\u5b9e\u73b0\u539f\u7406\u4e5f\u662f\u975e\u5e38\u7684\u7b80\u5355\u7684\u3002\u4e0b\u8fb9\u770b\u4ee3\u7801\u5427\uff08\u9700\u8981jquery\u7684\u52a0\u8f7d\u7684\uff09<\/p>\n

\/\/ JavaScript Document
\n\u00a0$(document).ready(function(){
\n\u00a0\/\/focusblur
\n\u00a0jQuery.focusblur = function(focusid) {
\n\u00a0\u00a0var focusblurid = $(focusid);
\n\u00a0\u00a0var defval = focusblurid.val();
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0
\n\u00a0focusblurid.focus(function(){
\n\u00a0\u00a0\u00a0var thisval = $(this).val();
\n\u00a0\u00a0\u00a0\u00a0if(thisval==defval){
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $(this).val(“”);
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 });
\n\u00a0\u00a0\u00a0 focusblurid.blur(function(){
\n\u00a0\u00a0\u00a0var thisval = $(this).val();
\n\u00a0\u00a0\u00a0\u00a0if(thisval==””){
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $(this).val(defval);
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 });
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0
\n\u00a0\u00a0\u00a0\u00a0 };
\n\u00a0\/*\u4e0b\u9762\u662f\u8c03\u7528\u65b9\u6cd5*\/
\n\u00a0\u00a0\u00a0\u00a0 $.focusblur(“#searchkey”);
\n\u00a0});<\/p><\/blockquote>\n

\u6211\u7684www.nbadashi.com<\/a>\u7684\u641c\u7d22\u5df2\u7ecf\u5e94\u7528\u4e86\uff0c\u975e\u5e38\u4eba\u6027\u5316\u3002<\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

\u7f51\u4e0a\u6709\u597d\u591a\u8fd9\u6837\u7684jb\u5e94\u7528\uff1a\u5373\u5f53\u9f20\u6807\u70b9\u5230\u641c\u7d22\u6846\u65f6\uff0c\u9ed8\u8ba4\u7684\u6587\u5b57\u5c31\u4f1a\u6d88\u5931\u4e86\u3002\u9f20\u6807\u79bb\u5f00\u5c31\u4f1a\u53c8\u51fa\u73b0\u9ed8\u8ba4\u7684\u63d0\u793a\u6587\u5b57\u3002\u975e\u5e38\u5b9e\u7528\u3002\u5176\u5b9e\u73b0\u539f\u7406\u4e5f\u662f\u975e\u5e38\u7684\u7b80\u5355\u7684\u3002\u4e0b\u8fb9\u770b\u4ee3\u7801\u5427\uff08\u9700\u8981jquery\u7684\u52a0\u8f7d\u7684\uff09 \/\/ JavaScript Document \u00a0$(document).ready(function(){ \u00a0\/\/focusblur \u00a0jQuery.focusblur = function(focusid) { \u00a0\u00a0var focusblurid = $(focusid); \u00a0\u00a0var defval = focusblurid.val(); \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0focusblurid.focus(functio<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,9],"tags":[127],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/734"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=734"}],"version-history":[{"count":2,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/734\/revisions"}],"predecessor-version":[{"id":736,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/734\/revisions\/736"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=734"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}