More Bookmarklet via Javascript Tutorial

More Bookmarklet via Javascript Tutorial

More Bookmarklet via Javascript Tutorial

Have you heard of Bookmarklets?

Are you a person with a cluttered (thoughtfully placed, of course) desk?

Yes? Read on … even if not, “Go to Jail … Do Not Pass Go” (maybe you were impressed by that idea that the Lord’s Prayer was Once Etched on a Pinhead? … yes? … read on down below … are you here? … oops … c’est la vie … read on) … read on … why?

This tutorial builds on Bookmarklet via Javascript Primer Tutorial below. For our tutorial we write a bookmarklet to check for Broken Links, something that could be very useful to run against the very common Links pages on websites today, so that you can check for those Broken Links that annoy the search engines so much and contribute to a lower SEO “score”.


<script type=”text/javascript”>
function checkBrokenLink() {
var bWin,j,b=”,tl=40,dl=document.links;
for(j=0;j<dl.length;j++){
if(b.indexOf(dl[j].href)<0){
bWin=window.open(dl[j].href,’BW’+j,’top=’+tl+’,left=620,width=400,height=120,
scrollbars=yes,menubar=no,titlebar=no,toolbar=no,status=no’);
tl+=120;
b+='<tr style=”height:120″><td>’+dl[j].href+'</td><td>';
b+=dl[j].target+'</td><td>’+dl[j].id+'</td><td>';
b+=dl[j].className+'</td><td>–></td></tr>';
}
}
if(b===”){
alert(‘No links’);
}else{
bWin=window.open(”,’Links of ‘+document.title,’top=0,left=0,width=600,height=800,scrollbars=yes’);
bWin.title=’Links of ‘+document.title;
bWin.document.body.innerHTML='<table border=1 cellpadding=5 cellspacing=0><tr><th>Link of ‘;
bWin.document.body.innerHTML+=document.title+'</th><th>Target</th><th>ID</th><‘;
bWin.document.body.innerHTML+=’th>Class</th><th>Broken?</th></tr>’+b+'</table>';
}
}
</script>

To get some downloadable Javascript programming code for this bookmarklet please rename to BrokenLinks.js and copy its contents into the address of your Bookmarklet to try this yourself.

Okay, if you have downloaded, take a look at how similar it is to code above. So you just place javascript: in front of the Javascript code required to do something interesting, all squeezed together onto the one line (no pinheads please) … this is where the cluttered desk people may continue breathing easily but others may falter.

Well, if you can place this sort of thing into a browser Bookmark then that is a Bookmarklet. Remember the Javascript calculator rave in previous tutorials?

Bear in mind we show Firefox in tutorial but all browsers have something similar, whether that be called Bookmarks or Favourites. Our tutorial shows the Safari browser using this Bookmarklet.

Regarding this Bookmarklet tutorial topic I really like “JavaScript & Ajax” seventh edition by Tom Negrino and Dori Smith.

Click on picture above to go to tutorial about Bookmarklets.

Did you know …
JavaScript makes a great easy-access Calculator?

Try typing the lines below into the address bar of your favourite browser:

Javascript: eval(512 / 380);
Javascript: eval(512 * 380);
Javascript: eval(512 – 380);
Javascript: eval(512 + 380);
Javascript: eval(512 % 380);

These days we spend so much time on the Internet it is a much quicker way to get to a calculator!


Previous Bookmarklet via Javascript Primer Tutorial below …

Bookmarklet via Javascript Primer Tutorial

Bookmarklet via Javascript Primer Tutorial

Have you heard of Bookmarklets?

Are you a person with a cluttered (thoughtfully placed, of course) desk?

Yes? Read on … even if not … read on … why?


<html>
<head>
</head>
<body>
<script type=”text/javascript”>

while (“abracadabra” != prompt(“Guess the magic word?”).toLowerCase()) {
alert(“Bad Luck”);
}
document.write(“<html><body><p>You win a cupee doll!</body></html>”);

</script>
<a href=’#’ onclick=’javascript: while (“abracadabra” != prompt(“Guess the magic word?”).toLowerCase()) { alert(“Bad Luck”); } document.write(“<html><body><p>You win a cupee doll!</body></html>”);’>Click me for another (confirmed) go … but limited offer on cupee dolls!</a>
</body>
</html>

Look at the cutesy wootsey HTML/Javascript above. Isn’t it cuuuuuuute?!
Isn’t it sweeeeeet?!

♫ Oh, aint she sweet, when she’s walking down the street,
Well I ask you very confidentially … aint … she … sweet. ♫

Enough of a sell job?

Okay look at the Javascript of one vs Javascript of one below in the a tag onclick bit. So you just place javascript: in front of the Javascript code required to do something interesting, all squeezed together onto the one line … this is where the cluttered desk people may continue breathing easily but others may falter.

Well, if you can place this sort of thing into a browser Bookmark then that is a
Bookmarklet. Remember the Javascript calculator rave in previous tutorials?

Bear in mind we show Firefox in tutorial but all browsers have something similar, whether that be called Bookmarks or Favourites.

Click on picture above to go to tutorial about Bookmarklets.

Link to downloadable source code of HTML above is bmark.html which you need to rename in order to try.

