nageeb2016 / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

removeSWF does not work when response type is application/xhtml+xml #613

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Recreate the page 
http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/test_api_create_remove.h
tml on a server with response type application/xhtml+xml
2. Click Create SWF then Remove SWF
3. The SWF is not removed

What is the expected output? What do you see instead?
The expected output is that the SWF will be removed.  Instead the SWF is not 
removed ;)

This line of code in the function removeSWF is the culprit:

if (obj && obj.nodeName == "OBJECT") { ... }

When the server is application/xhtml+xml, the nodeName of an element is 
lowercase.

What version of the product are you using? On what operating system?
2.2, Windows 7 Enterprise 64-bit

Please provide any additional information below.
The fix for this is very easy, just need to change

obj.nodeName == "OBJECT"

to

obj.nodeNametoUpperCase() == "OBJECT"

Original issue reported on code.google.com by evangel...@gmail.com on 6 Jan 2012 at 2:11

GoogleCodeExporter commented 9 years ago
Sorry, obj.nodeNametoUpperCase() == "OBJECT" should be

obj.nodeName.toUpperCase() == "OBJECT"

Original comment by evangel...@gmail.com on 6 Jan 2012 at 2:12

GoogleCodeExporter commented 9 years ago
Sorry, SWFObject does not support application/xhtml+xml. This is explicitly 
stated in the docs.

http://code.google.com/p/swfobject/wiki/documentation#Does_SWFObject_2_support_M
IME_type_application/xhtml+xml?

Original comment by platelu...@gmail.com on 6 Jan 2012 at 9:15