Execute script if plugin for <object> tag could not be loaded
<p>I want to execute a script if my  tag failed to load.
Currently I have </p>

<pre><code>&lt;object src="http://foo.com/bar.pdf#navpanes=0" height="580" width="640"&gt;
    &lt;a href="http://foo.com/bar.pdf"&gt;Click here to download the PDF&lt;/a&gt;
    &lt;script type="text/javascript"&gt;
        //&lt;![CDATA[
           window.alert('script executed');
           window.location.href = "http://foo.com/bar.pdf";
        //]]&gt;
    &lt;/script&gt;

&lt;/object&gt;
</code></pre>

<p>But my script gets executed even the PDF plugin is available.</p>
