Kinda new to JavaScript and I need to make an ajax request. Basically want an input box and when the user clicks go / enter it sends an ajax request to index.php?youtube=[value of the form]

The request will take some time to finish so I wanted to add a div with a loading image in it and then once the request is done whatever is outputted on the PHP script replaces the loading image in the div.

So far I have:

Code JavaScript:
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
        type: "GET",
        url: "index.php",
        data: "youtube=",
        success: function(msg){
            alert( "Data Saved: " + msg );

But I'm kinda stuck from then onwards (got this code from jquery docs).

Could anyone help?