View Full Version : How to put and call this function?

11-10-2009, 10:06 PM
Hi guys ive got the following code

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$("form").submit(function() {
type: "GET",
url: "release.php",
data: "name=Caspa&Rusko",
dataType: "xml",
success: function(xml) {
$(xml).find('release-list').each(function() {

<p>Type 'correct' to validate.</p>
<form action="javascript:alert('success!');">
<input type="text" id="title" />
<input type="submit" />

Id like to perform the following script but without

<form action="javascript:alert('success!');">

So I thought id need to be everything in a function then call it with

<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

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 :D