2 responses from ajax call to php

In the code below i need 2 values from the response

  1. Html response of the called page url

  2. The value of the URL which was used to get the page OR the array index which was used in the call.

      for (i = 0; i < pageURLs.length; i++) {  
        $.ajax({
    
        url:  pageURLs[i],
        dataType: 'html',
        statusCode: {
            200: function(response) {
              /*i am only getting access to the html of the page HERE*/
    
    
    
            },
            404: function() {
                  /*404 here*/
    
            }
        },
        error: function(error) {
    
        }
    });}
    


Source: ajax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.