Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Kilian Hekhuis
MVP
8
Views
18
Comments
Referencing external javascript needing jquery
Question
I want to reference an external javascript file that also needs jquery to run. On platform 6 and below, I did a AddJavaScriptTag from the HttpRequestHandler extension, but since that tag is placed at the top of the body section, no jquery is loaded at that stage. I also included a recent version of jquery, but on platform 8 that doesn't work if I select the 1.8 version because of conflicts occuring. So my question is: how can I add a reference to an external javascript resource that needs jquery?
Pedro Cardoso
Hello Kilian,
take a look at this API: https://www.outsystems.com/help/servicestudio/8.0/default.htm#APIs/IncludeJavascript/Overview_of_the_IncludeJavascript_API.htm
I think that it might help you.
Cheers
Pedro Cardoso
João Fernandes
Hi Killian,
Have you tried using the HttpRequestHandler extension?
Pedro's answer is also something to consider. Using the
Include Javascript API
, you'll be able to add your script to all screens of all applications. So if you have a script to perform user tracking, like google analytics, probably the best way is to use this API.
Just for reference, if you want to write your own javascript, you should use the
'Javascript' property of your Screens
.
Kilian Hekhuis
MVP
Hi Pedro, Joao,
I need this script only on selected pages (it's a charts library), and I need it referenced, not copy/pasted into the javascript. So what I need is a link to the external javascript file, but after the platform loading of jquery (since this particular library depends on it). So neither Include_Javascript nor including it in the Javascript property cuts it, in this particular use case.
1 reply
05 May 2014
Show thread
Hide thread
Tiago Simões
Staff
Hi Killian,
You can always use AddJavaScriptTag twice, first for loading the required jQuery version (the platform allows you to load an external jQuery version, and you could
use a cdn
), and last to load your required resources.
Cheers,
Tiago Simões
Pedro Cardoso
Kilian,
can you share a sample espace for us to try to help?
Pedro
Kilian Hekhuis
MVP
Hi Tiago,
That's what I did on platform 6 (and we still do on platform 8 when using the older OS version of jquery), but when I do that on a "fresh" eSpace on platform 8 (using the platform jquery 1.8.2), I get conflicts between the included jquery and the platform included jquery.
Kilian Hekhuis
MVP
Hi Pedro,
I could, but the use case is really simple. I'm trying to include the latest High Charts, which needs jquery, but I can't get the externally referenced High Charts to be included after the platform jquery, as explained.
J.
MVP
and the forge highcharts component?
(it used to work with 5 afaik, check on older versions perhaps)
Kilian Hekhuis
MVP
@Statler: The reason why I didn't mention what specific external js I was trying to interface is to avoid such specific answers :). Imho this is a general issue, viz. how to include a link to an external javascript library that needs jquery.
J.
MVP
NP,
but I think we are lacking a proper solution
(noticing this thread:
https://www.outsystems.com/forums/discussion/10999/cant-load-jqueryui-in-the-right-order/
)
Kilian Hekhuis
MVP
Mmm, that indeed seems to be a very similar problem. It doesn't look too good...
J.
MVP
Bugger, in the same boat now.
I need to add a languages.js. because inline webblock will screw up the characters...
Omran Bhatti
How do you up date JQuery version from :- 1.4.0 to 1.8.1 or 1.8.2 ??????
Kilian Hekhuis
MVP
Omran, I don't think your question has anything to do with this thread. You'd better start a new post, explaining exactly what you want to do. Also, one question mark will already make us understand it's a question, so no need to use six.
Omran Bhatti
I already figured it out.... thanks any way for that pretty useless advice !!!!!!
Kilian Hekhuis
MVP
Omran, if you use a single exclamation mark, we already understand you are shouting, so no need to use six. Perhaps your question mark and exclamation mark keys are stuck?
Omran Bhatti
THIS IS SHOUTING ..... exclamation marks ... as the name suggests ...are exclamations ...if nothing else Kilian u r very good at counting to 6 ..well done !!!!!!!!!
Kilian Hekhuis
MVP
I can even count to 9. It seems you feel the need to exclaim yourself quite extensively.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...