You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to load Topup in a getScript function, which works fine.
My problem comes when I try to define my images and players path. If those are inside any function (like a document ready), everything seems to blow up.
Here's exactly what I'm trying to do:
$(document).ready(function() {
var $vids = $('a[href$=.mov], a[href$=.flv]');
if (! $vids.length) { return; }
$.getScript('/assets/scripts/topup/top_up.js', function(){
TopUp.images_path = "/assets/scripts/topup/images/top_up/";
TopUp.players_path = "/assets/scripts/topup/players/";
$vids.attr('toptions', 'width=600, height=400, overlayClose=1, layout=quicklook, effect=clip');
});
});
I can't define TopUp.images_path and TopUp.players_path outside of the function, because topup isn't loaded yet so TopUp is not defined. But if I do it inside the function it doesn't work.
Any tips?
The text was updated successfully, but these errors were encountered:
I'm trying to load Topup in a getScript function, which works fine.
My problem comes when I try to define my images and players path. If those are inside any function (like a document ready), everything seems to blow up.
Here's exactly what I'm trying to do:$vids = $ ('a[href$=.mov], a[href$=.flv]');
$(document).ready(function() {
var
if (! $vids.length) { return; }
$.getScript('/assets/scripts/topup/top_up.js', function(){
TopUp.images_path = "/assets/scripts/topup/images/top_up/";
TopUp.players_path = "/assets/scripts/topup/players/";
$vids.attr('toptions', 'width=600, height=400, overlayClose=1, layout=quicklook, effect=clip');
});
});
I can't define TopUp.images_path and TopUp.players_path outside of the function, because topup isn't loaded yet so TopUp is not defined. But if I do it inside the function it doesn't work.
Any tips?
The text was updated successfully, but these errors were encountered: