admin管理员组文章数量:1346682
I have Designed the Javascript function My.js it contains following code
My.js
function display(){
//Call to another Javascript function defined as ShowUser() in selectUser.js
showUser(str);
}
SelectUser.js has
function showUser(Str){
//Do the display
}
Now, my question is: I want to call showUser() from My.Js itself. Any one suggest how to make the call? Should I include anything?
I have Designed the Javascript function My.js it contains following code
My.js
function display(){
//Call to another Javascript function defined as ShowUser() in selectUser.js
showUser(str);
}
SelectUser.js has
function showUser(Str){
//Do the display
}
Now, my question is: I want to call showUser() from My.Js itself. Any one suggest how to make the call? Should I include anything?
Share Improve this question edited Sep 23, 2013 at 22:47 Gabriele Petronella 108k21 gold badges221 silver badges236 bronze badges asked Jan 1, 2009 at 3:47 venkatachalamvenkatachalam 102k31 gold badges74 silver badges77 bronze badges1 Answer
Reset to default 6You need to have separate script tags with the src attribute set for both javascript files in your HTML document, assuming this is for an HTML page (and not an AIR app, or serverside JavaScript, or Rhino). Whatever functions you declare in the global scope in any JavaScript file you add via a script element, or inline code should be available to JavaScript in any file.
The only caveat to this is that if you use window.foo syntax to assign something to the global (window) scope in a file then, surprisingly in IE, other files will think window.foo is unassigned until JavaScript begins executing.
More Info on that last issue
本文标签: Making a another script function call from javascriptStack Overflow
版权声明:本文标题:Making a another script function call from javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743826267a2545694.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论