0

I'm try to make javascript onclick function in php file.the result is make an alert window in my page.
but nothing happen.please help me.
this is my code:

<script type="text/javascript" charset="utf-8">
    $('#printdata').click(function() {
        datastring = {customer  :'val',
                      person    :'val',
                      address   :'val',
                      phone     :'val'};
        $.ajax({
            type:'POST',
            url:'print.php',
            data:datastring,
            cache:false,

            success:function(){
            alert('?????');
            }
        }):
    }); 
});
</script>

datastring val customer,contact,addres,phone is from option value.
what i'm gonna to do is,when i click button it's gonna appear alert that shows data from i choose before in option select.
thanks

4
Contributors
3
Replies
19
Views
3 Years
Discussion Span
Last Post by diafol
0

If you use your browser's dev tools (javascript console), you may get a better idea of what the problem is. Errors will be shown there.

0

I take it that you've included the jquery library?

You could also try the newer promise callbacks: .done and .fail

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.