Címlap > Hírek > Naplóm > About ie error hwdvideoshare azaz videó oldal

Hírolvasó

Véletlen kép

EzmegAz_001...
Spectaculum...
Itthon_vagy...
About ie error hwdvideoshare azaz videó oldal PDF Drucken E-Mail
There are no translations available.

The Internet Explorer Bug

It's easy to create runtime errors in JavaScript, but it's not every day you find a way to crash the runtime entirely. It looks so innocent, yet the following code will completely crash Internet Explorer... copy/paste this into a simple HTML file and open it using Internet Explorer.

<html>
<head>
    <script type="text/javascript">
    function appendToBody() {

        var span = document.createElement('span');

        document.body.appendChild(span);       

    }
    </script>
</head>
<body>
    <form>
        <script type="text/javascript">
            appendToBody();
        </script>
    </form>
</body>
</html>

 

You will see a popup alert that states:

Internet Explorer cannot open the Internet site... Operation aborted

The technical cause of the error is you can't append to the BODY element from a script that isn't a direct child to the BODY element.

If you research it enough, you will find that some people ran into this when they had script inside a <table> element. The proposed fix was to move the script outside the <table> element. However, that would only work if the
was a direct child to the body! If the table is inside yet another element, it will still fail. Additionally, it is too much to expect users to start modifying their Joomla templates.

Why does it affect hwdVideoShare?

hwdVideoShare uses the SWFobject javascript to embed video players, and most Joomla websites use Mootools at the same time. Depending on the design of your Joomla template, and the combination of Javascript Framworks, you can suffer from the Operation Aborted error.

Possible Solutions

One possible solution (that works for some people) is adding the defer="defer" tag to the SWFobject javascript. However, depending on the (load) order of the linked javascripts, the Operation Aborted error can still occur and therefore this is not a suitable solution.

Another solution is to place the SWFobject javascript into a domready (or load) event, so it will be compatible with other mootools functions and scripts (eg when you use Slimbox or Mediabox)

Using the domready() event:

<script type="text/javascript">
  window.addEvent('domready', function(){
  var so = new SWFObject("movie.swf","mymovie","400","200","8", "#336699");
  so.write("flashcontent");
  });
</script>

Instead of:

<script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
so.write("flashcontent");
</script>

Applying the fix in hwdVideoShare

Login to the hwdVideoShare administrator and visit the General Settings. Find the option for Internet Explorer "Operation Aborted Error" Fix, and switch it to Yes and make sure Load SWFObject is enabled.

Try opening the video page again. If it still gives the same error try disabling the Load SWFObject option.

Still having problems?

If you are using the most recent version of hwdVideoShare and still experience this problem please contact us so that we can debug your system to isolate the cause.
Zuletzt aktualisiert am Donnerstag, 15. Oktober 2009 um 20:42 Uhr