Include other webscripts inside current webscript (javascrip
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2012 12:42 PM
Hello everybody;
My current application setup requires I have 1 main controlling webscript which routes request to the appropriate webscript.
I've been using the following code to hit other webscript through the remote object.
Than I process the response. This works but has many issues.
issues:
- HTTP session seems to be seperate even though they are on the same domain and using same protocall.
- the model object is not the same (different webscript so it makes sense).
There must be a way to include other webscript without calling them through the Remote object.
(Another solution that I've implimented for the time being is making 1 Controller Webscript and have the other webscript just JS files that get included.)
My current application setup requires I have 1 main controlling webscript which routes request to the appropriate webscript.
I've been using the following code to hit other webscript through the remote object.
var connector = remote.connect('http');var response = connector.get(controllerUrl);
Than I process the response. This works but has many issues.
issues:
- HTTP session seems to be seperate even though they are on the same domain and using same protocall.
- the model object is not the same (different webscript so it makes sense).
There must be a way to include other webscript without calling them through the Remote object.
(Another solution that I've implimented for the time being is making 1 Controller Webscript and have the other webscript just JS files that get included.)
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2012 03:16 AM
Hello,
at the moment your way is the only way for dynamic inclusion of other JavaScript. There is an import directive but this is a static preprocessor directive unable to react to your dynamic evaluations.
I have recently submitted a contribution which allows for dynamic import of JavaScript - see my blog post for details.
Regards
Axel
at the moment your way is the only way for dynamic inclusion of other JavaScript. There is an import directive but this is a static preprocessor directive unable to react to your dynamic evaluations.
I have recently submitted a contribution which allows for dynamic import of JavaScript - see my blog post for details.
Regards
Axel
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2012 11:31 AM
a
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2012 12:57 PM
Hello,
regardless of what import mechanism you use - if your controller web script is on Share and the web scripts you want to include are in the Repository, you have to call them via the remote object. There is no way around that.
I overlooked this potential use / motivation in my first read-through of your question.
Regards
Axel
regardless of what import mechanism you use - if your controller web script is on Share and the web scripts you want to include are in the Repository, you have to call them via the remote object. There is no way around that.
I overlooked this potential use / motivation in my first read-through of your question.
Regards
Axel
