get a function of external file
I am using jQuery and my js file thats calling a jquery function resides in totally different directory th开发者_如何学Goan jQuery is in. I need to call this function reloadPage like this from js file
reloadPage({param1:'First Parameter', param2:ID});
but it gives me an error
Line: 341 Error: Object doesn't support this property or method
Line 341 is reloadPage({param1:'First Parameter', param2:ID});
. What can I do to run this function from outside the directory?
I tried
parent.reloadPage({param1:'First Parameter', param2:ID});
But that didnt work either.
Wherever you are including your javascripts in your document, add another script tag with the relevant file path and that will allow you to call a function that lives in that file.
<script src="path/to/your/file" type="text/javascript></script>
精彩评论