DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    13

    Exclamation Position a script tag in a DIV probleme with IE

    Hi,

    I'm trying to position a script inside a div. It works fine with FF, but it doesn't with IE 6 and IE 7. The script is printed under the div which is a big red box.

    Here's the code:

    Code:
    <script type="text/javascript">
    document.write('<div style="margin: 0pt; padding: 0pt; background-color: Red; position: relative; width: 145px; height: 145px;" id="PA_transcon10003">');
    document.write('<script style="padding:0; margin:0;" language="JavaScript" type="text/javascript">ord=Math.random()*10000000000000000;document.write(\'<script language="JavaScript" src="http://ad.doubleclick.net/adj/tc.fr.biz.blogues.sguerin;tile=1;sz=145x145;ord=\' + ord + \'?" type="text/javascript"></scr\'+ \'ipt>');</script>');
    document.write('</div>');
    </script>
    Is there a way to force the script tag to be positioned into the DIV not under?

    Thanks

    Steph
    Last edited by steph2004; 03-31-2008 at 03:02 PM. Reason: Problem with IE 7 too

  2. #2
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    there is an ambiguity when you try to write a script inside a script ..
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  3. #3
    Join Date
    Mar 2004
    Posts
    13
    Yeah, I know it looks weird but it's common in Ad publishing that a customer gives a banner to an ad agency and this one gives a banner tag (often a script) to the ad network which gives another banner tag to the web site editor...

  4. #4
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    why u wanna send it as a document.write() .. why not you explicitly write :
    <div>
    <script>
    whatever
    </script>
    </div>
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

Similar Threads

  1. Scrollbars in IE display in the DIV tag
    By Billkamm in forum Web
    Replies: 0
    Last Post: 04-20-2006, 01:58 PM
  2. Replies: 2
    Last Post: 08-23-2005, 02:19 PM
  3. Controls do NOT FIRE in DIV tag?
    By k in forum ASP.NET
    Replies: 1
    Last Post: 06-09-2003, 10:57 AM
  4. Div tag problems
    By keith in forum ASP.NET
    Replies: 1
    Last Post: 02-13-2003, 09:09 PM
  5. div tag problems
    By keith in forum Web
    Replies: 0
    Last Post: 02-12-2003, 10:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links