Lets say we have the following javascript snippets coming from two files. How do we build all.js with PHP?
a.js
var a = 20;
function foo() {
console.warn('bar');
}
foo();
$(document).ready(function() {
$(".someid").on("click", ".class", function() {
do_stuff();
});
});
b.js
var x = ['room', 'admin', 2];
$(document).ready(function() {
$.post("url/", { n: 80}, function(j) {
console.log(j);
}, "json");
});
all.js
var a = 20;
function foo() {
console.warn('bar');
}
foo();
var x = ['room', 'admin', 2];
$(document).ready(function() {
$(".someid").on("click", ".class", function() {
do_stuff();
});
$.post("url/", { n: 80}, function(j) {
console.log(j);
}, "json");
});