[IPOL discuss] Static JS files for sliders

Miguel Colom colom at cmla.ens-cachan.fr
Tue May 13 14:50:14 CEST 2014


Dear all,
I've added support for static content in IPOL. This is different to  
the previous feature which adds static directories for each demo. Now  
it's static files common to all demos.

We needed this because the new 3D demos incoming need to include  
common Javascript files, but we lacked the possibility of accessing  
them.

In fact, since now we were using a very inefficient way to include JS  
files: pasting their contents in the generated HTML code, at the  
server side.

For example, many demos do the following when they need to use a  
JQuery slider in params.html:
<script type="text/javascript">
<%include file="js/createlinkedslider.js" />
</script>

It works, but the contents of createlinkedslider.js are send over the  
network each time, wasting resources.
Now we can do the following:
<script type="text/javascript"  
src="http://demo.ipol.im/demo/js/createlinkedslider.js"></script>

This way, the browser caches the contents of the file and it's not  
resend again and again. If you're writing a new demo with sliders,  
please use this new way to include this JS file.

Best,
Miguel




More information about the discuss mailing list