In the code below, the alert doesn't work. If the I take out the loadleads function, then the alert does work. What's the issue?
<apex:page showHeader="true" sidebar="false" controller="LeadSearchJS">
<head>
<script type="text/javascript">
function saysomething() {
alert ("said something. Don't give up on me.");
}
function loadLeads(){ Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.LeadSearchJS.findAll}',
}
</script>
</head>
<body>
<div>
Oh Hai.
<div id="leadTable">
<p>
<a href="#" onClick="saysomething();">Say Something. I'm giving up on you.</a>
</p>
</div>
</div>
</body>
</apex:page>
Here is the controller:
global with sharing class LeadSearchJS {
@RemoteAction
global static List<Lead> findAll() {
return [SELECT Id, Email FROM Lead];
}
}