Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 13. Pimp My Site: Cool Stuff You... > Enhancing Search Further with jQuery

13.4. Enhancing Search Further with jQuery

In Chapter 11, we showed how you could make enhancements to the site using some simple jQuery code. If you cast your mind back, I suggested placing the code in a common JavaScript file (in js/common.js), but admitted at the time that such code was uncommon. If you remember that, you might also recall that I promised it would be used site-wide in this chapter. It’s only a slight amendment, but I’m going to add in one extra line to the form helper tip code that we set up for the Contact page, and it looks like this (shown in bold):

$("#contactname").val("Please enter full name");
 $("#telephone").val("Incl local dialling code");
 $("#eventdate").val("Format DDMMYYYY");
 $("#details").val("The more you can enter here, the less we have 
   to check with you :)");
 
$("#q, #search-box").val("Enter search phrase");
 $("input, textarea").focus(function(){
  $(this).select();
});


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial