As a preferred visitor, you can get $50 off of any Dreamhost hosting plan by using coupon code CWD50 when you check out, for a limited time. Dreamhost is a reliable hosting provider with solid customer service and a proven track record.
Looking for a dedicated hosting solution with 24/7/365 U.S.-based, English speaking phone support? Visit Rackspace for a reliable, managed hosting solution that will let you focus on the bottom line - your business, while they make sure your website stays online.
A bookmarklet is basically a software application for your browser. But what bookmarklets are most known for is their ability to run a website script from anywhere - in other words, the application is loaded in the browser, and doesn't have to be called from a particular web page. For example, if you visit our URL shortcut creator, LinkTh.at - you'll see a bookmarklet which will let you create shortcuts from any webpage, instantly - without having to copy the URL, leave the page, and enter it into the form on LinkTh.at. This creates a huge convenient to clients and proves to be a big time saver.
Developers are often interested in creating bookmarklets for their website applications or forms, as it will allow clients to use their service without having to load their website in a separate window. Common popular services that take advantage of the powers of a bookmarklet include del.icio.us, digg, and other social media networks, as well as various websites running scripts. We're going to show you the fundamentals to creating your own bookmarklet script.
With a bookmarklet, all you're doing is creating a bookmark that runs a script. The difference between the bookmark of a static URL and a bookmarklet, is that with the latter the URL consists of Javscript code, which can execute various functions. Therefore, for most scripts, you simply call the script using javascript:
javascript:<js commands>
As an example, we call
javascript:alert('Sample alert message');location.href='http://www.example.com/new-page/'
The way you actually use this is by creating an anchor (clickable URL) out of the script - so users can right-click your link and create a bookmark out of it. Then, when they load the bookmark, it will load the javascript code and execute your script. Here's an example: Just an Alert. If you right-click this link and bookmark it, whenever you load up the bookmark you'll see the alert message.
Advanced: For bookmarklet scripts that only accept POST submissions, you'll have to create an invisible form and submit it like so:
javascript:myForm=document.createElement("form");
myForm.style.display="none";
myForm.method="post";
myForm.action="http://example.com/";
myInput=document.createElement("input");
myInput.setAttribute("name","description");
myInput.setAttribute("value",document.URL);
myForm.appendChild(myInput);
document.body.appendChild(myForm);
myForm.submit();
document.body.removeChild(myForm);
Have fun!
All Content © 2005 - 2010 Contract Web Development, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Powered by Drupal
3 days 19 hours ago
3 days 19 hours ago
3 days 19 hours ago
3 days 20 hours ago
4 days 7 hours ago