Hi @Kruthiventi, BalaSuryaSarathSairam ,
Azure B2C uses its own custom jQuery library, so not all of the document.ready methods work. One workaround is to use the MutationObserver method and searching for the #api element on the page, as discussed in the thread here.
Another option is to use document.Ready():
$( document ).ready(function() {
console.log( "ready!" );
// now call the JS code in here
});