Haris Hajdarevic
Haris Hajdarevic

Reputation: 1575

How to reload page using Ajax

I have function addFeaturesToScene which make a new URL using ajax.

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?

 }
 });

 }

Upvotes: 0

Views: 837

Answers (1)

Mihai Iorga
Mihai Iorga

Reputation: 39724

You can use window.location

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

Upvotes: 2

Related Questions