[SalesForce] How we can pass reRender attribute value using JavaScript

How we can pass reRender attribute value using JavaScript?
My apex component is:

<apex:actionFunction action="{!null}" name="notefordocument" reRender="dynamic">
               <apex:param name="fileid" value="" assignTo="{!fileid}"/>

        </apex:actionFunction>

In reRender attribute i have used dynamic but i want to set reRender attribute dynamically using javaScript.

Best Answer

I'm not sure you'll be able to do this as the parameter is processed by the server when the page is displayed to the user — even if you can it's likely to be hacky and at risk of breaking later down the road. Depending on your scenario it might be easier to leverage Visualforce remoting to move data back and forth and then to generate new output HTML accordingly.

If that's not an option, would be be disastrous to just skip the re-render and render the whole page again? Not perfect but a much simpler solution!