You need to sign in to do that
Don't have an account?

open new window in remoteAction response
For the life of me, I cannot get this to work.
I have a remoteAction method returning a URL String. I am then trying to use window.open to open that URL. For some reason, the browser will not launch a new window and open that URL. I am certain my code is hitting that line. Below is a generic example of what I am trying to do.
mynamespace.mycontroller.getMyURL(inputString, function(result, event){ if (event.status) { window.open (result); } , {escape:true});
I wanted to do a new window and did get it to work. The key was first running a console.log(this); command to let me understand the scope of the script. It was a DOM Window that was actually output when I did this. I got my code working by using this.open(...); instead of window.open.
All Answers
Hi hemm,
try to alert and check whether returned url is proper or not.
Yes, it's a good URL. I've even tried to just open google.com. No dice. Can you run code that actually works? Please test it to make sure it actually launches a URL in a new window/tab.
Hi hemm,
It works fine if we use self.parent.location instead window.open.
seems that there's some issue with it.
I wanted to do a new window and did get it to work. The key was first running a console.log(this); command to let me understand the scope of the script. It was a DOM Window that was actually output when I did this. I got my code working by using this.open(...); instead of window.open.
ohh, good to know the solution. :)
Hi,
I am facing similar problem, could you please share the full code (VF page & Controller).
Thanks in advance.