Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

dynamics 365 marketing portal/ JS is not working in localized content of web page

(0) ShareShare
ReportReport
Posted on by 15

Hi guys,

In my dynamics 365 marketing portal, I add this simple js  in localized content of my passes web page (advance option) and it didn't work. 

Please have you an idea about. 

$(document).ready(function() {
alert("Test");
});

Many thanks.

  • cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: dynamics 365 marketing portal/ JS is not working in localized content of web page

    Hi Jean,

    Please let me know whether your problem could be solved.

    Regards,

    Clofly

  • Suggested answer
    cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: dynamics 365 marketing portal/ JS is not working in localized content of web page

    Hi Jean,

    1. Could you share me screenshot of:

    -> your passes web page(advance option)

    -> localized content

    2. Did you use marketing portal for hosting event website?

    If so, event portal is built with Angular and we should follow Angular syntax.

    As per my understanding and experience, pass web page is located in src\app\components\event\passes,

    if you would like to show an alert when open the page, then add alert inside ngOnInit function inside passes.component.ts.

    pastedimage1574652955685v1.png

    3. The code is jQuery function(only $(document).ready(function() {})), you could add reference to jQuery cdn file in index.html for test:

    pastedimage1574652298991v1.png

    However, the alert will work for all pages because it's on root page,

    while custom script on other child pages will be ignored whatever using jQuery or not,

    that's by Angular framework design.

    So if you want to make customization on pass web page, please achieve your logic in corresponding ts file, as I did in point 2.

    In addition, jQuery could still work under Angular, but you should develop the event portal code locally to import jQuery module,

    and it's not recommended because design of those 2 frameworks are different. 

    https://blog.bitsrc.io/how-to-use-jquery-with-angular-when-you-absolutely-have-to-42c8b6a37ff9

    Regards,

    Clofly

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans