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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Am I missing something? 2

Status
Not open for further replies.

TFfan

Programmer
Jan 18, 2002
192
CA
I wanted to put list of misc links on the right side of my page. Since there are many pages and it would need to be updated frequently, I wanted an external file.

I tried a number of methods using arrays and <iframes> or <divs> and nothing seemed to work well with browsers other than IE (granted I'm a hack when it comes to javascript).

Then I tried this in between the <div> tags (CSS):

<SCRIPT LANGUAGE=&quot;JavaScript&quot; SRC=&quot;page.js&quot;></SCRIPT>

In my page.js, I have a series of

document.write(&quot;...&quot;)

statements. This of course works in all browsers. Is there a hangup I am not seeing? Is there a better way?
 
Nothing wrong with it at all... In fact, you may have just created your first Javascript object =D. When it comes to programming, this is the preferred method of doing things because once the object has been created, all you have to do is stick that <SCRIPT LANGUAGE=&quot;JavaScript&quot; SRC=&quot;page.js&quot;></SCRIPT> tag wherever you want the menu to appear... Best thing of all - When it's time to update it, you only have to modify that one file instead of a bunch of 'em.

-----------------------------------------------
&quot;The night sky over the planet Krikkit is the least interesting sight in the entire universe.&quot;
-Hitch Hiker's Guide To The Galaxy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top