473,666 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Call external functions

Hi guys, this is my first post. I am a newbie, of course.

The question is really simple:
how can I call functions from an external file in a new js file and
work with its method?

Thank in advance.
Bye

Jan 24 '07 #1
2 2305


On Jan 23, 7:40 pm, "kirkox" <mircovel...@gm ail.comwrote:
Hi guys, this is my first post. I am a newbie, of course.

The question is really simple:
how can I call functions from an external file in a new js file and
work with its method?
First make sure you have a tag like this:
<script type="applicati on/x-javascript"
src="path/to/my/js.js"></script>
Then you can just call the function like it was in the same file!
>
Thank in advance.
Bye
Jan 24 '07 #2


On Jan 23, 8:42 pm, "Benjamin" <musiccomposit. ..@gmail.comwro te:
On Jan 23, 7:40 pm, "kirkox" <mircovel...@gm ail.comwrote:Hi guys, this is my first post. I am a newbie, of course.
The question is really simple:
how can I call functions from an external file in a new js file and
work with its method?First make sure you have a tag like this:
<script type="applicati on/x-javascript"
src="path/to/my/js.js"></script>
The above is correct. However I caution you not to also add the opening
and closing script tags to your external script file, or the script
will not work. This is a very frequent error made by those using
external script files for the first time.

Jan 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5171
by: Bruce W...1 | last post by:
I'm a PHP newbie coming from experience with ASP.NET. I want to have a separate PHP file to support each HTML PHP page. This would be the equivalent of an ASP.NET code-behind file but using PHP. For one page to do a variety of different things I need to call different methods (or functions) in the PHP code file that is dedicated to this purpose. How do you do this? How do you call just one method? Thanks for your help.
3
23999
by: Mariusz | last post by:
I want to write function to call another function which name is parameter to first function. Other parameters should be passed to called function. If I call it function('f1',10) it should call f1(10). If I call it function('f2',5) it should call f2(5). So far i tried something like CREATE FUNCTION . (@f varchar(50),@m money) RETURNS varchar(50) AS
47
3852
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
39
6524
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. When it completes, it can call a success, or a failure function. The names of these success, or failure functions will differ, and I'd like to know how I can pass the name of a function to my tool, and how my tool can call the function, using that...
2
12255
by: Sandeep | last post by:
Hi I have a VC++ ui which has an HTML Container. I have several Javascript functions that need to call functions in VC++ UI. For this , the existing code is using a call "windows.external". What I am unable to link is the fact that upon calling windows.external , why a C++ UI is called and not something else. I want to understand that if I call windows.external from a js, how is the function call resolved.
7
5891
by: Tim ffitch | last post by:
Hi I have created a VB dll file that contains common functions I use across various projects in VB, Access and Excel. Rather than have to code the functions in each I decided to use the dll route. The problem being that I can't call these functions from the query designer in Access. I decided that I would try the route of declaring the functions from the dll file the same way you would for the Windows API. Access then complains that...
4
2732
by: Peter Ammon | last post by:
I would like to share a variable between two functions defined in two separate source files; no other functions will need the global variable so I'd prefer to not give it file scope. Thus, I want a variable with local scope, external linkage, and static storage. I believe I can do this for the file that does not define the variable by declaring it inside a function. Can I also avoid giving it file scope in the file that does define the...
5
1725
by: gamename | last post by:
Hi, I have 2 vendor libraries. One is for transmitting, the other receiving data. Virtually all of the functions in either lib are almost exactly alike in the way they're called. The only external difference is the name has an "R" or an "S" in it. ex fooSGetBytes(bufa, buftemp); fooRGetBytes(bufa, buftemp);
2
2418
by: dolphin | last post by:
What is the different between c++ call convention and c call convention?Can some give some examples?
0
8454
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8362
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8785
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8560
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8644
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6200
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5671
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1778
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.