如何获取html文件作为对象

How to GET html file as object?

本文关键字:文件 对象 html 何获取 获取      更新时间:2023-09-26

我尝试将html文件作为对象而不是SWF文件,但我真的无法弄清楚。有人知道该怎么做吗?这是我的请求函数:

function loadFolderStructure( strPath, $currentSelectItem ) {
    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 );
            }
        });
    } else {
        rendSelects( $currentSelectItem, strPath );
    }
}

我不完全明白你的要求,但如果你想将HTML页面作为一个对象,你可以尝试:

    var x = document.documentElement