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-10-2009, 09:06 PM   PM User | #1
Juo
New to the CF scene

 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Juo is an unknown quantity at this point
Lightbulb How to put and call this function?

Hi guys ive got the following code

Code:
<html>                                                                  
 <head>                                                                  
    <script type="text/javascript" src="jquery.js"></script>          
	<script type="text/javascript">                                         
	 $(document).ready(function(){
		$("form").submit(function() {
		$.ajax({			
			type: "GET",
			url: "release.php",
			data: "name=Caspa&Rusko",
			dataType: "xml",
			success: function(xml) {
				$(xml).find('release-list').each(function() {
					$("span").text($(this).find("title").text()).show();
				});
			}
		});
		 });
	});
	</script>  
	                                    
 </head>                                                         
<body>
	<p>Type 'correct' to validate.</p> 
	  <form action="javascript:alert('success!');"> 
	    <div> 
	      <input type="text" id="title" /> 
	      <input type="submit" /> 
	    </div> 
	  </form> 
	  <span></span>
 </body>                                                                 
 </html>
Id like to perform the following script but without

Code:
	  <form action="javascript:alert('success!');">
So I thought id need to be everything in a function then call it with

Code:
	  <form action="javascript:functionName();">
Id also like to take the paramaters from <input type="text" id="title" /> and put the in data: "name=Caspa&Rusko", something like

Code:
data: "name= + name"
where would I set var name = $("search").val();

Finally if anyone could tell me where the AJAX magic goes so I can have a little loading spinner, that would amazing. Thanks
Juo 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 06:16 PM.


Advertisement
Log in to turn off these ads.