Hello Everyone, I wanted to use the "document.rea...
# suitecommerce
a
Hello Everyone, I wanted to use the "document.ready" concept in my extension. I'm trying to use this in a custom page type. I tried the below methods but those are not working:
Copy code
initialize: function initialize(options) {
  this.on('afterShowContent', function () {
     console.log('hi');
  });

  this.on('afterViewRender', function () {
	 console.log("hi");
  });
},

afterShowContent: function afterShowContent() {
	 console.log('hi');
     return jQuery.Deferred().resolve();
},
How can we achieve "document.ready" functionality in extension view.js?
s
If you want to use
jQuery(document).ready()
, why don't you just use
jQuery(document).ready()
?
a
Hi Steve, This is working as expected, but is there any better way to achieve the same?
s
I don't know as I don't know what you're trying to achieve
a
Basically, Once DOM is load I want to hide some divs on some condition. For that, I am using
jQuery(document).ready()
s
Eh, it's as good as any other method
a
Okay, I'll use
jQuery(document).ready()
Thank you 😄