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
KamindiaKamindia 

Writing Javascript Code in Apex Classes

Hello,

Could anybody help me in the below scenario.

Currently we have application in some other language and we are trying to migrate it to salesforce.

In the application  Javascript is dynamically created in code which generate the UI part.So I am trying for the same functionality that I need to write the same Javascript code through Apex Code which dynamically generate the interface.

Is it possible to write whole javascript in apex Code and what need to be taken care when moving(migrating) the same to Force.com

avijchakavijchak

class

public String scriptStr {get;set;} { scriptStr = 'alert(\'Hi\')' ;}

 

page

 

<script>

   {!scriptStr}

</script>

 

Hope it will work