[Javascript] Search Box to Show Default Text on Load and Cleared When Focused

Post Thumbnail of [Javascript] Search Box to Show Default Text on Load and Cleared When Focused

Very often we want our search box to show a default text such as “Search…” when it is loaded. Then when users clicked on the search box, the word is cleared, allowing user to enter their search query. We will see how to do that in this short guide in both plain Javascript and jQuery.

Filed in Web Development
Posted on 9 July 2012 • 1 comment

PHP Code to Get Current Page’s URL

Post Thumbnail of PHP Code to Get Current Page's URL

It is quite often that we need to redirect users back to current URL. I wrote my own function for this purpose, but then I realized some weaknesses: it cannot capture HTTPS and the port number, which is very important for some websites.

Filed in Web Development
Posted on 1 July 2012 • 1 comment