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
GV1GV1 

open a new webpage when click "apex:outputLink"

Can you give me sample code for opening a new webpage when I click on a image.

This is the image display:-

 

<apex:image url="{!URLFOR($Resource.Playbook_Resource, 'assets/css/img/bestPractice.png')}" onclick="javascript&colon;NewPage('{!object.pageurl}'/> 

 

I am storing the URL of the new image in the field object.pageurl

Best Answer chosen by Admin (Salesforce Developers) 
Val ValinoVal Valino

 

<apex:image url="{!URLFOR($Resource.Playbook_Resource, 'assets/css/img/bestPractice.png')}" onclick="window.open('{!object.pageurl}');"/> 

 

 

 

Try this