cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

201
Views
0
Helpful
1
Replies
Contributor

Finesse Gadget - problem loading jQuery when on external server

Sorry - this is likely a very obvious / simple problem (to some!).

 

When I use a sample gadget which is loaded to the 3rdpartygadget/files folder on the finesse server - the gadget works.

When I use it on a external webserver it does not and this seems to fail due to JavaScript Libraries not loading - e.g. I get an error for the jQuery not loading correctly.

 

I see the below error in the logs - which does not occur when I use use the finesse hosted version:

 

https%3A%2F%2Fmyservername%2Fgadget%2FUpdateCallVariableData%2FUpdateCallVariableDataSampleGadget.js:21628 Uncaught ReferenceError: jQuery is not defined

 

I have used the below in my XML - which I thought would allow it to retrieve the finesse hosted jQuery?

<script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/jquery.min.js"></script>

Below is my full XML file.

 

<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Update Call Variable Data"
description="Update Call Variable Data">

<Require feature="settitle" />
<Require feature="dynamic-height" />
<Require feature="pubsub-2" />
<Require feature="setprefs" />
<Require feature="loadingindicator">
<Param name="manual-dismiss">false</Param>
<Param name="loading-timeout">60</Param>
</Require>
</ModulePrefs>

<Content type="html">
<![CDATA[
<!DOCTYPE html>
<!-- Styling -->
<link rel="stylesheet" href="UpdateCallVariableDataSampleGadget.css" type="text/css" />

<UserPref name="scheme" display_name="scheme" default_value=""/>
<UserPref name="host" display_name="host" default_value=""/>
<UserPref name="hostPort" display_name="hostPort" default_value=""/>

<!-- jQuery -->
<script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/jquery.min.js"></script>

<!-- Finesse Library -->
<script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/finesse.js"></script>

<!-- Gadget Business Logic -->
<script type="text/javascript" src="UpdateCallVariableDataSampleGadget.js"></script>

<body class="claro">
<div> 
<fieldset id="callvariableset" class="outline">
<div id="callVariablesDiv"></div>
</fieldset>
</div>
</body>

<script type="text/javascript">
// initialize the gadget running the init handler defined in UpdateCallVariableDataSampleGadget.js
gadgets.HubSettings.onConnect = function () {
finesse.modules.SampleGadget.init();
};
</script>
]]>
</Content>
</Module>

Any ideas on what I am doing incorrectly?

Gerry

1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

Re: Finesse Gadget - problem loading jQuery when on external server

It was a simple error!

 

I had place the below incorrectly into Content Section. While it should be have placed into the Main Module section

 

<UserPref name="scheme" display_name="scheme" default_value=""/>
<UserPref name="host" display_name="host" default_value=""/>
<UserPref name="hostPort" display_name="hostPort" default_value=""/>	

Here the full XML file for reference and it works fine now.

 

<?xml version="1.0" encoding="UTF-8"?>
<Module>
    <ModulePrefs title="Update Call Variable Data"
            description="Update Call Variable Data">

        <Require feature="settitle" />
        <Require feature="dynamic-height" />
        <Require feature="pubsub-2" />
        <Require feature="setprefs" />
        <Require feature="loadingindicator">
            <Param name="manual-dismiss">false</Param>
            <Param name="loading-timeout">60</Param>
        </Require>
    </ModulePrefs>

    <UserPref name="scheme" display_name="scheme" default_value=""/>
    <UserPref name="host" display_name="host" default_value=""/>
    <UserPref name="hostPort" display_name="hostPort" default_value=""/>	

    <Content type="html">
        <![CDATA[
            <!DOCTYPE html>
            <!-- Styling -->
            <link rel="stylesheet" href="UpdateCallVariableDataSampleGadget.css" type="text/css" />

 
			<!-- jQuery -->
			<script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/jquery.min.js"></script>
 
			<!-- Finesse Library -->
			<script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/finesse.js"></script>		

            <!-- Gadget Business Logic -->
            <script type="text/javascript" src="UpdateCallVariableDataSampleGadget.js"></script>

            <body class="claro">
                <div>                    
                    <fieldset id="callvariableset" class="outline">
                        <div id="callVariablesDiv"></div>
                    </fieldset>
                </div>
            </body>

            <script type="text/javascript">
                // initialize the gadget running the init handler defined in UpdateCallVariableDataSampleGadget.js
                gadgets.HubSettings.onConnect = function () {
                    finesse.modules.SampleGadget.init();
                };
            </script>
        ]]>
    </Content>
</Module>

 

 

View solution in original post

1 REPLY 1
Contributor

Re: Finesse Gadget - problem loading jQuery when on external server

It was a simple error!

 

I had place the below incorrectly into Content Section. While it should be have placed into the Main Module section

 

<UserPref name="scheme" display_name="scheme" default_value=""/>
<UserPref name="host" display_name="host" default_value=""/>
<UserPref name="hostPort" display_name="hostPort" default_value=""/>	

Here the full XML file for reference and it works fine now.

 

<?xml version="1.0" encoding="UTF-8"?>
<Module>
    <ModulePrefs title="Update Call Variable Data"
            description="Update Call Variable Data">

        <Require feature="settitle" />
        <Require feature="dynamic-height" />
        <Require feature="pubsub-2" />
        <Require feature="setprefs" />
        <Require feature="loadingindicator">
            <Param name="manual-dismiss">false</Param>
            <Param name="loading-timeout">60</Param>
        </Require>
    </ModulePrefs>

    <UserPref name="scheme" display_name="scheme" default_value=""/>
    <UserPref name="host" display_name="host" default_value=""/>
    <UserPref name="hostPort" display_name="hostPort" default_value=""/>	

    <Content type="html">
        <![CDATA[
            <!DOCTYPE html>
            <!-- Styling -->
            <link rel="stylesheet" href="UpdateCallVariableDataSampleGadget.css" type="text/css" />

 
			<!-- jQuery -->
			<script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/jquery.min.js"></script>
 
			<!-- Finesse Library -->
			<script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/finesse.js"></script>		

            <!-- Gadget Business Logic -->
            <script type="text/javascript" src="UpdateCallVariableDataSampleGadget.js"></script>

            <body class="claro">
                <div>                    
                    <fieldset id="callvariableset" class="outline">
                        <div id="callVariablesDiv"></div>
                    </fieldset>
                </div>
            </body>

            <script type="text/javascript">
                // initialize the gadget running the init handler defined in UpdateCallVariableDataSampleGadget.js
                gadgets.HubSettings.onConnect = function () {
                    finesse.modules.SampleGadget.init();
                };
            </script>
        ]]>
    </Content>
</Module>

 

 

View solution in original post

CreatePlease to create content
Content for Community-Ad
FusionCharts will render here