开发者

How to redirect to a bookmark URL in crossrider?

In crossrider, I've a function in the background-codes as

function buttonClick() {
  alert(2);
  // simulates similar behavior as an HTTP redirect
  var url = "http://12bubbles.com";    
  window.location.replace(url);
}

After installing the extension, when buttonClicked() is called, the alert() did pop up but the redirect d开发者_如何转开发oesn't work. Is something wrong with my codes??


Finally figured out. If anyone is facing the same problem, I simple had to use their own API

function buttonClick() {
      alert(2);
      // simulates similar behavior as an HTTP redirect
      var url = "http://12bubbles.com";    
      appAPI.openURL(url, "current");
    }


Try window.location.href = url;


window.location.href = url; 

is the proper syntax

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