Use of javascript/jquery cdn or calling another js file

Status
Not open for further replies.

akmag47

Joined
Feb 21, 2015
Messages
15
Reaction score
0
Trying to see if there is a possibility to use a jquery/javascript cdn or another external javascript file within the javascript file defined in the 3CX VAD.

I have some ideas in mind that I would like to implement and it would make use of this concepts but so far, what I have only been able to do is create several functions within the javascript file in the libraries folder and use them.

An example doing this:

Calling this on the javascript file:
<script src="https://cdnjs.cloudflare.com/ajax/libs/6px/1.0.3/6px.min.js">
And then try to use the functions defined here would not allow the 3cx application to work as intended.

I've also tried (in test.js):

function createEl()
{
var oJs = document.createElement('script');
oJs.setAttribute('type','text/javascript');
oJs.setAttribute('src','test1.js');
document.getElementsByTagName('head')[0].appendChild(oJs);
var response = call();
return response;
}

Then on test1.js (resides on the same directory):

function call()
{
var voice = "ha ha ha";
return voice;
}

But it doesnt retrieve the call function and only loops at the beginning of the call.

Any thoughts?
 
Hi there,

Please note that the application generated will not run in a standard browser. So for example calling:
document.getElementsByTagName('head')[0].appendChild(oJs);

will not work at all...

You can't use jquery or load external javascript libraries from here, that will not work.

If you need to do it, maybe you can create your own web service, and use jquery from there. From the VAD you just call the web service.

Kind regards.
 
Ah, ok. While that is a setback, I think I can work around that. Thanks!
 
Status
Not open for further replies.

Forum statistics

Threads
112,322
Messages
591,887
Members
165,470
Latest member
Robert Lee