Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 816343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:48:56+00:00 2026-05-15T01:48:56+00:00

In general… How can I make a call on a function of an external

  • 0

In general… How can I make a call on a function of an external java script file?

More specific…

  • In the head tag i have

<script type="text/javascript" src="JScript/FontSize.js"></script>

  • The external javascript file, (that i would like to call) FontSize.js contains the following functions.

    function checkCookie()
    
    function setCookie(c_name, value, expiredays)
    
    function getCookie(c_name)
    
    function increaseFontSize()
    
    function decreaseFontSize()`
    
  • The FontSize.js is located at the ~/Jscript/ directory

I guess the body on load should contain something like

<body onload="/JScript/Fontsize.js/checkCookie()">

Of course nothing works as it should because, i do not know how to make the call to a function to an external js file

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:48:56+00:00Added an answer on May 15, 2026 at 1:48 am

    You just call it as if it were local 🙂

    <body onload="checkCookie()">
    

    Or, do it in script:

    window.onload = checkCookie;
    

    When you declare a function and it’s not in another object/namespace, it’s just globally available, and you can call it as if it immediately preceded your current code. By default these functions will be on the window object, you can see a short demo here.

    For example (doesn’t matter where this function’s defined, external or not):

    function myFunc() { alert('hi'); }
    myFunc();
    window.myFunc(); //same call, unless there's *another* myFunc in a local-er scope
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

General Confusion I have bands which can have 3 genres. I read in a
general question it can be in c i guess also if i have (
In general, can the verify-methods in java.security.cert.Certificate be considered thread-safe? Specifically, verify(PublicKey key) and
For general protocol message exchange, which can tolerate some packet loss. How much more
General purpose I am developing a .NET user control that can be used for
General context : MVVM application. I have a View called JobView. Its DataContext is
General question about java servlets and the best way to handle requests. If I
General Python Question I'm importing a Python library (call it animals.py) with the following
General : How can I select the first matching ancestor of an element in
general question: is possible to enable multiselection in Drupal Views ? specific question :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.