1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[jquery+ajax] i can't use the "context" parameter

Discussion in 'jQuery' started by Rülf2000, Oct 29, 2017.

  1. #1
    Hi guys,

    I would like to implement the "context" param for jquery ajax

    However the "context" params seems to block my code

    The "alert('ok');" won't be executed:

    $( document ).ready(function() {
    
        $("body").on("click", "button.toggle", function(){
    
            currentBtn     = $(this);
    
            $.post("http://localhost/ajaxcall.php",{ 
    
                context:currentBtn
    
            }, function(data, status){
    
                         alert('ok');  // cette ligne ne sera jamais executée
    
            }).done(function( data ) {
            }).fail(function() {
            }).always(function() {
            });
    Code (markup):
    Can someone help please ?
    Thank you ! :)
     
    Rülf2000, Oct 29, 2017 IP
  2. Ehtesham Mehmood

    Ehtesham Mehmood Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    What you are trying to do ???
    learn jquery enable button
     
    Ehtesham Mehmood, Nov 12, 2017 IP