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

Parse JS in Div?

Status
Not open for further replies.

MikeBarone

Programmer
Mar 1, 2001
354
US
Okay, we are trying to setup an array of javascript calls that will display in a DIV/LAYER/ILAYER at set intervals.

For example:
arrayItem[0] = &quot;<scr&quot;+&quot;ipt language=javascr&quot;+&quot;ipt>alert(\&quot;test1\&quot;);</scr&quot;+&quot;ipt>&quot;;
arrayItem[1] = &quot;<scr&quot;+&quot;ipt language=javascr&quot;+&quot;ipt>alert(\&quot;test2\&quot;);</scr&quot;+&quot;ipt>&quot;;

Then using setTimeout we move through the lint off array items displaying the code in a crossbrowser DIV configuration.

<ilayer id=&quot;l1&quot;>
<layer id=&quot;l2&quot; width=&quot;468&quot;>
<div id=&quot;l1&quot;>
<div id=&quot;l3&quot; style=&quot;position:relative&quot;>
</div>
</div>
</layer>
</ilayer>

The problem is, we can't get the javascript to parse when it is called into the DIV/LAYER/ILAYER. Does anyone know what we might be doing wrong?
Mike Barone
FREE CGI/Perl Scripts & JavaScript Generators
Ace PopUp Generator Software - Totally FREE
 
Hi Mike,

Not too sure what might be causing that but here are a few suggestions that usually solve any troubles I encounter.

1. Call the setTimeout script at onload, since the div's are only safely available when the page is fully loaded.

2. Use position:absolute, this will make positioning a bit tricky, but it will enable the use of several properties that can't be used (correctly) with relative. (eg: visibility)

Hope this helps? :p

Gtz,

Kristof
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top