Did you know …
JavaScript makes a great easy-access Calculator?

Try typing the lines below into the address bar of your favourite browser:

Javascript: eval(512 / 380);
Javascript: eval(512 * 380);
Javascript: eval(512 – 380);
Javascript: eval(512 + 380);
Javascript: eval(512 % 380);

These days we spend so much time on the Internet it is a much quicker way to get to a calculator!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Tutorials and tagged , , , , . Bookmark the permalink.

25 Responses to More Bookmarklet via Javascript Tutorial

  1. Thank you for gipelris every one of your efforts on this blog. My mom delights in working on research and it is easy to see why. Most of us notice all of the powerful ways you deliver good guidelines through this web blog and as well as encourage participation from other people on the content then our favorite simple princess has always been discovering a lot. Enjoy the remaining portion of the year. You are conducting a brilliant job.

  2. “I wanted to write you this small bit of note to finally thank you over once again on your stunning suggestions you’ve documented in this case. This is generous of people like you to give freely all that most of us may possibly have produced available as an ebook to make some cash for their very own finish, principally since you can have tried it should you decided. These strategies also worked as the great method to realize that a lot of people have related keenness similar to my quite own to grasp way far more on the subject of this problem. I believe there are numerous far more enjoyable instances up front for folks who take a look at your website.”

  3. I am curious to discover out what website system you will be utilizing? I’m experiencing some small security problems with my latest website and I’d prefer to obtain one thing additional safeguarded. Do you’ve any suggestions?

  4. wonder says:

    I have been absent for a while, but now I remember why I used to love this web site. Thanks , I will try and check back more frequently. How frequently you update your website?

  5. Dimple says:

    Extremely valuable outlook, thanks for expression.. So content to have located this article.. Get pleasure from the post you delivered.. Value the post you given..

  6. attend says:

    naturally like your website however you have to take a look at the spelling on quite a few of your posts. Several of them are rife with spelling issues and I find it very troublesome to tell the reality nevertheless I will definitely come again again.

  7. Bonjour ! Vraiment bien comme site!!!

  8. Thanks a lot for providing individuals with an extraordinarily terrific possiblity to read in detail from this website. It is always so lovely and stuffed with a good time for me personally and my office fellow workers to visit the blog more than 3 times in one week to read the latest items you have got. And lastly, we’re usually astounded for the astonishing ideas served by you. Certain 2 areas in this posting are really the most impressive we have ever had.

  9. I together with my friends were actually looking through the great helpful tips located on your web site while all of the sudden came up with a horrible feeling I never thanked the blog owner for those techniques. Those young men happened to be so joyful to see all of them and have in effect honestly been using them. I appreciate you for truly being simply kind and then for figuring out variety of very good tips most people are really desperate to learn about. My personal honest regret for not expressing gratitude to you earlier.

  10. technology says:

    You made some nice points there. I looked on the internet for the topic and found most individuals will approve with your website.

  11. Great weblog here! Additionally your site lots up fast! What host are you the use of? Can I get your associate hyperlink for your host? I desire my website loaded up as fast as yours lol

  12. Some times its a pain inside the ass to read what blog owners wrote but this internet web site is really user genial ! .

  13. Fantastic internet site you got here! Please maintain updating, I will def read far more. It’ll be in my bookmarks so far better update!

  14. Some actually beneficial details in there. Why not hold some sort of contest for your readers?

  15. As a Newbie, I am continuously searching online for articles that can aid me. Thank you

  16. I have been absent for some time, but now I remember why I used to love this website. Thanks , I¡¦ll try and check back more often. How frequently you update your site?

  17. There is obviously a bunch to realize about this. I suppose you made certain good points in features also.

  18. I cannot thank you fully for the blogposts on your web page. I know you placed lots of time and effort into all of them and hope you know how considerably I appreciate it. I hope I will do precisely exactly the same for an additional individual at some point. Palm Beach Condos

  19. You can certainly see your expertise in the paintings you write. The arena hopes for more passionate writers such as you who aren’t afraid to mention how they believe. At all times go after your heart.

  20. Simply want to say your article is as amazing. The clearness in your post is just spectacular and i can assume you’re an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please continue the gratifying work.

  21. fine says:

    I’m writing to make you be aware of what a amazing encounter my friend’s princess experienced using your web site. She figured out several pieces, including how it is like to have a marvelous teaching nature to make the mediocre ones without problems comprehend a variety of multifaceted matters. You actually did more than our own expected results. I appreciate you for delivering the necessary, trustworthy, informative not to mention fun guidance on the topic to Ethel.

  22. Honestly interesting outlook, appreciate your writing.. Particularly interesting outlook, thank you for sharing.. Supporting the thread.. thanks! My internet searching seem full.. thanks.

  23. Financing says:

    Great site! I am loving it!! Will come back again. I am taking your feeds also

  24. Excellent goods from you, man. I’ve understand your stuff previous to and you are just extremely great. I really like what you’ve acquired here, really like what you are saying and the way in which you say it. You make it enjoyable and you still take care of to keep it sensible. I can’t wait to read much more from you. This is really a wonderful website.

  25. Erasmo Burm says:

    You have brought up a very excellent points , thankyou for the post.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>