You need to sign in to do that
Don't have an account?
Ram Shiva Kumar
How to display the return value in VF page
Hi ,
i have uplaoded the java script file in staticresoure. iam getting the pop up correctly. but ih ave written the function in that file which will return multiplication of 2 numbres . Please suggest me how to display the value returned form the java script.
my ststic resource code is,
function popup() { alert("Hello World") }
function myFunction(a, b) {
return a * b;
}
And the vf code is,
<apex:page >
<html>
<head>
<apex:includeScript value="{!$Resource.jsss}"/>
</head>
</html>
<script type="text/javascript" >
popup()
myFunction(4,5);
</script>
<apex:pageBlock>
</apex:pageBlock>
</apex:page>
Any body suggest me aboutthis.
Regards,
Siva.
i have uplaoded the java script file in staticresoure. iam getting the pop up correctly. but ih ave written the function in that file which will return multiplication of 2 numbres . Please suggest me how to display the value returned form the java script.
my ststic resource code is,
function popup() { alert("Hello World") }
function myFunction(a, b) {
return a * b;
}
And the vf code is,
<apex:page >
<html>
<head>
<apex:includeScript value="{!$Resource.jsss}"/>
</head>
</html>
<script type="text/javascript" >
popup()
myFunction(4,5);
</script>
<apex:pageBlock>
</apex:pageBlock>
</apex:page>
Any body suggest me aboutthis.
Regards,
Siva.
You can output result directly on the page, maybe put this value in a span tag. Note that script should execute after DOM completed loaded.
In my example bellow, the script run after span tag added to the page.
Thanks,
Alex