Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on printing remote text onto a document with JS

Status
Not open for further replies.

TheAngryTomato

Technical User
Nov 29, 2007
1
US
One of my clients I am working for would like a little 'deals' banner on their website. They would like it on every page, and to be able to change it. I figured the best way to do that is have it link to JS file, where the ext will be stored and then printed when the file is opened by the web browser. I am new to JS, so this is what I've come up with:

<script language="JavaScript" src="deals.js"></script>

This is the file deals.js:

var txt = "Text goes here"
document.write(txt)

Also, is there a way I can put HTML code into the txt variable so I can have links/bolding/coloring?

Any help would be great.

-TheAngryTomat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top