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

Popular posts from this blog

javascript - How do you prevent nested queries/catches in sequelize? -

java - Could not retrieve pre-bound Hibernate session - Could not obtain transaction-synchronized Session for current thread -

ruby on rails - ActiveRecord order not working -