Assuming the referrer is a page on the some origin, then the
load
method should work:
var pageReferrer = document.referrer;
if (pageReferrer) {
$("#div1").load(pageReferrer + " #download");
}
.load() | jQuery API Documentation[
^]
NB: Pay attention to the documentation:
Quote:
Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy[^]; the request can not successfully retrieve data from a different domain, subdomain, port, or protocol.
Also note that the referrer might not be set, or might not contain the full URL, depending on the referrer policy set for the referring page:
Referrer-Policy - HTTP | MDN[
^]