65 questions
1
vote
0
answers
236
views
Nextjs 14 dynamic import script ERROR: Cannot find module
With Nextjs 14 i'm trying to create a component that can switch the running script depending on a prop that is passed:
TLDR. I'm not trying to import a component or a node_module, this is an external ...
1
vote
3
answers
1k
views
Using Query to select column based on the headers
I have a dynamic table where columns are moved every now and then. Therefore, I would like to reference my column name in my query. Unfortunately I do not know so well and the internet raises more ...
2
votes
1
answer
265
views
How to load CSS file in qooxdoo dynamically
Is there a special qooxdoo class to load CSS files dynamically like qx.util.DynamicScriptLoader does for JavaScript files?
For example, depends on user choice what geo maps he wants to use an ...
0
votes
0
answers
265
views
Load External Script dynamically in Angular 8
I have built an application that loads articles into a page component using an api from our server. The article loads correctly. Where I am having a problem is I have an embedded script in the api ...
0
votes
1
answer
82
views
JavaScript : Can anyone give an example when callback in callback (Pyramid of Doom) is needed?
The below code does callback inside a callback. Why this is needed? Why can't it be 3 separate calls? Note loadScript just going to create a style tag and add script passed to the src attribute ...
1
vote
1
answer
1k
views
Is there any useful mime for <script type="mime" src="..."> except for JS?
From much reading I conclude:
The <script> tag can store data, but it is only accessible if src is not used.
I want to use src because it is how my script-loader works.
Is the type attribute ...
0
votes
1
answer
184
views
Adding external library to my Angular 6 project only works when I'm running in localhost
I dynamically added the Chrome Api Library (from https://www.gstatic.com/cv/js/sender/v1/cast_sender.js) to my project, and works as expected when I run using localhost:4200. However it doesn't work ...
-16
votes
2
answers
645
views
How to Garbage Collect an external Javascript load?
Given a loader:
function loader(src, callback, fail) {
let s = document.head.appendChild(document.createElement('script'));
s.type = "text/javascript";
s.src = src;
s.onload = ...
0
votes
0
answers
44
views
How to lazily load components from another host?
How to lazily load components from another host in Angular?
Hello guys. I have a problem with Angular. My web application is deployed on a certain server(e.g. http://www.a.com), and my javascript ...
4
votes
1
answer
8k
views
Dynamically Script Loading Zendesk Widget
I have been trying to save resources on the page by not loading the Zendesk Widget unless required.
If i manually add to a page the following tag everything works just fine:
<script id="ze-...
0
votes
0
answers
413
views
Why does Vue not initialize when loaded via a script-loader?
I need to load VueJS dynamically using a script loader but I'm unable to understand why Vue doesn't initialize.
Here's my simple script-loader:
(function( w ){
var loadJS = function( src, cb ){
...
0
votes
2
answers
232
views
I have loading iframe by adding scripts dynamically. But getting a Reference error as $ is not defined
I'm calling the function after adding the jquery script. but still, I'm getting a Reference error
<script>
window.onload = function(){
AddScript("https://cdn.syncfusion.com/js/...
0
votes
1
answer
175
views
How to dynamically add scripts tag at each Sub-domain level through single angular application?
I have tired some of DOM operation like,
document.createElement
document.write
The document.createElement way requires a standard script structure . But in my case it can be either a java ...
2
votes
2
answers
6k
views
Immediately execute dynamically loaded JS script
at the top of the head of my document I dynamically load a script:
<script>
var script = document.createElement("script");
script.setAttribute("src", "mydomain.com/main.js");
var head = ...
0
votes
1
answer
2k
views
Insert dynamic onClick event script in Google Optimize
I need to add a html element, a button, trough the Google Optimize experiment and it has to perform a certain script depending on the experiment.
I have tried to do it in the following ways:
<...