Web Design Blog

Javascript

This is where we store some of our Web Development thoughts, tips and tricks, just because we like to share.

Javascript – Get The Hash Tag Value From A URL

So, you have the following URL: http://www.example.com/page/#comment-12 You want to get the value after the hash tag (#), which is comment-12 The following Javascript code will help you achieve what you’re after: 1 2 3 4 5 6 7 8 9 10 11 12 13 14   <script type="text/javascript">   //check if hash tag exists [...]

02 Sep 2011 / 1 Comment / Javascript / by Maruf

Javascript – Make Div Into A Clickable Link

From what I’m aware, you can’t make a div into a clickable link with just HTML. The only way I’ve ever known is by using Javascript. Open in new window Here’s how to make a div into a clickable link that will open the target URL into a new window. 1 2 3 4   [...]

30 Mar 2011 / 2 Comments / Javascript / by Maruf

Javascript – How To Remove The Trailing Hash In A URL

Ok, this is a quick note to myself, because I always seem to forget this code, and I have no idea why, because it’s so simple. So, the scenario is that when I’m writing AJAX code, a lot of the times I use a hyperlink to trigger an action. For example, look at the following [...]

25 Apr 2010 / 2 Comments / Javascript / by Maruf

HTML Form Effect- Remove Default Value On Focus

This Javascript form effect basically removes the default value (e.g Your Name) when the input field is on focus. If nothing is entered, and focus is taken away from the input field, the value is displayed again. It’s a pretty cool effect, which I’m always using on a lot of projects. Here’s an example (click [...]

04 Dec 2008 / 10 Comments / Javascript / by Maruf
© 2012 BrightCherry :)