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

Add JavaScript "include" capability #167

Open
GoogleCodeExporter opened this issue Sep 2, 2015 · 9 comments
Open

Add JavaScript "include" capability #167

GoogleCodeExporter opened this issue Sep 2, 2015 · 9 comments

Comments

@GoogleCodeExporter
Copy link

It's common for JavaScript code to rely on external scripts.
However, JS workers can't use <script> tags because there is no DOM.

For current thoughts on how to implement this, see the the load() function 
described here:
  http://code.google.com/p/google-gears/wiki/NewWorkerPoolFeatures

Original issue reported on code.google.com by [email protected] on 16 Jul 2007 at 9:42

@GoogleCodeExporter
Copy link
Author

We need to think more about the right place to expose this.
  - Only in workers, or globally?
  - A global singleton, or a method on some object? (If so, which one?)
Implementation shouldn't be too bad once we decide.

Original comment by [email protected] on 18 Aug 2007 at 5:39

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 20 Aug 2007 at 7:44

  • Added labels: Milestone-M2
  • Removed labels: Milestone-M1

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 20 Aug 2007 at 7:44

1 similar comment
@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 20 Aug 2007 at 7:44

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 4 Sep 2007 at 11:21

  • Added labels: Milestone-M1
  • Removed labels: Milestone-M2

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 5 Sep 2007 at 6:22

  • Added labels: Version-0.3
  • Removed labels: Milestone-M1

@GoogleCodeExporter
Copy link
Author

The wiki page linked to is out of date. We implemented load() in 
createWorkerFromUrl(), but it does not 
take an array. It was decided that it makes most sense for a worker to decide 
what its requirements are, 
not its caller.

Therefore, we still need an include() method. The only possible functionality I 
can imagine is:

{{{
// synchronously HTTP GET this resource, then eval() it in opt_scope (or the 
global scope
// if opt_scope is not provided).
include(relativeOrAbsoluteUrl, opt_scope);
}}}

It seems a little ridiculous to have a gears module for one method, but that's 
all I can think of. I suppose 
we could go PHP-stylie and have include() and include_once() to offer slightly 
more functionality 
(include_once is what you usually want).

Original comment by [email protected] on 31 Oct 2007 at 4:04

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 27 Nov 2007 at 10:06

  • Added labels: Version-later
  • Removed labels: Version-0.3

@GoogleCodeExporter
Copy link
Author

Here you can get a solution to simulate an "include":

http://sviudes.blogspot.com/2009/09/simular-un-include-en-un-worker-de.html

Original comment by [email protected] on 14 Sep 2009 at 6:14

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

No branches or pull requests

1 participant