/    Sign up×
Community /Pin to ProfileBookmark

flash sniffer & something wrong with my document.write?

This has been wearing me out for – ohh, DAYS! I suspect it’s a tiny bit of wrong syntax …. Please, please, can one of you experts help me spot the problem??? ?

Trying to write my first-ever totally standards-compliant page, I used Ian Hickson’s compliant Flash script (you can’t use the standard one because the <embed> tag doesn’t validate) from [url]http://ln.hixie.ch/?start=1081798064&order=-1&count=1[/url]

It works brilliantly.

However, I also want to deploy Colin Moock’s Flash & Javascript sniffer, ([url]http://www.moock.org/webdesign/flash/detection/moockfpi/[/url]) so that people without the right Flash version, and those without Javascript, can see alternative content instead.

That means I have to turn Mr Hickson’s Flash script into a document.write segment in the sniffer script – am I explaining this OK?

My problem now is that the page won’t load properly in IE. It seems to be waiting for something else (1 item remaining).

Either script does the job 100% on its own – so there’s something wrong with the way I’ve put them together.
The problem [i]seems[/i] to be that IE isn’t “seeing” that it should ignore the second part of the Flash script. I think!

Anyway, here’s the relevant part of my code:

[code]<script language=”javascript” type=”text/javascript”>
<!–
if (!useRedirect) {
if(hasRightVersion) {
var oeTags = “<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″”
+” codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0″”
+” width=”250″ height=”60″>”
+” <param name=”movie” value=”images/internet-grey.swf” />”
+” <param name=”quality” value=”high” />”
+” <param name=”SCALE” value=”exactfit” />”
//[if !IE]
+” <object data=”images/internet-grey.swf””
+” width=”250″ height=”60″ type=”application/x-shockwave-flash”>”
+” <param name=”quality” value=”high” />”
+” <param name=”SCALE” value=”exactfit” />”
+” <param name=”pluginurl” value=”http://www.macromedia.com/go/getflashplayer” />”
+” </object>”
//[endif]
+” </object>”;
document.write(oeTags);
}
else {
var alternateContent=
‘<a href=”IAB_Online_Marketing_in_2004.html”><img src=”/images/UKspendstatic.jpg” alt=”UK Online Marketing Data” width=”250″ height=”60″ border=”0″ /></a>’;
document.write(alternateContent); // insert non-flash content
}
}

//–>
</script>
<noscript>
<a href=”IAB_Online_Marketing_in_2004.html”><img src=”/images/UKspendstatic.jpg” alt=”UK Online Marketing Data” width=”250″ height=”60″ border=”0″ /></a>
</noscript>[/code]

Oh look, that’s funny! (There isn’t a smiley in my code; it was a colon and a D)

If anyone wants to see this in (flawed) action, it’s at [url]http://www.no-url.co.uk/index1.html[/url]

I am [b]stumped[/b]

Hope you can sort me out!
Thank you
Cherry

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @CherryAA spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...