0

誰かがこのコードを説明できますか?

<script type="text/javascript"><!--

    $('#button-confirm').bind('click', function() {
        $.ajax({ 
            type: 'get',
            url: 'index.php?route=hybrid_directory/confirm',
                success: function() {
                    location = '<?php echo $continue; ?>';
            }
        });
    });

    function formSubmit()
    {
        document.getElementById("freecontactform").submit();
    }

//--></script>

button-confirm, when clicks submits the information from a php contact form. how is url and function - location used?

4

1 に答える 1

2

これはajax呼び出しであり、IDが「button-confirm」の要素がクリックされたときにトリガーされます。

ajax呼び出しが完了すると、URLは、このページをロードするPHPスクリプトが次のように定義されているものに再配置されます。$continue

jquery ajaxメソッドのドキュメントは次のとおりです:http: //api.jquery.com/jQuery.ajax/

于 2012-12-04T01:06:16.183 に答える