Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-29-2009, 07:39 PM   PM User | #1
Bobafart
Regular Coder

 
Join Date: Dec 2006
Posts: 417
Thanks: 168
Thanked 1 Time in 1 Post
Bobafart is on a distinguished road
JQ mouseover keeps firing AJAX GET -- how to make it fire once?

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?

Code:
			$("#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?
Bobafart is offline   Reply With Quote
Old 11-30-2009, 04:02 AM   PM User | #2
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
Check the documentation for mouseover.
Quote:
Mouseover fires when the pointer moves into or out from child element, while mouseenter does't.
You might rather be interested in the hover() event.
__________________
Are you a Help Vampire?
tomws is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:13 PM.


Advertisement
Log in to turn off these ads.