• Gram
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Is there a way to return a JavaScript array of Strings from Apex? Or is there a datatype in Javascript I need to use for an Apex List<String>?

 

 

A simple example of what I'd like to do:

 

Apex function:

 

public List<String> getStringList(){

 

    List<String> example =  {"email@gmail.com","email@yahoo.com","email@mac.com"};

 

   return example;

 

}

 

Javascript function in VisualForce

 

var stringList;

function() {

 

stringList = {!String};

document.writeln(stringList[0]);

 

}

 

 

  • November 15, 2010
  • Like
  • 0

Is there a way to return a JavaScript array of Strings from Apex? Or is there a datatype in Javascript I need to use for an Apex List<String>?

 

 

A simple example of what I'd like to do:

 

Apex function:

 

public List<String> getStringList(){

 

    List<String> example =  {"email@gmail.com","email@yahoo.com","email@mac.com"};

 

   return example;

 

}

 

Javascript function in VisualForce

 

var stringList;

function() {

 

stringList = {!String};

document.writeln(stringList[0]);

 

}

 

 

  • November 15, 2010
  • Like
  • 0