-5

I try to fetch some files but one of the format is HTML which should be embedded in iFrame. For this request I am using AJAX and JSON as data. Does anyone know how to call a HTML file? Now it is calling SWF files.

if ( 'undefined' === typeof(fsStructure[strPath]) ) {
        $.ajax({
            'url'       : '../php/navigator.php',
            'dataType'  : 'json',
            'data'      : {'tarFolder':strPath},

            success : function( respObj, textStatus, jqXHR ) {
                if ( 'undefined' !== typeof(respObj['status']) ) {
                    if ( 
                            ('success' === respObj['status']) && 
                            ('undefined' !== typeof(respObj['subfolders'])) && 
                            ('undefined' !== typeof(respObj['subswfs'])) ) {

                        processNewDFData( respObj, $currentSelectItem, strPath );
                    } else {
                        alert( conf.messages.bad_response_format );
                    }
                } else {
                    alert( conf.messages.bad_response_format );
                }
            },
            error : function( jqXHR, textStatus, errorThrown ) {
                alert( conf.messages.failed_ajax_request );
            }
        });
    }
  • My code is looking in data folder and there are more file types swf and html. And now I can get only swf files and I want to get html files as well – Marius Hincu Jun 12 '15 at 12:30

1 Answers1

0

You can get the html files with the jquery get request.

$.get('/yourfile.html', function (data) {
   console.log(data);
});
PeeHaa
  • 71,436
  • 58
  • 190
  • 262
Umesh Sehta
  • 10,555
  • 5
  • 39
  • 68