-
DHTML Script
Hello,
I wrote a Javascript to create dynamically DIV and insert a content in it.
I have the following problem: If i insert a script in a DIV section, this
script is not executed.
Here is the samples
Sample 1:
<HTML>
<BODY>
<DIV>TOTO<SCRIPT>document.write('tutu');</SCRIPT></DIV>
</BODY>
</HTML>
This sample 1 works, and we will see TOTOtutu if we display the HTML page.
Here is that I try to do using DOM
Sample 2:
<HTML>
<BODY>
<script language="JavaScript1.2">
oDiv = document.createElement("DIV");
document.body.appendChild(oDiv);
oDiv.innerText="TOTO<SCRIPT>document.write('tutu')</SCRIPT>";
</script>
</BODY>
</HTML>
But it does not work.
Could someone help me please.
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks