Jquery $get with ms-appdata:// prefix

Jquery $get with ms-appdata:// prefix

本文关键字:prefix ms-appdata with get Jquery      更新时间:2023-09-26

我得到了html与jquery托管在我的Windows Universal (Windows 10) WebView作为Web托管应用程序。我得到了这个问题:

当我试图加载本地资源时,例如:

"ms-appdata://local/test.js" 

从javascript与$get函数我得到网络错误的错误回调…主要问题是,我正在加载的html远程(我的位置。Href是我的服务器域名)

我怎样才能使它工作?

我看到我在JQuery库中有这个方法- ajaxPrefilter所以我把这个库添加到我的脚本中(我知道我说过没有库-但这个确实帮助了我)

我是这样克服这个问题的:

$.ajaxPrefilter(function (options) {
        if (options && options.url) {
            //this is where I can manupulate my url
            //after resolving the requested data I can call options.success event with it
        }
    });