Countdown - 2.5. Integrate JavaScript Exercise error
Question
Application Type
Mobile
Service Studio Version
11.14.15 (Build 60176)

Outsystems Front end developers course:

https://www.outsystems.com/training/paths/16/becoming-a-front-end-developer-in-outsystems/ .

Creating and Extending Patterns

https://www.outsystems.com/training/lesson/2557/integrate-javascript-exercise?LearningPathId=16

I did exercise "2.5. Integrate JavaScript Exercise.en-US.pdf". it gives this error if I try to use the block:


I added console.log" to see where it gets a problem, and up til just before this sentece:

if (window.$countdownMap.has($parameters.Class)) {


I attached the Countdown.oml, if anyone wants to look why it is not working, thank you


Countdown.oml

mvp_badge
MVP
Solution

Hi Elizabeth,

1) As already mentioned by other community members, the Countdown JS script is empty in your module. You need to copy the js from the countDown.min.js file included in the course resource folder as highlighted below

2) Class defined in the Countdown block's Class input parameter is invalid

3) Countdown block should only reference the Countdown js script from Scripts folder. i.e. Don't reference the same JS in screen scope.

See this demo: CountdownDemo

Refer to the attached updated oml

I hope this helps you!


Kind regards,

Benjith Sam

Countdown.oml

Thank you, it worked

mvp_badge
MVP

Hi,

I checked it your oml and it you are using countdown JS it is empty js


Coutdown js is library and here define the countdown function so it is not able to find you need to add correct countdown JS.


Hope this will help you.

Hello

Thank you for looking at it, I see I uploaded an older version. The correct version below is uploaded, where I DID add the Js library :

Countdown.oml

I added the script code there:

And I can see the code in Console

I uploaded the new .oml below.

But still same error.

Countdown.oml

Hi,

   I checked your correct version but it's still empty.

Screenshot (23).png

mvp_badge
MVP
Solution

Hi Elizabeth,

1) As already mentioned by other community members, the Countdown JS script is empty in your module. You need to copy the js from the countDown.min.js file included in the course resource folder as highlighted below

2) Class defined in the Countdown block's Class input parameter is invalid

3) Countdown block should only reference the Countdown js script from Scripts folder. i.e. Don't reference the same JS in screen scope.

See this demo: CountdownDemo

Refer to the attached updated oml

I hope this helps you!


Kind regards,

Benjith Sam

Countdown.oml

Thank you, it worked

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.