Welcome Guest, Not a member yet? Register   Sign In
[Newbie] Need help to display results.
#8

Where are your <head> and <body> tags your JavaScript should go just above your </body></html>

unless it is called first in your html then the scripts need to be in the <head></head> tags.

How does jQuery know which button is being clicked?

Code:
<button id="btnSubmit">Payment</button>

$('#btnSubmit').click(function(){
    $.ajax({
        url: "<?php echo base_url() ?>json_controller/select_qnum",
        type: "GET",
        dataType: 'json',
        success: function(data){
            $('#qnum').html(data);
        },
        error: function(){
            alert('Error....');
        }
    });
});
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: [Newbie] Need help to display results. - by InsiteFX - 03-12-2020, 08:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB