Following existing advice here, making sure that an error is not to blame, see that the Apex controller class has been included in your site's approved components:
Public Access Settings | Apex Classes | Edit
Regardless of whether your actionFunction is calling a method that does nothing but return a value, that's when your controller is invoked. To prove this, simply remove the action portion of your actionFunction, like this:
<apex:actionFunction name="test" reRender="emptydiv">
Additionally, remember that you can't re-render a non-Visualforce component, such as a div. If you're trying to re-render a div, wrap the section in an outputPanel instead:
<apex:outputPanel id="emptyoutpan">
...
</apex:outputPanel>
Finally, a good practice to avoid hitting your head against the wall with sites is to create a custom tab and verify your work from there as well. Then when you hit errors you will see what errors are actually being thrown, rather than simply seeing an authentication page.
As per the updates, the navigateto does not work properly. Seems like this is known issue to salesforce and possible it will be fixed in next few releases. ( safe harbor)
Then what to do meanwhile?
I had the same issue and after chatting with Salesforce the solution below is the one that I'm using meanwhile. It works :)
Solution :
Sfdc.canvas.publisher.publish({name: "publisher.close", payload:{ refresh:"true"}});
Then this could be your page:
<apex:page showHeader="true" standardController="Account" extensions="AccountController" sidebar="true">
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
<script src="https://mobile1.t.salesforce.com/soap/ajax/30.0/connection.js" type="text/javascript" />
<script>
function myUpdateAccount()
{
var accountId = document.getElementById('accountId').value;
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.AccountController.accountUpdateNumberField}', accountId,
function(result, event)
{
//if(result!=null) sforce.one.navigateToSObject(result,"detail");
Sfdc.canvas.publisher.publish({name: "publisher.close", payload:{ refresh:"true"}});
});
}
</script>
<input type="text" name="name" id="accountId" value="{!viewState.accountId}"/>
<a href="#" data-role="button" class="updateNotify" id="sendInvoicesMyself" onclick="myUpdateAccount()">Update Account</a>
</apex:page>
Hope it helps!
Best Answer
As specified in the limitations area, anything that invokes a Visualforce page will count as a page view. From my experimentation, it appears that Documents are not subject to bandwidth or page view limits, although it is hard to confirm, because I don't have a Site configured that has a page view limit (DE doesn't have normal limit for page views).
Components within a Visualforce page don't normally incur extra page views, unless they invoke code that causes a page to load or call a Visualforce remoting method. Similarly, pages that are included within pages don't accumulate extra views either, but there is a limit on maximum CPU time that will be affected by this.
Static resources should be used when possible because of the caching benefits and CDN benefits (faster loading, better caching, etc). Administrators can change static resources as easily as a document-- they just go to a different area to perform the swap.