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
Force.comForce.com 

Javascript remoting syntax error

Hi All,

 

I have written a very basic remote method for js remoting. 

 

global class remotingDemo{
@RemoteAction
global static string getSession(){
string para = 'woww...';
return para;
}
}

 

Calling above method from visualforce

<script>
    function getValues(){
        remotingdemo.getSession(function(result,event){
            document.getElementById('r').value = result;
        },{escape:true});

    }
    
</script>
<input type="button" value="Contract Aproval" onclick="getValues()"/>
<INPUT NAME="requestId" TYPE="text" id='r'></INPUT>

 

But getsession() of global class is not getting called when i clicked on html button. I am kind of stucked in this basic calling structure. Any help will be highly appreciated.

 

Thanks,

Pragati

 

 

Saravanan @CreationSaravanan @Creation

Hi,

 

Go through the below post it will help you. Let me know if you are not getting.

 

http://boards.developerforce.com/t5/Apex-Code-Development/Javascript-Remote-Action/m-p/557397#M101844