cancel
Showing results for 
Search instead for 
Did you mean: 

Include other webscripts inside current webscript (javascrip

techyguy
Champ in-the-making
Champ in-the-making
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.
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.)
3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator
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

drozes
Champ in-the-making
Champ in-the-making
a

afaust
Legendary Innovator
Legendary Innovator
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