0

I want a callback that is executed after an <applet> element is loaded:

// Create element
var $applet = $("<applet></applet>");

// Attach handler
$applet.load(function() {
    alert('applet loaded');
});

// Set attributes
$applet.attr({
    style: 'position:absolute;left:-1px',
    name: 'TiddlySaver',
    code: 'TiddlySaver.class',
    archive: 'TiddlySaver.jar',
    width:'1',
    height:'1',
});

Why is the 'load' event handler not executed for an <applet> element? If I change the <applet> to an <img> element (with valid src attribute) the handler is executed.


Have you tried vlc?I once used vlc for streaming. You can have a look at here.

4

2 に答える 2

2

HTML 4.01 (Web ページの基本的な標準) によると、onload 属性を持つ要素は body と frameset の 2 つだけです。他のいくつかの要素も独自の拡張機能としてそれをサポートしています (画像はかなり一般的です) が、他の要素がそうすることを期待すべきではありません。

HTML5 では、すべての HTML 要素 (固有の body を除く) が load イベントをサポートする必要がありますが、まだ広く実装されているか完全に実装されているとは言えません (仮にあったとしても)。

于 2011-05-08T11:43:23.310 に答える