Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call a javascript function which is in another .js file

 
suneel kota
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


How to call a javascript function in a html page which is in another .js file.

Regards
SuneelKota
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript only has single global namespace for all functions. If the page includes both JS files, then you can just call the function by its name.
 
Liebes Maschine
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i tried the same thing. i'm trying to call a javascript function present in a common JS file from a jsp, having declared it's src before this call, in the jsp. this fn in turn calls another specific JS fn, contained in another JS file, also declared with src in the original JSP file. for some reason, this sequence is not returning the right boolean value, while using a function by the same name in the JSP itself works.
any idea what's going wrong?
thanks in advance...
 
Liebes Maschine
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh, and i've declared them in the right order - from innermost to outermost in calling order...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic