[SalesForce] apex:actionFunction to return value from Controller

Is it possible to get Controller property using action function?

my vf controller has property as

public String contractURL {get;set;}

I want to access this latest value in my javascript.

Note –
I cannot access it in this way (and thats why I am posting this question 🙂 )-

var url  = "{!contractURL}";

Best Answer

try putting var url = {!contractURL} in a <apex:outputPanel> and have it rerendered by your <apex:actionFunction> I don't know for sure if it will work, but give it a try!

If you want to make calls to a controller without having to rerender and use visualforce functionality, just handle the calls and results in javascript, you should take a look at Javascript Remoting: http://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm