开发者

get a function of external file

开发者 https://www.devze.com 2022-12-27 06:00 出处:网络
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

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消