I wish to call data from another page to my existing page through ajax. For this i have the following code

```
<script>
$(document).ready(function()
    {
        $(".link").on("click", function(e)
            {
                e.preventDefault();
                var id = $(this).data("id");
                console.log (id); // i am getting value in this id 
                $.ajax({
                type : "post",
                url : "register.php",
                data :  id,
                cache : false,
                success : function(html)
                {
                    $('#msg').html(html);
                }});
  });
});
</script>

<a class='link' data-id="$idd" >TEXT</a>

```

Till console.log (id) code is working, i am getting value inside id but i am not able to run the register.php page. I wish to carry the id to register.php page, run some code there and print its result under #msg, can anyone please tell how i can correct my ajax code