hinclude icon indicating copy to clipboard operation
hinclude copied to clipboard

Add BeforeRequestCallback and public getter/setter for ClassPrefix/BeforeRequestCallback

Open yberkholz opened this issue 12 years ago • 3 comments

Add feature BeforeRequestCallback

Add public getter/setter for properties

  • ClassPrefix
  • BeforeRequestCallback

Offers the possibility to change the classprefix and modify the XHR request, e.g.:

hinclude.setClassPrefix('hinclude-http-error hinlcude-http-');

hinclude.setBeforeRequestCallback(function(req, url) {
    req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
    req.setRequestHeader("X-Request-Source", "HTMLInclude");
});

yberkholz avatar Sep 20 '12 08:09 yberkholz

If you rebase and add some tests (see the tests directory), I'll take the pull request. Sorry for the delay -- wanted to get the test infrastructure in place.

mnot avatar Nov 13 '12 06:11 mnot

/ping @yberkholz

This would solve #24 too: With this PR everybody could decide themself, if they send this with or without X-Request-With (as mentioned in this comment).

kingcrunch avatar Sep 06 '13 23:09 kingcrunch

Up ?

L0rD59 avatar Oct 28 '13 13:10 L0rD59