Recently one of our customers asked me why I use #IMAGE_PREFIX# substitution string instead of /i/ in my Oracle APEX application when I refer to server located files (Tomcat in this example). The reason is quite simple – it’s not always /i/.
You can configure your server files path in Application Builder>Application>Shared Components>Edit Application Definition>User Interface by editing “Image prefix” option.
So it’s better idea to use universal:
1
|
<script type=“text/javascript” src=“#IMAGE_PREFIX#jQuery/js/jquery-1.4.2.min.js”></script>
|
than hardcoded:
1
|
<script type=“text/javascript” src=“/i/jQuery/js/jquery-1.4.2.min.js”></script>
|
Remember also about difference between three substitution strings for files in Oracle Application Express:
- #IMAGE_PREFIX# – points to virtual path of server “images” directory (default /i/);
- #APP_IMAGES# – points to static files uploaded with APEX upload utility (so saved in database), that are related to specific application (and only this application can use them);
- #WORKSPACE_IMAGES# – points to static files uploaded with APEX upload utility (so saved in database), that are related to the workspace (any application can use them).