简体   繁体   English

如何使用Ajax重新加载页面

[英]How to reload page using Ajax

I have function addFeaturesToScene which make a new URL using ajax. 我有addFeaturesToScene函数,它使用ajax创建一个新的URL。

After the function ends I need to go to the new site automatically 功能结束后,我需要自动转到新站点

Here is code: 这是代码:

function addFeatureToScene(featureNid, sceneNid)
  {
  alert(featureNid + " -> " + sceneNid);

     $.ajax({
    type       : 'GET',
    url        : '/copy-feature-and-add-it-to-scene/' + featureNid + '/' + sceneNid,
    dataType   : 'json',
    async      : false,
    success    : function(reply) {

            //Code to open a page with a new url?

 }
 });

 }

您可以使用window.location

window.location.href = 'http://example.org';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM