Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author miunosoft

    (@miunosoft)

    To enqueue scripts you can use the enqueueScript() method.

    $this->enqueueScript(
        $sUrlOrPath, // source url or path
        $sPageSlug     // page slug
    );

    For CSS, use enqueueStyle().

    $this->enqueueStyle(
        $sUrlOrPath, // source url or path
        $sPageSlug     // page slug
    );

    As for Ajax, an easy way I can think of is to use jQuery and send an Ajax request to the currently loading page with additional url query key-values. Then in the start() meethod, which is a user constructor of the factory class you extend, check the $_GET array and if a desired key is set, perform a certain task and return relevant output.

    If you need more help regarding Ajax, create a new topic. Let’s resolve the enqueuing issue you are having first.

    Thread Starter eynugget

    (@eynugget)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘enqueue scripts / setup ajax’ is closed to new replies.