Results 1 to 5 of 5

Thread: IE DOM problems...?

  1. #1
    Join Date
    May 2006
    Location
    Alaska
    Posts
    163
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Default IE DOM problems...?

    First, this only applies to IE, because IE is the only browser I can't get something to work in. So I want to dynamically create this Flash element right?
    Code:
    window.onload = function () {
    	var fe = document.createElement ("object");
    	fe.setAttribute ("type","application/x-shockwave-flash");
    	fe.style.width = "100px";
    	fe.style.height = "100px";
    	var me = document.createElement ("param");
    	me.setAttribute ("name","movie");
    	me.setAttribute ("value","test.swf");
    	fe.appendChild (me);
    	document.body.appendChild (fe);
    };
    I get this 100 x 100 Flash element with nothing in it and when I right click it says "Movie not loaded...". Then I find what IE says "fe.outerHTML" is (I know it's bad, but it's only to see what IE thinks). Then I put that in the page.
    Code:
    <OBJECT style="WIDTH: 100px; HEIGHT: 100px" type=application/x-shockwave-flash><PARAM NAME="movie" VALUE="test.swf"><PARAM NAME="_cx" VALUE="5080"><PARAM NAME="_cy" VALUE="5080"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Src" VALUE=""><PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE=""><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE=""><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="false"></OBJECT>
    Now that works. Why doesn't the first one work? It does in FF (except for FF it has to be "data" rather than "movie").

    Thanks,
    Stephen

  2. #2
    Join Date
    May 2006
    Location
    Alaska
    Posts
    163
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Default

    Help? Please? Well I found something else out that's really weird. If I add
    Code:
    document.body.innerHTML += fe.outerHTML;
    to the end of the other, then two of the Flash elements appear that have loaded. I take it away, the one that hasn't loaded. I put it back, two loaded again. Can anyone explain this? Please?

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,165
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    I have no clue why this is happening to begin with. However, if what you've been saying is true, this may take care of the problem, replace:

    Code:
    document.body.innerHTML += fe.outerHTML;
    with:

    Code:
    /*@cc_on @*/
    /*@if(@_jscript_version >= 5)
    fe.outerHTML = fe.outerHTML;
    @end @*/
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    May 2006
    Location
    Alaska
    Posts
    163
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Default

    What's all the other stuff about?
    Code:
    /*@cc_on @*/
    /*@if(@_jscript_version >= 5)
    fe.outerHTML = fe.outerHTML;
    @end @*/
    But thanks! Just fe.outerHTML = fe.outerHTML works, do I need the rest?
    This is just another reason that IE is crazy...

    Thanks again,
    Stephen

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,165
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    That other code is proprietary IE conditional code. Whatever is inside of it will only be parsed by IE. All others see it as a javascript comment.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •