如何使用Ajax重新加载页面

时间:2013-03-20 11:00:49

标签: javascript jquery ajax

我有函数addFeaturesToScene,它使用ajax创建一个新的URL。

功能结束后,我需要自动转到新网站

这是代码:

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?

 }
 });

 }

1 个答案:

答案 0 :(得分:2)

您可以使用window.location

window.location.href = 'http://example.org';
相关问题