It's Sean!

UK freelance journalist, author
and writer Sean McManus

Printed from www.sean.co.uk. © Sean McManus.
Home > Articles > Webmaster resources > Javascript examples > Javascript includes

JSINC: Javascript include file creator

Code by Joseph K Myers. This interface by Sean McManus.

As my Javascript content syndication tutorial explains in more detail, you can use Javascript includes to syndicate your HTML content to other websites. All you need to do is write some Javascript code that outputs your HTML to the screen and save it in a .js file. The beauty of it is that sites from all over the web can embed your JS file in their websites so they can display your HTML.

If you want to syndicate your content (give your content away to other sites for promotional reasons), this is ideal, because you can update the .js file on your server and all your partner sites will immediately start displaying your updated HTML.

This page will create Javascript include files (.js files) for free. While there are plenty of commercial Javascript syndication programs available, this software is free.

Step 1: The HTML input

Paste any HTML you wish to be converted into this box.

Step 2: Name your script file

File name for the .js file which your syndication partners will link to (you can leave the default name):

Step 3: Generate code

Step 4: Create your script file

Copy the text in the box below and paste it into a new file. This is your Javascript code. Save the file as text-only and give it the name you entered in step 2 (above).

Step 5: Include code

This belongs in each of your web pages where you want to insert the contents of the HTML file. If the .js file isn't in the same folder or on the same server as the file referencing it, you'll need to add the full path before the filename. So your link partners, for example, will need to include your domain name before the filename to embed your Javascript in their pages.

Books by Sean McManus

Scratch Programming in Easy Steps

Scratch Programming in Easy Steps

Raspberry Pi For Dummies

Raspberry Pi For Dummies

Learn to program with the Scratch programming language, widely used in schools and colleges.

Set up your Pi, master Linux, learn Scratch and Python, and create your own electronics projects.

Coder Academy

Coder Academy

Cool Scratch Projects in Easy Steps

Cool Scratch Projects in Easy Steps

Learn to make games and other programs in Scratch 2.0, and make a web page in HTML, with this highly interactive book for 7-10 year olds.

Discover how to make 3D games, create mazes, build a drum machine, make a game with cartoon animals and more!

More books

Recommended articles

Stylised coloured photo of a synth

Discover my music and home recording articles

Interested in starting home recording? Follow me as I start recording, using instruments such as the Novation MiniNova and Korg Kaossilator, and share my synth and sample-based music online.

Scratch cat and rainbow circle

10-block demos for Scratch programming

Lots of people of all ages are learning to program with Scratch. Discover some useful tricks and techniques in my 10-block Scratch demos, including special effects you can drop into your games.

Paper Raspberry Pi case

Download free book chapters and more!

Download a free case for your Raspberry Pi, and free chapters from my books about the Raspberry Pi, Scratch, web design and more!

©Sean McManus. www.sean.co.uk.