Beim Umstellen meiner Seite auf XHTML stellte das WordPress-Plugin „WP GuestMap“ eine weitere kleine Hürde dar. Hierbei handelt es sich um das Plugin, das auf meiner „Besucher“-Seite die Weltkarte mit den Herkunftsorten aller bisherigen Besucher anzeigt.
Bisher hatte ich diese Karte per IFrame eingebunden. Zwar bietet das Plugin im Backend auch einen Codeschnipsel für eine XHTML-gerechte Einbettung als Objekt an, doch dieser wollte im Firefox einfach nicht funktionieren: Statt einer Karte sah man dort – nichts. Der Code sah wie folgt aus:
[:]
[:en]
When converting my site to XHTML, the WordPress plugin „WP GuestMap“ posed another little obstacle. It is the plugin that I use on the „Visitors“ page to display the world map with the hometowns of all visitors.
Until now, I had implemented the map via IFrame. Although the plugin does offer a code snippet for XHTML-conform embedding as an object, it just didn’t work in Firefox: Instead of a map, it displayed – nothing. The code looked as follows:
[:]
[:de]
Nachdem ich mich dann endlich mal durch einen Artikel auf AListApart.com:“Flash Satay: Embedding Flash While Supporting Standards(AListApart.com)“:http://www.alistapart.com/stories/flashsatay durchgearbeitet hatte, dessen Lektüre ich schon seit Wochen vor mir hergeschoben hatte, wußte ich dann, wo der Hase im Pfeffer liegt: Es war das Attribut classid
, das störte!
(…) the GUID used in the classid attribute was specific to the browser’s ActiveX configuration. In fact, it was causing Netscape 7 and Mozilla to totally ignore the object.
Im Klartext heißt das: classid
ist nur was für den Internet Explorer, damit er weiß, mit welchem Player/Programm er das Objekt abspielen/anzeigen muß. Es gibt aber für genau diesen Zweck noch ein weiteres Attribut, das von allen Browsern verstanden wird, nämlich das type
-Attribut. Wie man sieht, enthält der von „WP GuestMap“ erzeugte Code ja bereits eine type
-Angabe. Wozu dann also noch die völlig unnötige classid
? Weg damit!
Und schon läuft’s auch im Firefox! Dieser kleine Kniff ist natürlich nicht nur bei HTML-Objekte wie diesem hilfreich, sondern bei allen anderen auch. Lediglich die type
-Angabe muß verändert werden. Für ein Flash-Objekt müßte sie beispielsweise type="application/x-shockwave-flash"
lauten.
After I had finally struggled through an article on AListApart.com:“Flash Satay: Embedding Flash While Supporting Standards(AListApart.com)“:http://www.alistapart.com/stories/flashsatay that I had delayed reading for weeks already, I knew what the snag was: It was the attribute classid
that caused the trouble!
(…) the GUID used in the classid attribute was specific to the browser’s ActiveX configuration. In fact, it was causing Netscape 7 and Mozilla to totally ignore the object.
To say it clearly: classid
is only for Internet Explorer, to let it know which player/program it should use to play back/display the object. There is, however, another attribute for the very same purpose which is understood by all browsers, namely the type
attribute. As you can see, the code generated by „WP GuestMap“ already contains a type
declaration. So what’s the point of the totally superfluous classid
? Hence with it!
And now it works in Firefox, too! This little knack is not only helpful with HTML objects like this one, but with all the others as well. Only the type
statement must be changed. For a Flash object for example, it would have to be type="application/x-shockwave-flash"
.
3 Antworten zu “[:de]Objekt wird im Firefox nicht angezeigt?[:en]Object not showing up in Firefox?[:]”
und wie sieht es bei javascripten aus, im IE werden die scripte angezeigt, und im Firefox nicht. Habe ebayAD laufen, rechts im oben im Sidebar. Ich persönlich sehe den nur im IE, leider im Firefox nicht.
Also, bei mir wird da im Firefox alles angezeigt – vorausgesetzt, ich deaktiviere Adblock und erlaube JavaScripts von wepmasterplan.com und intensifier.de.
Aber wer will schon Werbung sehen. :P
Great post!!! You just helped me solve the problem I was having with Firefox, and none of the dozens of other pages that came up first in Google even *mentioned* „classid“ as being any kind of a problem. Thanks!