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

[eluser]dippy[/eluser]
[quote author="attos" date="1253902898"]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);
      });
    }
  });
});
[/quote]



OK thanks for the reply!

how about if i want to send an client_id through to the controller when the click event of the slider happens?

how would i send that id? using data: param?


basically i want this to happen. when the click of the next button happens the javascript is sending an id into a controller which is pulling an address to be plotted on a google map api. without a page refresh. the slider is holding each client info in <li> tags.

thanks in advance.


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