Welcome Guest, Not a member yet? Register   Sign In
javascript calling controler without form
#2

[eluser]attos[/eluser]
You can post without using a form. You do not need to serialize the form either, or send anything back to the server.

You should call the ajax method on the click event of the slider. Your code should look like this:

Code:
$("#listingSlider").easySlider({nextId: \'listingBtn\', nextText: \'Next Listing\', prevText: \'Previous Listing\', prevId: \'plistingBtn\'});

$("#listingBtn").click(function(){    
  $.ajax({
    type: "POST",
    url: "'.site_url().'/contact/feedback",
    success: function(msg){
      $("#note").ajaxComplete(function(event, request, settings){
        if(msg == \'OK\')
        {
          result = \'<div class="notification_ok">Your message has been sent. Thank you!</div>\';
          $("#feedbackFields").hide();
        }
        else
        {
          result = msg;
        }
        $(this).html(result);
      });
    }
  });
});


Messages In This Thread
javascript calling controler without form - by El Forum - 09-24-2009, 02:13 PM
javascript calling controler without form - by El Forum - 09-25-2009, 07:21 AM
javascript calling controler without form - by El Forum - 09-25-2009, 10:08 AM
javascript calling controler without form - by El Forum - 09-29-2009, 07:45 AM
javascript calling controler without form - by El Forum - 09-29-2009, 07:33 PM
javascript calling controler without form - by El Forum - 09-30-2009, 02:09 PM
javascript calling controler without form - by El Forum - 10-01-2009, 09:45 AM
javascript calling controler without form - by El Forum - 10-01-2009, 09:48 AM
javascript calling controler without form - by El Forum - 10-01-2009, 11:06 AM
javascript calling controler without form - by El Forum - 10-01-2009, 11:25 AM
javascript calling controler without form - by El Forum - 10-09-2009, 10:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB