HTML Tutorials

Image to Base64 Conversion Tool

Did you know that images can be embedded right into the HTML code of a page and not require an external resource to work? It is true. Using the Data URI scheme, the binary data from images can be encoded using base64 encoding and embedded right into an HTML page.

What is XFBML?

XFBML is eXtended FaceBook Markup Language. This is a markup language which allows a web developer to integrate Facebook functions into their website. XFBML works together with the Facebook Javascript SDK.

XFBML is a markup language just like HTML. This language has special tags which are different from regular HTML tags. In order for the browser to be able to process these new tags, the Facebook Javascript SDK which we mentioned earlier is used.

Use Javascript to Highlight Text

Javascript can be used as a handy way to highlight some text for a user when they click on it. This nifty little feature is useful as it saves time for the user since they don't have to do any clicking and dragging.

To utilize this feature, we use the javascript onclick event and assign certain actions to it. For example, if we had a textbox with some text in, we would enable automatic highlighting when a user clicked inside of it like so:

<textarea onclick="this.focus(); this.select();">

Add to Bookmarks Javascript for All Browsers

First of all, the title of this post is a bit misleading. No JavaScript code or any code for that matter can claim to add a bookmark in all browsers. What we can say though, is that the code we present has been tested to work in all major browsers except Google Chrome.

Bookmarks come in handy when it comes to building visitor loyalty and getting visitors to come back to your site. The JavaScript code snippet we show in this article creates a simple hyperlink which, when clicked, requests that the browser add the current page to its list of bookmarks.

HTML Redirect

To perform a HTML redirect we need to make use of the meta refresh tag. This is a particular meta tag which is used to tell the browser to go to another location. Redirecting a browser using the meta refresh method is discouraged since an unexpected redirection may disorient users.

In some cases, redirecting a web page using the meta refresh is required. The method is suitable for periodically refreshing a dynamic page to get new news or status updates for example, and is used when Javascript methods of redirection are unwanted.