automatically submit a file in jquery
how would I automatically submit a form to a php file in jquery. I have this form right now:
<form action = 'add.php' method='get'>
<input type='hidden' name = 'title' value='$title'>
</form>
I ask this because I want to use this to pass a post variable to another php file (ie...going from A to B t开发者_StackOverflow中文版o C).
<form action = 'add.php' method='get' id="myform">
<input type='hidden' name = 'title' value='$title'>
</form>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$('#myform').submit();
});
</script>
<form action = 'add.php' method='get' id="myform">
<input type='hidden' name = 'title' value='$title'>
</form>
<script language="javascript" type="text/javascript">
document.getElementById("#myform").submit();
</script>
<form action = 'add.php' method='get'>
<input type='hidden' name = 'title' value='$title'>
</form>
<script type="text/javascript">
$(document).ready(function(){
$('form[action="add.php"][method="get"] input[type="hidden"][name="title"]').parent().submit();
});
</script>
精彩评论