web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

JS not executing on Portal Web Page.

(0) ShareShare
ReportReport
Posted on by 51

Im trying to run some custom JS code to target the 'Reset Password' page (which we can't access like the Sign In page) to customize its styling.
I've already done this in the past to target the Sign In page - and that's never been an issue and has worked well.

So my process, create new JS file, create new Web File in Portal Management (configure everything the same as the Signin JS file except obviously the name.  Upload the JS file to the note.
This is the JS Code:

$(document).ready(function () {
if(window.location.href.includes("ResetPassword")) {
alert("Reset your Password! ");
} else {
alert("URL: " + window.location.href);
}
});

I then clear server cache (and browser cache to be on safe side), go to the login page of the portal.  In browser debug i can see JS code, but its not executing (if though it has else statement on the if)

pastedimage1675915749853v1.png

I then go to the Reset Password page (via link in email which i triggered), the JS code is present (like with the login page) but it would also appear to not be triggered as no JS alerts are appearing

As a side thing - i did notice that the JS code i did awhile back for the Login Page (added thru same process) appears 'differently' within the code - in that appears encapsulated within these DIV's
pastedimage1675916127078v2.png
I also note - i added an Alert statement within the Login Page code, but it appears the system doesn't update from the old JS file.

I also thought id test something different - i added some <script> tags into the HTML of the navbar (with an alert).  after reloading page (and clearing cache) the JS code is visible, but once again no JS code is executing.

Can anyone offer any ideas?

I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 123 Super User 2025 Season 2

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 89

#3
#ManoVerse Profile Picture

#ManoVerse 85

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans