function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vijaymindvijaymind 

Window.open issue on VF page

Hi All,

 

I have a outputLink or href  and onclick calling window.open('{!anyotherwebsite}');

its opening https://c.cs12.visual.force.com/apex/anyotherwebsite.......

but I only want to open a site like 

http://www.google.co.in/

 

 

so when I am passing anyotherwebsite varible from controller and binding in window.open its not working and if I pass it directly like

window.open('http://www.google.co.in/'); it works perfectly ?

 

Any solution so that we can pass url from controller varibale and it open just web site name rather than including https://c.cs12.visual.force.com/apex/....

 

 

Thanks

Vijay

 

Best Answer chosen by Admin (Salesforce Developers) 
Avidev9Avidev9

Have you tried including the full URL ? I mean starting from http: ? some thing like http://www.anywebsite.com ?

All Answers

Avidev9Avidev9

Have you tried including the full URL ? I mean starting from http: ? some thing like http://www.anywebsite.com ?

This was selected as the best answer
vijaymindvijaymind

Thanks for reply.

 

Yes I treid and it works. but the problem is already I have a URL field if I set the value into that like

www.google.com it appears http://google.com ,  I passed the value from controller to VF page it takes www.google.com that is the reason. 

So I thing i'll have to put the whole URL including http in URL field also.

 

 

Thanks

Vijay