Widget calling external window ref
Posted: Sat May 13, 2017 2:21 am
I'm trying to create a link for APM in VL-Web application. There are two items that I'm failing to get working
The base item is supposed to go into the web page header. I seem to be able to create a new base JS item using Integration but it doesn't go into the header. I therefore have "hacked" the produced .html file to put this in. Not ideal. Is there any way to put it into the header?
The second part is probably my lack of JS knowledge. The JS put into the header creates a reference like this
<script>
var appAPM = window.appAPM || function (cfg)
{
:
: initialisation stuff
:
}
window.appAPM = appAPM;
app.callfunction();
</script>
That bit works fine. The cloud based APM sees the WebPage being started. I then have created a widget for more detailed APM items.
PROTOTYPE.uEvent = function( strEventName )
{
var appAPM = window.appAPM;
appAPM.appEvent(strEventName );
}
However, I get an error:
Uncaught TypeError: Cannot read property 'appEvent' of undefined
I am presuming from the error that appAPM isn't being correctly repointed to the window.appAPM. Is this the correct way to do the widget?
The base item is supposed to go into the web page header. I seem to be able to create a new base JS item using Integration but it doesn't go into the header. I therefore have "hacked" the produced .html file to put this in. Not ideal. Is there any way to put it into the header?
The second part is probably my lack of JS knowledge. The JS put into the header creates a reference like this
<script>
var appAPM = window.appAPM || function (cfg)
{
:
: initialisation stuff
:
}
window.appAPM = appAPM;
app.callfunction();
</script>
That bit works fine. The cloud based APM sees the WebPage being started. I then have created a widget for more detailed APM items.
PROTOTYPE.uEvent = function( strEventName )
{
var appAPM = window.appAPM;
appAPM.appEvent(strEventName );
}
However, I get an error:
Uncaught TypeError: Cannot read property 'appEvent' of undefined
I am presuming from the error that appAPM isn't being correctly repointed to the window.appAPM. Is this the correct way to do the widget?