Skip to content

include js file on other js file just like php: main_functions.js (part 5)

September 26, 2013

the function addjavascript allows a js file to be included in other js file. just declare this function to the page where you  are go addjavascript. got it here.

##########################################################

>> jsname :: is the name of the javascript file you want to add

>> pos :: is a string either ‘head’ or ‘body’, it indicates where you want to place the js file

  1. function addJavascript(jsname,pos) {
  2. var th = document.getElementsByTagName(pos)[0];
  3. var s = document.createElement(‘script’);
  4. s.setAttribute(‘type’,’text/javascript’);
  5. s.setAttribute(‘src’,jsname);
  6. th.appendChild(s);
  7. }

DOWNLOAD COMPLETE CODES HERE

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

TurtleAndRobot.com

Children's Book Reviews

Malav Shah

official Web Site

My Road to Programming

The journey of how I taught myself to program.

paritoshmishra

Look at what's brewing up guys! we all are work in progress. So don't meander, lets micromesh everything and have candid conversation about every problem related to C, C++ and JAVA. We can rejuvenate the crinkled faces.

ProgramThat;

A simple guide to programming...

ITechonology

Information Techonology

Rahul's Work

My Work Tips and Tutorial on Various Tech.

Turnip Farmers

Kingdom Scans

Gigaom

Technology news, trends and analysis covering mobile, big data, cloud, science, energy and media

The Neighborhood

society online's social conscious

HarsH ReaLiTy

A Good Blog is Hard to Find

VentureBeat

News About Tech, Money and Innovation

retireediary

The Diary of a Retiree

50 Year Project

My challenge to visit 192 countries, read 1,001 books, and watch the top 100 movies

[BTW] : Ben Trube, Writer

Writer, Programmer, Singer

My Arch Walkthrough

Arch linux made easy

Don Charisma

because anything is possible with Charisma

SutoCom Solutions

Success & Satisfaction with the Cloud

%d bloggers like this: