jquery - Calling another page's js function from different page -
i have 3 pages dashboard.html, documents.jsp, documents.js
in dashboard.html file have href link should redirect page documents.jsp , call function in documents.js file included in documents.jsp file.
dashboard.html
<a href="documents.jsp?filter=somefunctiondocumentsjsfile" documents.js
in file have ajax call like
function somefunctiondocumentsjsfile(){ $.ajax({ url : "deletedocument?docid=" + json.stringify(selecteditemstodelete), type: "get", success: function(data){ console.log(data); showdangerpopup(data); getofficialdocs(); } }); } how should achieve this
simply add onload="somefunctiondocumentsjsfile()" attribute opening <body> tag in documents.jsp file.
Comments
Post a Comment