<apex:page controller="myController">
<script>
myActionMethod(); //this is javascript
</script>
<apex:form>
<!-- this is an apex/vf method that will be call-able from JS -->
<apex:actionFunction name="myActionMethod"
action="{!submitEmp}" />
<!-- the action attribute is the apex controller method you want to call -->
</apex:form>
</apex:page>
public class myController{
public void submitEmp(){
EMPTest__c c= new EMPTest__c();
insert c;
}
}