我一直在尝试这项工作但到目前为止还没有运气.我不清楚最新情况,但我会尽力解释.我的服务器端jsp页面都使用ISO-8859-1编码,我不想改变.所有请求/响应都是xml格式.POST请求当前正在使用javascript escapeURIComponent函数,一切都运行良好,直到有一个特殊字符,例如字符串:hello°world©®™test.当这个字符串escapeURIComponent从IE中被POST(与数据部分一起),并且当重新加载页面时应该获得相同的字符串,该字符串将呈现为:hello°world©’¢test
我假设发生这种情况是因为encodeURIComponent函数将字符串编码为UTF-8,而不是ISO-8859-1,并且当页面呈现时,UTF-8被解释为ISO-8859-1字符,因此显示字符串乱码.
有没有办法解决这个问题,而无需将网页转换为UTF-8字符集?
POST请求的Content-Type设置为"application/x-www-form-urlencoded"
提前致谢.
我开始在sidemenu入门应用程序之上构建离子应用程序.初学者应用程序有一个基本状态'app',它是抽象的,所有sidemenu页面都是应用程序的子项,例如app.search,app.browse,app.playlists等.
我有类似的等级.但是,我希望起始页面是其他页面,这意味着它处于应用程序级别.
州看起来像这样:
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html",
controller: 'AppCtrl'
})
.state('join', {
url: "/join",
views: {
'menuContent' :{
templateUrl: "templates/join.html",
controller: 'joinCtrl'
}
}
})
.state('app.search', {
url: "/search",
views: {
'menuContent' :{
templateUrl: "templates/search.html",
controller: 'searchCtrl'
}
}
})
.state('app.results', {
url: "/results",
views: {
'menuContent' :{
templateUrl: "templates/results.html",
controller: 'resultsCtrl'
}
}
});
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/join');
Run Code Online (Sandbox Code Playgroud)
当我运行应用程序时,网址默认为
http://192.168.1.4:8100/#/join
Run Code Online (Sandbox Code Playgroud)
并显示一个空白页面.显然,join.html不是空白的.此外,不输出joinCtrl中的console.log消息.
我无法弄清楚为什么没有加载加入页面.当我改变其他指向'/ app/search'时,一切正常. …