[jQuery] hidden form submit

[jQuery] hidden form submit


I am building a php page the shows some data to the users. But I also
need to capture the name of the loggedin user from this page and post
it to a different page silently in the background.
So I would like to do submit a hidden form in the background when
users are on my page. I do not want any content on the page changed
<form name=myform action=target>
<input type=hidden value=name>
</form>
I was thinking of hiding this form with a hidden div tag and then
doing a ajax submit after the page has loaded.
$(document).ready(function() {
$('#myForm').ajaxSubmit()
}
Is this the best way to do it. Any tips appreciated
Thanks in advance