javascript – Embed js file in another – Stack Overflow

javascript – Embed js file in another – Stack Overflow

You can not embed a JavaScript file in another. But you can load more JavaScript files in dynamically with a function such as this one.

function loadJS(file) {

// Grab the head element

var head = document.getElementsByTagName(‘head’)[0];

// Create a script element

var script = document.createElement(‘script’);

// Set the type

script.type = ‘text/javascript’;

// Set the source file

script.src = file;

// Add the script element to the head

head.appendChild(script);

}

via javascript – Embed js file in another – Stack Overflow.

Advertisements
An Intro to App.Js – Mobile Webapps Made Easy

An Intro to App.Js – Mobile Webapps Made Easy

JavaScript has become increasingly popular for mobile application development. It has enabled web application developers to develop mobile web applications without learning any native language skills.

In this tutorial, we’ll discuss a lightweight JavaScript UI library called App.js. Using App.js one can create mobile web apps without compromising performance or looks.

via An Intro to App.Js – Mobile Webapps Made Easy.

Grand Central Dispatch Tutorial for Swift: Part 1/2 – Ray Wenderlich

Grand Central Dispatch Tutorial for Swift: Part 1/2 – Ray Wenderlich

Update April 10, 2015: Updated for Xcode 6.3 / Swift 1.2

Update note: This tutorial was updated for iOS 8 and Swift by Bjørn Ruud. Original post by Tutorial Team member Derek Selander.

Although Grand Central Dispatch (or GCD for short) has been around for a while, not everyone knows how to get the most out of it. This is understandable; concurrency is tricky, and GCD’s C-based API can seem like a set of pointy corners poking into the smooth world of Swift.

In this two-part series, you’ll learn the ins and outs of GCD. This first part will explain what GCD does and showcase several of the more basic GCD functions. In the second part, you’ll learn several of the more advanced functions GCD has to offer.

via Grand Central Dispatch Tutorial for Swift: Part 1/2 – Ray Wenderlich.