Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
suneel kota
Greenhorn
Posts: 24
  • 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
Posts: 42970
73
  • 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
  • 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
  • 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...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!