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
mdinatalemdinatale 

Newbie Controller help

I have a custom object which i have choosen open window using a visualforce page. in the Page i have javascript that should pop up a alert but it doesn't, What am i doing wrong, Thanks

WorkhardWorkhard

Hi,

Are you calling your javascript method on load of your VF Page????????????????

mdinatalemdinatale

heres a example of code

 

<apex:page >
<script type="text/javascript">
function init()
{
alert('hi');
}
</script>
<body onload="init()">

</body>

</apex:page>

 

Where do i call the controller on my object to load when i bring up the edit screen

WorkhardWorkhard

Hi.

Try the below code:

<apex:page >
<script type="text/javascript">
function init()
{
alert('hi');
}
window.onload=init;
</script>
</apex:page>