Jump to content

Displaying script on page for module?


Guest

Recommended Posts

Hey guys,

 

I can't figure out why this code won't work for displaying script tags to go alongside the js added for the module I am creating. Any advice would be greatly appreciated!

 

 

public function headerHTML() {
 
     $html = '
      <script type="text/javascript">
          $(document).ready(function() {
 
         $("#owl-example").owlCarousel({
         autoplay: true
       });
 
       });
   </script>
   ';
 
  return $html;
 }
Edited by Guest (see edit history)
Link to comment
Share on other sites

Hey vekia,

 

I'm actually a little confused. This function is in my press.php file (the name of the module is press) and I don't understand how to call the function. Do I need to extend a controller? I can't find out how the other modules do it. Where are all these functions being called form in general? The controllers?

 

**Sorry, I'm in the process of learning PHP right now.

Edited by Guest (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...