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
prazonprazon 

How to pass an Object reference in a javascript

Hi I am trying to go for this code in custom button in a page layout but cannot make Account as standard controller or pass a custom controller. Can anybody please help

 

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}



function insertScript(){ 
	
        var box = new SimpleDialog("hersh"+Math.random(), true); 
	      parent.box = box; 
	      box.setTitle("Account Page"); 
	      box.createDialog(); 
	      box.setWidth(350); 
	      box.setContentInnerHTML("<apex:page standardController="{!Account}"><h1>Congratulations {!Account.Name}</h1><br/>This is your new Page<br/><button class='btn'       onclick='window.parent.box.hide(); return false;'>Cancel</button></apex:page>"); 
	      box.setupDefaultButtons(); 
	      box.show(); 

} 


insertScript();

 

Starz26Starz26

What exactly are you trying to do?

 

Adding apex tags to an element will not do anything but display the text.

 

Apex tages are rendered as html/java on the server and served to the client.

prazonprazon

hi,

 

I want to render a visualforce page as a modal dialog with showing values from the database