Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9020203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:57:32+00:00 2026-06-16T04:57:32+00:00

I am using the YUI3 IO Utility to submit a form with a file.

  • 0

I am using the YUI3 IO Utility to submit a form with a file. The response from the server contains HTML but it is stripped when accessed on the request object.

var form = Y.one('form');
Y.io(form.get('action'), {
    method: form.get('method'),
    form: {
        id: form,
        upload: true
    },
    on: {
        complete: function(id, request) {
            // The server returns a response like <div>response</div>
            console.log(request.responseText); 
            // All HTML is stripped so it just prints 'response' to the console
        }
    }
});

Is this considered the default behaviour? I almost can’t believe that it is not possible to get the full response content …
The server also sets the content-type header properly to “text/html”.

Any help is appreciated! Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:57:34+00:00Added an answer on June 16, 2026 at 4:57 am

    I just had a look at the YUI3 source code. The few lines that are responsible for the request object in https://raw.github.com/yui/yui3/master/src/io/js/io-upload-iframe.js are:

    _uploadComplete: function(o, c) {
        var io = this,
            d = Y.one('#io_iframe' + o.id).get('contentWindow.document'),
            b = d.one('body'),
            p;
    
        if (c.timeout) {
            io._clearUploadTimeout(o.id);
        }
    
        try {
            if (b) {
                // When a response Content-Type of "text/plain" is used, Firefox and     Safari
                // will wrap the response string with <pre></pre>.
                p = b.one('pre:first-child');
                o.c.responseText = p ? p.get('text') : b.get('text');
                Y.log('The responseText value for transaction ' + o.id + ' is: ' +     o.c.responseText + '.', 'info', 'io');
            }
            else {
                o.c.responseXML = d._node;
                Y.log('The response for transaction ' + o.id + ' is an XML     document.', 'info', 'io');
            }
        }
        catch (e) {
            o.e = "upload failure";
        }
    
        io.complete(o, c);
        io.end(o, c);
        // The transaction is complete, so call _dFrame to remove
        // the event listener bound to the iframe transport, and then
        // destroy the iframe.
        w.setTimeout( function() { _dFrame(o.id); }, 0);
    },
    

    So as soon as the response contains a “body” node it returns the body content as “text”.

    o.c.responseText = p ? p.get('text') : b.get('text');
    

    IMHO there is no chance to get the innerHTML if there is a body node. I decided to create a customized IO Upload Iframe module that adds an additional property called “responseHTML” with the innerHTML of the body node.

    You can get the source from Pastebin: http://pastebin.com/WadQgNP2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using YUI3 to do a GET request, but the event handlers aren't
I am using YUI3 rich text editor and onclick of the submit button the
Using CRM 4, I have an entity form that contains a tab with an
I am using YUI3's reset stylesheet and PT Sans from Google webfont. I have
Using SQL Server 2008 R2 we are looking for a way to select the
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using Microsoft SQL Server 2005, is there any way to see when a table
I've got a webpage that validates as XHTML 1.0 Strict. I'm using YUI3 and
When using the YUI3 Autocomplete widget with a URL source which returns JSON data,
I'm using YUI 3 CSS Reset on my page, but want to display a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.