Thinking About Running a Business Online? Join Internet Business Mastermind, FREE!
 


Connect Your Websites With Javascript Widgets

You've already been introduced to the concepts of creating a quality blog and making niche websites as traffic nets. When you have more than 10 websites, getting a message across to all of your websites (e.g. announcements) can be very time consuming. You would have to modify all of your websites and add the message to them one by one. There is a way to update all of your websites from only updating one single file, which can be a life saver if you have more than 50 to 100 websites.

What is a JavaScript Widget

A JavaScript is a line of HTML code that points to a JavaScript in a remote place. It looks like this:

<script type="text/javascript" src="http://www.YourWebsiteUrl.com/WidgetName.js"></script>

When a website, with the above widget, is being displayed in a web browser, the web browser will look for "WidgetName.js" on the website "http://www.YourWebsiteUrl.com" and display whatever the widget wants it to display. If WidgetName.js displays "Hello World" and the fetch code -

<script type="text/javascript" src="http://www.YourWebsiteUrl.com/WidgetName.js"></script>

is placed on 100 websites, people will see "Hello World" on all the websites.

Let's do an example. Let's say you want to display the following HTML code for a linked image on all your websites:

<a href="http://FeatureProductURL" target="new"><img src="http://FeatureProductImageURL" alt="FeatureProductText"></a>


*** Note that the link URL and image URL has to be complete URLs, not "/images/picture.jpg". It has to be "http://www.yourdomain.com/images/picture.jpg". You get the idea ***

Step 1: Launch "Source Code Encrypter"

Step 2: Place the HTML code in the encrypter box

Step 3: Hit Encrypt

Step 4: Copy the encrypted code without the brackets

Step 5: Paste the encrypted code to a new text file

Step 6: Save the file in "js" format (e.g. widget.js)

Step 7: Upload the JavaScript file on to your website

Step 8: Add the fetch code

<script type="text/javascript" src="http://www.YourWebsiteUrl.com/WidgetName.js"></script>

to all of your websites.

Adding the fetch code will only have to be done once on each website. Once when every website has the fetch code, any changes that you make in your JavaScript widget file will automatically apply to all of your websites.