Publish page by invoking submit via jQuery

Trigger the click event of the publish button instead, and let WP do the work.

<script>
    jQuery(document).ready(function( $ ) {
        $( "#secondary-publish" ).click(function () {
             $( "#publish" ).click()
        });
    });
</script>

Don’t use language (it was deprecated in HTML 4.01!) – you can drop type too (WP now has an HTML5 doctype).