Jquery post, test return data

This is mostly from the Jquery post example from the jquery site.
My goal is to send the login to the site, see what the results are.
if the results are what I want
I will post the data again and let it be redirected to the correct site.

First, I can not tell if it is even firing, I put a alert in the data but it did
not fire,
I would like to see the resuts and then be able to test some of the data.

Can someone see what I may have done wrong here ,and tell me how to
get the resulting and move forward.
<!DOCTYPE html> 
<html> 
<head> 
  <script src="http://code.jquery.com/jquery-latest.js"></script> 
</head> 
<body> 
<form action="http://brain.com/default.asp" id="Form1" >
   
username   <input type="text" name="username"  id="username" /><br /> 
password    <input type="text" name="password"  id="password"   /> <br />
   <input type="hidden" name="institution" value="brain"  id="institution" /> 
   
   make a graph <input type="submit" name="submit"  /> 
  </form> 
  <!-- the result of the search will be rendered inside this div --> 
  <div id="result"></div> 
 
<script> 
  /* attach a submit handler to the form */ 
  $("#Form1").submit(function(event) { 
 
    /* stop form from submitting normally */ 
    event.preventDefault();  
         
    /* get some values from elements on the page: */ 
    var $form = $( this ), 
        username = $form.find( 'input[name="username"]' ).val(),
        password = $form.find( 'input[name="password"]' ).val(),
        institution = $form.find( 'input[name="institution"]' ).val(),
        url = $form.attr( 'action' ); 
 
    /* Send the data using post and put the results in a div */ 
    $.post( url, { username: username , password:password, institution:institution  }, 

      function( data ) { 
            var content = $( data ).text()
         $( "#result" ).empty().append( content ); 
        // Experts-Exchange:
        // What  I want to do here is 
        // get the contents of results test them and 
        // post the data to another site and go there. 
      
      } 
      ); // post 
  }); 
</script> 
 
</body> 
</html>

Open in new window

LVL 1
yahoolaneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
could you confirm your page is on the same domain and protocol than the action url?
http://brain.com/default.asp
0
yahoolaneAuthor Commented:
The are on different domains.

0
leakim971PluritechnicianCommented:
it's not possible to do ajax call across different domains

you may use your server to download the data for you : http://snipplr.com/view/45553/proxyasp/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leakim971PluritechnicianCommented:
0
yahoolaneAuthor Commented:
Both are good results.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.