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
Anand PatelAnand Patel 

Calling controller method from javascript Golbal Remote call is not working


I am creating a multiple file upload, one of the thing that is failing for me is "Calling controller method from javascript, Golbal Remote call for is not working"

So I created a simple example to test and that not working either, Here is my Controller class and page, Its not showing me a alert on page load.  What am I doing wront here ?


global with sharing class myControllerTest {
    global static String getID(String parentId){
        return parentId;


<apex:page >
   <script type="text/javascript" src=""/>
   <script type="text/javascript">
     myControllerTest.getID('Hello Salesforce', function(result,event){
        if(event.status == true){
    }, {escape: false});
  <!-- Begin Default Content REMOVE THIS -->
  <!-- End Default Content REMOVE THIS -->




It is displaying an alert box on page load with message "Hello Salesforce" . I above case you have only missed to specify controller on page as follows :


<apex:page controller="myControllerTest">


 Please mark it as solution if it works for you so that others can use this.

Anand PatelAnand Patel

Thanks for reply.


I am getting this error now


 I tried in 2 Development enviornment and Sandbox.


Dev enviornment I dont get any alert at all


Sandbox I am getting error - Unable to determine from which page the request originated


Hi Anannd,


How are you invoking the function in thne javascript. When does your javascript gets executed?


Please refer to the example provided in the below link.


Remote Action in Visualforce Page


Hi Anand,

Were you able to find a workaround for the issue.

I am also receiving the error, while trying to invoke remote action from Firefox




Something to do with sending http referer headers - this fixed it for me:


Go to your firefox config - type "about:config" in the address bar,


Then look for the setting "network.http.sendRefererHeader;"


Right click it and select "reset"