How could I pass to confirm() function the value of a String contained in the Controller of this VF page?
<apex:page controller="TestJS" >
<script language="javascript">
function askForConfirmation()
{
var result = confirm(test);
if(result)
{
return true;
}
return false;
}
</script>
<apex:Form >
<apex:commandButton value="Confermare" onclick="return askForConfirmation();">
</apex:commandButton>
</apex:form>
public with sharing class TestJS {
String test='Sure?';
}