Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

AP is not defined

Deleted user
March 7, 2017

In an Atlassian connect plugin, we've this code

$(document).ready(function() {
    AP.require('request', function(request) {

which works fine, but sometimes and randomly we receive the error message in the object

AP is not defined

And this is not related to a specific browser or OS

Any idea of why this happens?

Any suggestion on what to investigate?

Thanks

 

 

That's the head section of my web panel

<html lang="en">
    <head>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <script src="//aui-cdn.atlassian.com/aui-adg/6.0.6/js/aui.min.js"></script>
        <link rel="stylesheet" href="//aui-cdn.atlassian.com/aui-adg/6.0.6/css/aui.min.css" media="all">
        <link rel="stylesheet" href="mycustom.css">
        <script src="mycustom.js"></script>
    </head>

and that's the last part of the body

<!-- Stop the loading addon message -->
    <script id="connect-loader" data-options="sizeToParent:true;">
        (function() {
            var getUrlParam = function(param) {
                var codedParam = (new RegExp(param + '=([^&]*)')).exec(window.location.search)[1];
                return decodeURIComponent(codedParam);
            };

            var baseUrl = getUrlParam('xdm_e') + getUrlParam('cp');
            var options = document.getElementById('connect-loader').getAttribute('data-options');
            var script = document.createElement("script");
            script.src = baseUrl + '/atlassian-connect/all.js';

            if (options) {
                script.setAttribute('data-options', options);
            }

            document.getElementsByTagName("head")[0].appendChild(script);
        })();
    </script>
</body>

as described in the Atlassian dev documentation

1 answer

0 votes
Brian Kestenholz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 23, 2011

I fixed it. Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events