Sunday, November 29, 2009

Re: [jQuery] JQ mouseover keeps firing AJAX GET -- how to make it fire once?

try on hover.

On Sun, Nov 29, 2009 at 1:39 PM, TrixJo <trixjo@gmail.com> wrote:
I put my mouse over the element and my JQ .mouseover keeps firing
loading my AJAX script over and over again like a crack addict on
LSD.  How do you make it fire once?

                       $("#swapImage").mouseover(function(){
                               // get input string from the input field
                               var inputString = $('#swapImageValue').val();
                               //alert( $('#swapImageValue').val() );
                               // post data to our php processing page
                               $.ajax({
                                  type: "GET",
                                  url: "ajax_loadankleligaments.php",
                                  data: "mysearchString="+inputString,
                                  success: function(data){
                                       if(data.length >0) {
                                               $('#swapImage').html(data);
                                       }
                                  }
                                });
                       });


any help?



--
-Jerry Johnson
Free website Monitoring.
http://monitor.whmht.co.cc

No comments: