Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » conditional loading of external JS ressources
conditional loading of external JS ressources [message #140118] Mon, 13 July 2009 09:14 Go to next message
Lars Martin is currently offline Lars MartinFriend
Messages: 24
Registered: July 2009
Junior Member
A custom RAP widget on top of OpenLayers (www.openlayers.org) map
control makes heavy use of external JavaScript ressources.

Is there any way to load the external JavaScript files under the
condition it is really needed? Currently all ressources are defined in
plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension id="de.itemis.eclipse.rap.map"
point="org.eclipse.rap.ui.resources">
<resource class="x.y.z.YahooResource" />
...
</extension>
</plugin>

All JavaScript ressources will be loaded at runtime and included in the
RAP application even if you don't need that JavaScipt because you don't
do Yahoo specific things.

Any hints?

Kindest regards, Lars
Re: conditional loading of external JS ressources [message #140447 is a reply to message #140118] Wed, 15 July 2009 10:18 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Lars,

when using the RAP resource extension it is currently not possible
to load resources on demand.
However you can try to load the external Javascript without using
the resource extension. E.g. send an Ajax request that loads the
external Javascript code before the dependant code is executed.

HTH
Rüdiger

Lars Martin wrote:
>
> A custom RAP widget on top of OpenLayers (www.openlayers.org) map
> control makes heavy use of external JavaScript ressources.
>
> Is there any way to load the external JavaScript files under the
> condition it is really needed? Currently all ressources are defined in
> plugin.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.2"?>
> <plugin>
> <extension id="de.itemis.eclipse.rap.map"
> point="org.eclipse.rap.ui.resources">
> <resource class="x.y.z.YahooResource" />
> ...
> </extension>
> </plugin>
>
> All JavaScript ressources will be loaded at runtime and included in the
> RAP application even if you don't need that JavaScipt because you don't
> do Yahoo specific things.
>
> Any hints?
>
> Kindest regards, Lars
Re: conditional loading of external JS ressources [message #140456 is a reply to message #140447] Thu, 16 July 2009 10:20 Go to previous message
Lars Martin is currently offline Lars MartinFriend
Messages: 24
Registered: July 2009
Junior Member
Rüdiger, dynamic script loading could be a solution. Thanks for the
hint. Lars

Rüdiger Herrmann wrote:
> Lars,
>
> when using the RAP resource extension it is currently not possible to
> load resources on demand.
> However you can try to load the external Javascript without using the
> resource extension. E.g. send an Ajax request that loads the external
> Javascript code before the dependant code is executed.
>
> HTH
> Rüdiger
>
> Lars Martin wrote:
>>
>> A custom RAP widget on top of OpenLayers (www.openlayers.org) map
>> control makes heavy use of external JavaScript ressources.
>>
>> Is there any way to load the external JavaScript files under the
>> condition it is really needed? Currently all ressources are defined in
>> plugin.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <?eclipse version="3.2"?>
>> <plugin>
>> <extension id="de.itemis.eclipse.rap.map"
>> point="org.eclipse.rap.ui.resources">
>> <resource class="x.y.z.YahooResource" />
>> ...
>> </extension>
>> </plugin>
>>
>> All JavaScript ressources will be loaded at runtime and included in
>> the RAP application even if you don't need that JavaScipt because you
>> don't do Yahoo specific things.
>>
>> Any hints?
>>
>> Kindest regards, Lars
Previous Topic:Animated GIF support
Next Topic:Combo writeable
Goto Forum:
  


Current Time: Mon Dec 06 12:35:02 GMT 2021

Powered by FUDForum. Page generated in 0.01383 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top