www.webdeveloper.com
Results 1 to 2 of 2

Thread: Loading the HTTPRequest Response to a variable with JQuery

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Posts
    1

    Loading the HTTPRequest Response to a variable with JQuery

    How do you go about loading the response received from an HTTPRequest into a variable using jQuery?

    I tried my ass off without success.

    Examples that doesn´t work:

    $(document).ready( $('selector').submit( function(){
    var req = $.get('url.php', "data: data");
    response = req.responseText;
    });

    but response = "".

    I tried this then:

    $(document).ready( $('selector').submit( function(){
    var req = $.ajax(
    url: 'url.php'
    data: 'user=whatever&pass=whateverelse'
    success: function(){
    response = req.responseText;
    }
    });

    Doesn´t work either.


    I am clueless.

  2. #2
    Join Date
    Feb 2010
    Posts
    73
    Code:
      $(document).ready( $('selector').submit( function(){
      $.ajax(
      url: 'url.php'
      data: 'user=whatever&pass=whateverelse'
      success: function(data){
        response = data;
      }
    });

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles