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
Anil MeghnathiAnil Meghnathi 

How to use JavaScript in Apex Class

I have an Apex Class.

I wants to alert() of javascript in that class.

Remember i dont have any visualforce page for that class.

Any method in Apex is there using which we can directly execute javascript or HTML???

 

Its urgent.Help me.

 

Thanks

Anil

LVSLVS

The alert() in javascript has to be displayed to the user - if not a visualforce page where do you intend to display this?

Anil MeghnathiAnil Meghnathi
LVSLVS

Please provide more details. On what action by the user should the alert be displayed? Why is there an Apex class involved at all? etc...

Anil MeghnathiAnil Meghnathi

Thanks LVS

 

i wants to show message at the time of insertion of an object.

Any idea will help me

 

Thanks

Anil

LVSLVS

Still not enough info.


Anyway, you could try JavaScript Remoting - you can call a javascript method (like, alert() or your own defined) as a callback