www.webdeveloper.com
Results 1 to 4 of 4

Thread: Can I put external JS in external JS?

  1. #1
    Join Date
    Mar 2010
    Posts
    701

    Post Can I put external JS in external JS?

    I want only one external javascript link on each of my pages. However, I'll be using Clicky and other programs where it's own external javascript is needed.

    Can I put an external javascript in another external javascript?

  2. #2
    Join Date
    Mar 2010
    Posts
    2,803
    you can link as many external js files as you like to each web page or you can copy and paste the js from various sources into the one external js file.

  3. #3
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,259
    1. You can reference as many external JS files as you want from the main HTML
    2. You can copy the contents of one external file and paste them into another external file
    and call only the joined external file by the main HTML
    3. You CANNOT reference one external JS file from within a different external JS file.
    (Why... because neither external JS file can contain any HTML tags)

  4. #4
    Join Date
    Nov 2002
    Location
    Flint, Michigan, USA
    Posts
    586
    Quote Originally Posted by JMRKER View Post
    ...
    3. You CANNOT reference one external JS file from within a different external JS file.
    (Why... because neither external JS file can contain any HTML tags)
    I do it all the time by writing an appropriate line to the main document from the first external JS file:

    Code:
      var SA_Out ='';
      SA_Out+='<script type="text\/javascript" src="sttepop.js"><';
      SA_Out+='\/script>\n';
        document.write(SA_Out);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles