0

I am new to jQuery and JavaScript.

I have a Html page. There is a Form with Method="Post" and I have a JavaScript function.

On the server side I use ASP classic.

I need to post my form with my Submit Button and after submit and load my page, Run a JavaScript method.

This is a sample :

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>..........</title>
    <style>
       ...........
    </style>
<script>
    function initialize() {
    .....
    }
</script>
<body>
    <div style="height:250px">
        <form id="form1" runat="server" method="Post">

            <input type="radio" name="sex" value="male" checked>Male
            <br>
            <input type="radio" name="sex" value="female">Female
            <br>
            First name:<br>
            <input type="text" name="firstname">
            <br>
            Last name:<br>
            <input type="text" name="lastname">
            <br>
            <input type="submit" value="Ok" />
        </form>
    </div>
    <div id="map-canvas"></div>
</body>
</html>

I need after PostBack run initialize method

I use this JQuery but it dose not work.

<script>
    $(document).ready(function () {
        $.ajax({
            url: "ISPostBack.html",
            context: document.body
        }).done(function () {
            initialize();
        });
    });

</script>

How can I do this?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ardalan Shahgholi
  • 11,967
  • 21
  • 108
  • 144

1 Answers1

0

you can look this https://api.jquery.com/jQuery.ajax/ use ajax to request