Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Uncaught TypeError: KTApp.showPageLoading is not a function


Hi,
I'm trying to implement Metronic indicator for page loading (https://preview.keenthemes.com/html/metronic/docs/base/page-loading).

I've copied sample code (js + html) from the mentioned page to my page.
On button click it reports next error in console:
Uncaught TypeError: KTApp.showPageLoading is not a function at HTMLButtonElement. <anonymous>.

I'm developing ASP.NET MVC application (not Core). Mandatory scripts for Metronic are loaded in <head> tag of _layout.cshtml.

What am I doing wrong?

Thanks for answer,
Best Regards, Valentin


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

May I know what is your Metronic version? The page loading API was added in the recent Metronic v8.1.6 version. If you are not using the latest one then please update it.

Are you using Metronic ASP.NET Core Starter Kit or integrating Metronic into your own ASP.NET application by using the HTML version assets and templates?\

How are you calling KTApp.showPageLoading ? In a click handler or on page load?
If you are calling it on page load you will need to execute your JS after all JS includes within the document ready event to make sure the code is executed once all JS resources are loaded:


// On document ready
KTUtil.onDOMContentLoaded(function() {
KTApp.showPageLoading();
});


If you need any further help please provide us more details.

Regards.



Hi,

All clear, I'm using version 8.1.5. I haven't been able to update to 8.1.6 yet.
I'll update first and try again with page loading indicator later.

Thanks for you help and
Best Regards,
Valentin



You are most welcome. All the best with your project!


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(