/    Sign up×
Community /Pin to ProfileBookmark

IE Problem – Javascript Issue

Alright so here’s the deal, I’m trying to make a flash slideshow come up and then after 6 seconds a popup comes up saying “Would you like to download this slideshow?” to delay the time I made a small iframe to redirect to Javascript after 6 seconds thus initiating the popup and redirect.

Firefox handles it perfectly but IE, of course, does not.

Main Paige:
<html>

<object classid=”clsid?27CDB6E-AE6D-11cf-96B8-444553540000″
codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab
#version=7,0,0,0″ width=”800″ height=”600″>
<param name=movie value=”slideshow.swf” />
<param name=”wmode” value=”transparent” />
<param name=”play” VALUE=”true” />
<param name=”loop” VALUE=”true” />
<param name=”quality” value=”low” />
<embed src=”slideshow.swf” quality=”low” wmode=”transparent”
pluginspage=”http://www.macromedia.com/go/getflashplayer” type=”application/x-
shockwave-flash” width=”800″ height=”600″>
</embed>

<body bgcolor=”#0000FF”>
<br>
<iframe src =”external.htm” width=”1px” height=”1px”>
<p>Your browser does not support iframes.</p>
</iframe>

</html>

Where iFrame starts before redirect to code: (external.htm)
<meta http-equiv=”refresh” content=”6;url=external2.htm”>

Where iFrame Redirects to (starting Javascript code…):
<script>

alert(“Would you like to download this slideshow?”);
location = “slideshow.zip”;

</script>

Any help is good help!

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@PadonakFeb 02.2010 — try this:

<html>

<head>

<script language="JavaScript" type="text/javascript">

function ask(){document.getElementById('offer').style.display = 'block';}

</script>

</head>

<body onload="setTimeout('ask()', 6000)">

<!--here goes your flash -->

<div id="offer" style="display:none">

Would you like to download this slideshow?

<br><br>

<a href="slideshow.zip">download</a>

</div>

</body>

</html>
Copy linkTweet thisAlerts:
@myworldplzauthorFeb 03.2010 — I wanted it too

Show Javascript Alert (like would you like to download?) and then they click ok and it redirects to download file.

alert(message);

redirect"slide.ppt"

(not real code, but what I wanted ;-P lol )
Copy linkTweet thisAlerts:
@myworldplzauthorFeb 03.2010 — anyone?
Copy linkTweet thisAlerts:
@astupidnameFeb 04.2010 — You may be looking to use a 'confirm' box?:
&lt;script type="text/javascript"&gt;
window.onload = function () {
setTimeout(function () {
var bool = confirm("Would you like to download this slideshow?n(Click o.k. to download or cancel to continue)");
if (bool) {
location.href = "slideshow.zip"; //this works, but sucks because IE will force user
//to click security bar to download the file. IE requires user to directly click something (on the page)
//to initiate a download instead.
}
}, 6000);
};
&lt;/script&gt;


The alternative is along the lines of what Padonak already suggested to you:
&lt;script type="text/javascript"&gt;
window.onload = function () {
setTimeout(function () {
var bool = confirm("Would you like to download this slideshow?n(Click o.k. to access download panel, or cancel to continue)");
if (bool) {
var el = document.getElementById('offer');
el.style.display = 'block';
}
}, 6000);
};
&lt;/script&gt;
&lt;div style="position:relative;"&gt;
&lt;div id="offer" style="position:absolute; z-index:32456; top:30px; display:none; background-color:#8FBC8F; border:6px ridge gray; padding:1px 4px;"&gt;
&lt;a href="slideshow.zip" onclick="document.getElementById('offer').style.display = 'none'; return true;"&gt;download slideshow.zip&lt;/a&gt;
&lt;/div&gt;
some content
&lt;/div&gt;

All things considered though, all this hocus pocus is unnecessary, and users really don't want to be bothered with alerts or confirms, just place a simple link: &lt;a href="slideshow.zip"&gt;Download slideshow.zip&lt;/a&gt; on the page and leave it there, they will see it and use it if they want to.
Copy linkTweet thisAlerts:
@myworldplzauthorFeb 04.2010 — This is where web designing really bugs me :-p...

Is there no way to get around this?
×

Success!

Help @myworldplz 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...