jQuery code stopped functioning/working

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
WABez
User
Posts: 202

jQuery code stopped functioning/working

Post by WABez »

Just as a matter of interest, I have now converted another small project to PHPMaker 2020.0.4 and I seem to have a similar problem where the JQuery code stopped functioning/working in PHPMaker 2020 builds, however the exact same code works just fine in previous PHP Maker version's builds (i.e. PHPMaker 2019 and before).


arbei
User
Posts: 9406

Post by arbei »

From the help file (see the topic Server Events and Client Scripts > Page_Head):
Note: PHPMaker (v2020) uses loadjs to load JavaScripts and stylesheets, you can use loadjs() and loadjs.ready() functions in your script tags.

So you should use:

loadjs.ready("load", function() {

// your code

});


WABez
User
Posts: 202

Post by WABez »

Thank you, sorted!


christ2000
User
Posts: 519

Post by christ2000 »

hello how di you sorted this?

i try but not look

thanks


WABez
User
Posts: 202

Post by WABez »

As Arbei mentioned:

loadjs.ready("load", function() {

// your code

});

So instead of using:

$(document).ready(function() {

// your code

})

REPLACE: $(document).ready(function() {
WITH: loadjs.ready("load", function() {


Post Reply