.load() with beforeSend action

.load() with beforeSend action

This works fine:
  1. $.ajax({
  2. url: "http://myurl.com",
  3. dataType: "text",
  4. beforeSend: function(xhr) {
  5. xhr.setRequestHeader("Ajax-Request", "true");
  6. }
  7. });
However I need to return the results in a div. The only way I've found to do this is to use the load() function.

  1. $("#div1").load("http://myurl.com");
The above also works but I need to set the request header to preform some different logic. Is there a way to set the request header using the load function?