我有下面的代码,在开发机器上工作正常,但从远程浏览器调用时却没有...
$.ajax({
type: 'POST',
url: '@Url.Action("Action", "Controller")',
data: { id: id },
dataType: 'json',
async: true,
success: function (data) {
},
error: function (jqXHR, status, err) {
var result = jqXHR.responseJSON;
}
});
Run Code Online (Sandbox Code Playgroud)
jqXHR.responseJSON对象在从localhost调用时工作,但是当从远程计算机调用时没有,它返回为未定义...有人可以帮助我吗?提前致谢!
我正在构建一个 angular 5 应用程序,但在玩路线时遇到了麻烦......
我有 2 个主布局,每个布局都有如下子路由:
SiteLayoutComponent - HomeComponent AppLayoutComponent - ContactComponent
我的问题是默认路由,当应用程序第一次加载时,使用空 URL,路由器必须重定向到 Home 组件,它有子路由“SiteLayoutComponent”,这里的问题是它只加载了 HomeComponent 但不是具有<navbar-component>. 它仅在浏览器中输入 /home 时有效。以下是我的路线:
const appRoutes: Routes = [
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
},
//Site routes goes here
{
path: 'home',
component: SiteLayoutComponent,
children: [
{
path: '',
component: HomeComponent
}
]
},
//App routes goes here
{
path: 'app',
component: AppLayoutComponent,
children: [
{ path: 'contact', component: ContactComponent }
]
},
//No layout routes
{
path: …Run Code Online (Sandbox Code Playgroud) single-page-application angular-routing angular-components angular