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

accessing functions defined in bag #9

Closed
afrozl opened this issue Feb 1, 2016 · 1 comment
Closed

accessing functions defined in bag #9

afrozl opened this issue Feb 1, 2016 · 1 comment
Labels

Comments

@afrozl
Copy link

afrozl commented Feb 1, 2016

I notice that any functions defined in bag.js startup are no longer accessible in the global name space, eg:

bag.require(['/site.css', '/jquery.js', '/site.js'], function (err) {
  if (err) {
    console.log('loading error: ', err);
    return
  }
  // code to run after loading
  function testFunction() {
               console.log('hello');
       }
})
.

How do I access these named functions as

window'testFunction'
no longer works?

@puzrin
Copy link
Member

puzrin commented Feb 1, 2016

I did not changed much in bug.js last year. It just inserts css/js into the head, and it's your responsibility what to do in those scripts. It doesn't know anything about your code.

If you think this problem is related to bag.js - please provide a minimal example in test repo to reproduce. Or navigate commits history and point commit that could cause your case. But i suspect problem is not here.

@puzrin puzrin added the question label Feb 1, 2016
@puzrin puzrin closed this as completed Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants