We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 099da3c commit bb8ce9dCopy full SHA for bb8ce9d
src/pat/ajax/ajax.js
@@ -14,8 +14,14 @@ const log = logging.getLogger("pat.ajax");
14
export const parser = new Parser("ajax");
15
parser.addArgument("accept", "text/html");
16
parser.addArgument("url", function ($el) {
17
- var val = $el.is("a") ? $el.attr("href") : $el.is("form") ? $el.attr("action") : "";
18
- return (val || "").split("#")[0];
+ const el = $el[0];
+ const value =
19
+ el.tagName === "A"
20
+ ? el.getAttribute("href")
21
+ : el.tagName === "FORM"
22
+ ? el.getAttribute("action")
23
+ : "";
24
+ return (value || "").split("#")[0];
25
});
26
parser.addArgument("browser-cache", "no-cache", ["cache", "no-cache"]); // Cache ajax requests
27
0 commit comments