1

I've been working with Adobe Edge for some time now and I also want to use the Preloader to load data for my composition via AJAX. To achieve this I created the following code inside the Preloader>loading-Event. Which event is a bit of a Problem because there is no documentation at all for that, so I have not the slightest idea when it is fired.

// this little fella is fetching url-
// parameters and puts them in a var called GET
(function () {
    window.GET = {};
    var s = window.location.search.substring(1).split('&');
    if (!s.length) return;
    for (var i = 0; i < s.length; i++) {
        var parts = s[i].split('=');
        window.GET[unescape(parts[0])] = unescape(parts[1]);
    }
}())

var playlist = GET["l"],
    playlistLoadSuccessHandler = function (data, status, xhr) {
        console.log(data);
    };

$.ajax({
    url: playlist,
    dataType: 'xml',
    success: playlistLoadSuccessHandler
});

So and all I'm getting is this: Uncaught ReferenceError: $ is not defined

Has anyone a little more experience in Adobe Edge than me and knows what my mistake is here?

Quentin
  • 800,325
  • 104
  • 1,079
  • 1,205
gonzo187
  • 35
  • 5
  • Where are you loading jQuery? – tymeJV Nov 05 '13 at 14:02
  • it should be implemented by the edge runtime by the time my code is executed. if I print "this" inb4 my code i can see that $ is present and properly filled with jquery. – gonzo187 Nov 05 '13 at 14:04
  • If jQuery IS loaded, try jQuery.ajax({ as you may not have defined $ – Zork Nov 05 '13 at 14:05
  • and i read several examples on using jquery in the preloader, which all referenced - as usual - jquery with $ – gonzo187 Nov 05 '13 at 14:05
  • Ahh, my bad. Not to familiar with Adobe-Edge – tymeJV Nov 05 '13 at 14:05
  • already tried that and it brings the same error only with $ replaced by jQuery :/ – gonzo187 Nov 05 '13 at 14:06
  • http://stackoverflow.com/questions/2075337/uncaught-referenceerror-is-not-defined Are you calling in the jQuery scripts in first? – Zork Nov 05 '13 at 14:07
  • thank you! this might be the solution. i checked the load-timeline of the scripts and indeed is edgePreload.js ahead of jquery.js i will try to solve this and post my solution ASAP :) – gonzo187 Nov 05 '13 at 14:14

1 Answers1

0

Apparently that's the way Edge works. jQuery is loaded after the preloader has done its work. I will try to get around without jQuery and use good 'ol native JS until Adobe shows some mercy and fixes this.

gonzo187
  • 35
  • 5