I have a html/javascript table/grid that I need to import data from a file, this is not possible without serverside. So I decides to have a FileEcho server that takes a file upload from the table/grid, the problem is I don’t want to refresh the page afterwards, it’s a multipart request, not an ajax request. Is it possible to up the file ajax style?
how can this be done? any solution to my problem?
I have a html/javascript table/grid that I need to import data from a file,
Share
A popular way is to do the file upload in an
iframe(you can set the<form>‘stargetattribute to thenameattribute of youriframe)You can attach an
onloadevent on theiframeto find out when the data has been echoed from the server. From there, you can grab thecontentDocumentattribute from theiframeobject in javascript (from there you could look at theinnerHTMLcontent of thecontentDocument.bodyto see the data).Just note that in IE, you have to use
document.frames['frame_name'].documentinstead ofiframeObject.contentDocumentSee these articles for more info: