ASP error: the object tag cannot be placed in another object tag.

Source: Internet
Author: User
When writing ASP Program An error is prompted, "the object tag cannot be placed in another object tag ". Code For example:

<Object>
<! -- [If! IE]> -->
<Object type = "application/X-Shockwave-flash" Data = "Flash/banner.swf">
<! -- <! [Endif] -->
<! -- [If! IE]> -->
</Object>
<! -- <! [Endif] -->
</Object>

This is the code automatically generated when Dreamweaver cs4 inserts flash. Due to the poor compatibility of IE with objects, conditional annotations are used here. The code is nested with objects, in this way, the code can be correctly executed in any browser, But if you write a program using ASP, you should be careful. Although this is an HTML code, the ASP interpreter considers that the object cannot be nested with an object, the error "the object tag cannot be placed in another object tag" is a bit strange. The program on the server side actually intervened in the client's home affairs. It seems that ASP is indeed old and cannot keep up with the times...
The problem always needs to be solved. You can do this without using the object tag or the embed tag. However, the object is a W3C recommendation standard and has more powerful functions than the embed, what should I do if I have to use an object at this time? In fact, it is very simple. The purpose is not to let ASP see the object nesting. The Code is as follows:

<% Response. Write ("<Object>") %>
<! -- [If! IE]> -->
<Object type = "application/X-Shockwave-flash" Data = "Flash/banner.swf">
<! -- <! [Endif] -->
<! -- [If! IE]> -->
</Object>
<! -- <! [Endif] -->
</Object>

In this way, ASP will not regard it as object nesting and directly output it to the client.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.