Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading TopUp in $.getScript #12

Open
timkelty opened this issue Feb 26, 2010 · 0 comments
Open

Loading TopUp in $.getScript #12

timkelty opened this issue Feb 26, 2010 · 0 comments

Comments

@timkelty
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant