I have some code specific to sorting tables. Since the code is common in most pages I want to make a JS file which will have the code and all the pages using it can referen
I believe what you want to do is still to incude this js file in you html dom, if so then this apporach will work.
Example: //js file
$(document).ready(function(){
alert("jquery in js file");
});
//html dom