extjs6的Ext.Ajax.request中怎么跳转到其他js页面 
时间: 2023-05-19 13:02:24 浏览: 81
您可以使用Ext.Ajax.request中的success回调函数来实现页面跳转。在success回调函数中,您可以使用window.location.href属性来跳转到其他页面。以下是一个示例代码:
Ext.Ajax.request({
url: 'your_url',
success: function(response){
//跳转到其他页面
window.location.href = 'other_page.html';
}
});
相关问题
extjs6的Ext.Ajax.request中怎么跳转到其他页面
在Ext.Ajax.request中跳转到其他页面可以使用Ext.dom.Helper的append方法将返回的HTML代码插入到当前页面中,然后使用window.location.href跳转到目标页面。具体代码如下:
Ext.Ajax.request({
url: 'targetPage.html',
success: function(response){
Ext.dom.Helper.append(document.body, response.responseText);
window.location.href = 'targetPage.html';
}
});
extjs实现登录页ajax请求的代码
以下是 extjs 实现登录页 ajax 请求的代码示例:
```
Ext.Ajax.request({
url: 'login.php',
method: 'POST',
params: {
username: 'myusername',
password: 'mypassword'
},
success: function(response){
var text = response.responseText;
// process server response here
},
failure: function(response){
var text = response.responseText;
// process server response here
}
});
```
以上代码中,我们使用 Ext.Ajax.request 方法来发送一个 POST 请求到 login.php 页面,同时传递了用户名和密码参数。在请求成功或失败后,我们可以通过 success 和 failure 回调函数来处理服务器返回的响应数据。
相关推荐









