Language
Site Map
Bookmark
MCANERIN INTERNATIONAL INC. - International Search Engine Marketing Firm - Global Site

JavaScript Feed

Based on a request (and for my own use and interest) here is a search engine friendly news or image feed system that automatically creates an image with a link.

This is intended to be a search engine friendly way of automatically creating an image and link to your (or any) site without requiring a lot of work. It works in a manner similar to a server-side include but works when you don't have access to the CGI-BIN or are sending the feed across domains.

Naturally, you can use this to publish almost any HTML, not just images. It's perfect for non-RSS newsfeeds, quote/picture of the day and other similar things.

It is important to understand that the search engines will probably not see anything inside the .js file and will only see the text or links in between the <noscript> and </noscript> tags. So don't forget to edit them properly.

The code is in 2 parts: Source and Destination

Source

The source is a simple document.write statement in javascript:

In this case, I call the script mcanerin.js - you can call it anything you want. Just cut and paste this text into notepad, edit my mcanerin.com stuff to match your sites content, and off you go!

document.write('<p><a href="http://www.mcanerin.com/"> <img border="0" src="http://www.mcanerin.com/images/logo.jpg" alt="Internet Promotion by McAnerin Networks Inc"></a></p>');

Note: Make sure you have no line breaks (and turn off word wrap).
 

Destination

The destination code is even easier, just one line:

<SCRIPT LANGUAGE=JavaScript SRC=http://www.mcanerin.com/search-engine/mcanerin.js></SCRIPT><noscript><a href="http://www.mcanerin.com">www.mcanerin.com</a></noscript>

All the destination site has to do is to include this one line into their site and the image appears. Note it includes a link and an ALT tag. You could just as easily include HTML text or links. 

Make sure that the SRC points to the exact location of your .js file, and that it is ABSOLUTE. Meaning, don't just type mcanerin.js: you have to type the whole URL: http://www.mcanerin.com/search-engine/mcanerin.js - otherwise, it won't know what to look for when someone puts it on a different domain.

Example

 

Tested

Internet Explorer 6
Lynx 2.8
Mozilla 1.5
Netscape 4.08

 

http://www.mcanerin.com/EN/search-engine/javascript-feed.asp


Valid XHTML 1.0   W3C CSS Verified!   Rated with the ICRA