I'm trying to open a link in a new window / tab but when it opens it does not load.
Controller:
public static Result loadCreateArtigo(){
return ok(request().host()+request().path());
}
JavaScript:
$.SmartMessageBox({
buttons : '[Não][Sim]'
},
function(ButtonPressed) {
if (ButtonPressed === "Sim") {
Controller.loadCreateArtigo().ajax({
success: function(data){
window.open(data);
},
});
});
The 'data' variable returns me the url. What happens is that I open a new tab with the right url but the page does not load. if F5 the page loads right. I'm using Google Chrome. Any suggestions?