~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/browser/media/browser.js

  • Committer: William Grant
  • Date: 2009-12-07 02:48:40 UTC
  • Revision ID: grantw@unimelb.edu.au-20091207024840-thi3y4y5rc8lih0g
In the filebrowser upload callback, don't assume that the browser will generate a head element.

Chromium doesn't, which broke file upload refreshing in Chromium.

Show diffs side-by-side

added added

removed removed

Lines of Context:
379
379
    if (upload_callback_count >= 2)
380
380
    {
381
381
        myFrame = frames['upload_iframe'].document;
382
 
        data = myFrame.firstChild.childNodes[1].firstChild.firstChild.nodeValue;
 
382
        /* Browsers will turn the raw returned JSON into an HTML document. We
 
383
         * need to get the <pre> from inside the <body>, and look at its text.
 
384
         */
 
385
        data = myFrame.firstChild.getElementsByTagName(
 
386
            'body')[0].firstChild.firstChild.nodeValue;
383
387
        data = JSON.parse(data);
384
388
        if ('Error' in data)
385
389
            alert("Error: " + decodeURIComponent(data['Error']));