Skip to main content
Removing incorrect javascript
Source Link
Fernando Gavinho
  • 3.9k
  • 1
  • 23
  • 40

The problem probably is in you function. The correct syntax for JavaScript Remoting is found here:

Visualforce.remoting.Manager.invokeAction(
    '{!$RemoteAction.javascriptremoting.loadaccs}',
    function(result, event){
        var names = [];
        if (event.status) {
            for(integer i=0;i<=result.length;i++){
                 names = result[i].Name;
            }
            document.getElementById('ot').innerHTML = names;
        }
    }, 
    {escape: true}
);

Also, make sure that your org has accounts and that the user has access to them.


And, since you're just trying to query some accounts, please consider using Remote Objects

The problem probably is in you function. The correct syntax for JavaScript Remoting is found here:

Visualforce.remoting.Manager.invokeAction(
    '{!$RemoteAction.javascriptremoting.loadaccs}',
    function(result, event){
        var names = [];
        if (event.status) {
            for(integer i=0;i<=result.length;i++){
                 names = result[i].Name;
            }
            document.getElementById('ot').innerHTML = names;
        }
    }, 
    {escape: true}
);

Also, make sure that your org has accounts and that the user has access to them.


And, since you're just trying to query some accounts, please consider using Remote Objects

The problem probably is in you function. The correct syntax for JavaScript Remoting is found here:

Visualforce.remoting.Manager.invokeAction(
    '{!$RemoteAction.javascriptremoting.loadaccs}',
    function(result, event){
        var names = [];
        if (event.status) {
            for(i=0;i<=result.length;i++){
                 names = result[i].Name;
            }
            document.getElementById('ot').innerHTML = names;
        }
    }, 
    {escape: true}
);

Also, make sure that your org has accounts and that the user has access to them.


And, since you're just trying to query some accounts, please consider using Remote Objects

Adding suggestion
Source Link
Fernando Gavinho
  • 3.9k
  • 1
  • 23
  • 40

The problem probably is in you function. The correct syntax for JavaScript Remoting is found here:

Visualforce.remoting.Manager.invokeAction(
    '{!$javascriptremoting$RemoteAction.AccountRemoterjavascriptremoting.loadaccs}',
    '', 
    function(result, event){
        var names = [];
        if (event.status) {
            for(integer i=0;i<=result.length;i++){
                 names = result[i].Name;
            }
            document.getElementById('ot').innerHTML = names;
        }
    }, 
    {escape: true}
);

Also, make sure that your org has accounts and that the user has access to them.


And, since you're just trying to query some accounts, please consider using Remote Objects

The problem probably is in you function. The correct syntax for JavaScript Remoting is found here:

Visualforce.remoting.Manager.invokeAction(
    '{!$javascriptremoting.AccountRemoter.loadaccs}',
    '', 
    function(result, event){
        var names = [];
        if (event.status) {
            for(integer i=0;i<=result.length;i++){
                 names = result[i].Name;
            }
            document.getElementById('ot').innerHTML = names;
        }
    }, 
    {escape: true}
);

Also, make sure that your org has accounts and that the user has access to them.

The problem probably is in you function. The correct syntax for JavaScript Remoting is found here:

Visualforce.remoting.Manager.invokeAction(
    '{!$RemoteAction.javascriptremoting.loadaccs}',
    function(result, event){
        var names = [];
        if (event.status) {
            for(integer i=0;i<=result.length;i++){
                 names = result[i].Name;
            }
            document.getElementById('ot').innerHTML = names;
        }
    }, 
    {escape: true}
);

Also, make sure that your org has accounts and that the user has access to them.


And, since you're just trying to query some accounts, please consider using Remote Objects

Source Link
Fernando Gavinho
  • 3.9k
  • 1
  • 23
  • 40

The problem probably is in you function. The correct syntax for JavaScript Remoting is found here:

Visualforce.remoting.Manager.invokeAction(
    '{!$javascriptremoting.AccountRemoter.loadaccs}',
    '', 
    function(result, event){
        var names = [];
        if (event.status) {
            for(integer i=0;i<=result.length;i++){
                 names = result[i].Name;
            }
            document.getElementById('ot').innerHTML = names;
        }
    }, 
    {escape: true}
);

Also, make sure that your org has accounts and that the user has access to them.