[thelist] What is the best way to insert content in a page from a remote .js file ?

Joshua Olson joshua at waetech.com
Mon Feb 14 12:06:27 CST 2005


> -----Original Message-----
> From: Peter
> Sent: Sunday, February 13, 2005 8:49 AM
> 
> What is the best way to insert content in a page from a 
> remote .js file ?
> 
> I tried:
> 
> 1. To define functions and variables in the .js file and call 
> them from the 
> page => did not work since it takes a lot to load the .js(.js file is 
> created on the fly with PHP)

Hiya Peter!

Generally, I'd think this would work.  One way to ensure that the content is
available before using it is to trigger the activation function from within
the included js file itself at the bottom of the all the variable
declarations.

> 2. To make DIV tags in the main page and when  .js file is 
> loaded to modify 
> their content from the .js file. It did not work although the 
>  same JS code 
> copied and pasted in the main page worked.

Same deal.  

> What is your advice ?

Show us some code.

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168 




More information about the thelist mailing list