You can choose one from the below as per your convenience :)
1) If you have apex:form in your visualforce then you can call apex:actionFunction from javascript and rerender the visualforce tag in which we are expecting personAccount Id by apex variable.
You can choose one from the below as per your convenience :)
1) If you have apex:form in your visualforce then you can call apex:actionFunction from javascript and rerender the visualforce tag in which we are expecting personAccount Id by apex variable.
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionFunction.htm
2) Use Javascript Remoting
https://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm
http://www.infallibletechie.com/2014/05/simple-ajax-in-salesforce.html
Check this
If this solves your problem, kindly mark it as the best answer.
Hit Like, if it saved your work :-)
Regards,
Magulan
http://www.infallibletechie.com