Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Answered

Javascript not working on WebPage

Like (0) ShareShare
ReportReport
Posted on 20 Jul 2020 22:25:14 by 8

Hi Experts,

 

I'm trying to add custom behavior in one of my portal pages and I added my javascript but I can't make it work. I'm now trying to do something even more basic such as an alert but I still can't make it work, does anyone have a clue about it?

 

 
 
 

print.png

 

I already cleared the cache, tried in different browsers but nothing, any help is welcome thanks

 

  • v-xida-msft Profile Picture
    on 22 Jul 2020 at 01:49:13
    Re: Javascript not working on WebPage

    Hi @Eoin_citizien ,

    Is the solution I provided above helpful in your scenario?

     

    If the solution I provided above is also helpful in your scenario, please also consider go ahead to click "Accept as Solution" to identify my reply as helpful.

     

    For your issue, I have made a test on my side, and the issue is confirmed on my side. The custom JavaScript code would not work in Web page "Advanced tab", instead, you need to go to the corresponding "Localized content" Advanced tab, then specify your JS code there.

    Actually, the content of a Web Page in PowerApps Portal is based on the corresponding "Localized content". If you want to made some customization changes (e.g. Page Layout, CSS Style, ...) to your Web page, you should made changes to the corresponding Content page.

     

    I would also post this issue to my Product Team, if the issue is fixed, I would reply here.

     

    Regards,

  • oliver.rodrigues Profile Picture
    9,266 Most Valuable Professional on 21 Jul 2020 at 08:04:28
    Re: Javascript not working on WebPage

    yeah it is a bit confusing but just keep in my mind that whatever relates to content you should work on the localized/content web page

    there is just no logic hiding that field for the root web page.. it is also two different forms for root/content page, so if you want you can even remove from the root web page form

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Henrique Silvestre Profile Picture
    8 on 21 Jul 2020 at 06:51:10
    Re: Javascript not working on WebPage

    Thank you it's working now I was adding the javascript in the wrong place.

     

    But if the custom javascript that "works" is within the localized content page why there is even a "custom javscript" in the main web page?

  • v-xida-msft Profile Picture
    on 21 Jul 2020 at 03:33:40
    Re: Javascript not working on WebPage

    Hi @Eoin_citizien ,

    Could you please share a bit more about your scenario?

    Do you want to add a custom JavaScript in your web page?

     

    Based on the JavaScript code that you mentioned, I think there may have something wrong with it. Please consider try the following JS code:

     

    $(document).ready(function(){
     window.alert('Alert Info......') 
    })

     

    2.JPG

    then go to your Portal Designer, then click "Sync Configuration"-> "Browser website", to make the changes you made in your Portal Management take effect.

     

    If the issue still exists, please consider take a try with @the365bit 's solution, open the Localized content of your Web page in your Portal Management:

    3.JPG

    then switch to "Advanced" tab in the opening Content page, then type above JS code inside the JavaScript section part, then click "Save" button. Then go to Portal Designer, click "Sync Configuration"-> "Browser website" to update your Portal changes.

    4.JPG

     

     

    Please try above solution, hopes it could solve your problem.

     

    Best regards,

  • Verified answer
    the365bit Profile Picture
    136 on 20 Jul 2020 at 22:30:10
    Re: Javascript not working on WebPage

    Hi @Eoin_citizien ,

     

    You are probably adding the javascript in the Web Page main record instead of the localized content page,

     

    Open your web page, scroll down to localized content subgrid and open the listed record, then go to Advanced and custom javascript. 

     

    You can see that the following screenshot only has 5 tabs available, General, Advanced, Administration, Notes and Related. The screen shot that you send even though it's cut I can see many more tabs hence you most likely are editing the wrong record.

     

     

    the365bit_0-1595284096531.png

     

     

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,075 Most Valuable Professional

Leaderboard