+ 5
es6
how to write es6 and js into js file
10 Respuestas
+ 4
how to write es6 and js into js file
https://www.tutorialrepublic.com/faq/how-to-include-a-javascript-file-in-another-javascript-file.php
+ 4
https://www.youtube.com/playlist?list=PLkqwj9vc20pXuSdvxBjpgmUBpqDdzwGSf
+ 3
BroFar thanks alot,lot of procedure. programming is not an easy thing .i will still need your help sir
+ 2
just as you would write es5 ,if you browser doesn't understands es6 syntax then you will have to use a transpiler like babel to convert es5 to es6
Edit: sorry type es6 to es5 not es5 to es6
+ 1
explain more Abhay
+ 1
thanks but must it be jquery
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Load JS File Demo</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<script>
var url = "test.js";
$.getScript(url, function(){
$(document).ready(function(){
console.log(str); // Prints: Hi there!
console.log(num); // Prints: 15
console.log(multiplyNumbers(4, 25)); // Prints: 100
});
});
</script>
</body>
</html>
+ 1
BroFar i mean "<script src>" cant one import a script from website
+ 1
BroFar things like this didnt work
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Load JS File Demo</title>
<script src=" https://e--leaning.000webhostapp.com/test.py"></script>
</head>
<body>
<script>
var url = "test.js";
$.getScript(url, function(){
$(document).ready(function(){
console.log(str); // Prints: Hi there!
console.log(num); // Prints: 15
console.log(multiplyNumbers(4, 25)); // Prints: 100
});
});
</script>
</body>
</html>