Linked Questions

6377 votes
72 answers
4.5m views

How do I include a JavaScript file inside another JavaScript file, similar to @import in CSS?
Alec Smart's user avatar
  • 96.2k
4 votes
1 answer
2k views

I have a script tag with an src, how can I reload the src with java script code, this is the code I have: <script src='./script.php'> <script> function reload() { //the code to reload ...
Stemboy4002's user avatar
1 vote
0 answers
2k views

I know this question has been asked a lot, but everywhere on the internet the answers are like a decade old and everyone was suggesting to use eval which is not a right/secure way to do it. So, in my ...
Himanshu Aggarwal's user avatar
0 votes
1 answer
879 views

Hi I have to conditionally load a script in one of my jsp files based on a window variable. Can someone suggest me how can i achieve this. Is it possible ? Current behaviour : mytest.jsp file ...
Deadpool_er's user avatar
0 votes
0 answers
242 views

I have two different scripts that do different things but I do not want them to run at the same time as one script displays the video in black and white and another script lets the user add text on ...
Noobie1229's user avatar
153 votes
3 answers
214k views

I'm trying to load a set of scripts in order, but the onload event isn't firing for me. var scripts = [ '//cdnjs.cloudflare.com/ajax/libs/less.js/1.3.3/less.min.js', '//cdnjs....
chovy's user avatar
  • 76.2k
142 votes
2 answers
135k views

I have a very large javascript file I would like to load only if the user clicks on a certain button. I am using jQuery as my framework. Is there a built-in method or plugin that will help me do ...
Jeff Meatball Yang's user avatar
57 votes
9 answers
117k views

How do you go about forcing webpack to clear its cache? I'm doing a-lot of work with threejs and webpack and for some reason, unbeknownst to me, it has two copies of threejs in memory. Here's the ...
Katana24's user avatar
  • 8,979
8 votes
4 answers
20k views

I need to dynamically load a JavaScript file and then access its content. File test.js test = function () { var pub = {} pub.defult_id = 1; return pub; }() In this case it works: <!...
Alexandre Neukirchen's user avatar
20 votes
3 answers
32k views

When reading a file from the input element by the FileReader api it works, but my android device also allows sending files and it seems to send heic files anyway which then results in an empty image ...
Sascha Grindau's user avatar
12 votes
3 answers
9k views

I have a application wants to embed google map, and it is required that the key is put into a config file. So here is what I do: In config.js GOOGLE_MAP_KEY = "mykeyofgoogleapi"; In index.html <...
user2777473's user avatar
  • 3,826
7 votes
1 answer
17k views

I want to load another script file, in a site, using a userscript. But, the js.onload event doesn't work correctly. The userscript file: // ==UserScript== // @name Code highlight // @...
chunterg's user avatar
  • 138
5 votes
5 answers
7k views

I wrote JavaScript library to use FileSaver.js and its associated libraries. However, I don't want to always load FileSaver.js whenever someone wants to use my library. And I don't want to force them ...
at.'s user avatar
  • 52.8k
0 votes
2 answers
19k views

I have a question. In my file content.html I have script. When load this with the load() function of jQuery, the page shows but the script doesn't work. I think it's because of a selector. How can ...
Steffi's user avatar
  • 7,123
11 votes
3 answers
3k views

The question says it all. How to update the "src" of script tag using jQuery. Let say, I have a script, <script id="somescript" type="text/javascript" src=""></script> So when I a click ...
Awais Umar's user avatar
  • 2,087

15 30 50 per page
1
2 3 4 5