Jump to content

how to use jquery / javascript code online version in pw?


lord_dupalski
 Share

Recommended Posts

how do I get jquery/javascript code online and use it on pw?

I'm trying to port my static html in pw by the way.

post-2613-0-68134200-1412601082_thumb.pn

I successfully used the css code since there are css files included in my template folders which I placed it there.

and used the <?php echo $config->urls->templates?> to make it work. see code above.

however there is a jquery code which is being called online. I know <?php echo $config->urls->templates?> wont work.

So how do I call it in pw? to make the jquery codes work?

it doesnt work if I left it like that by the way.

or should I just download the js files place it on my scripts folder then use <?php echo $config->urls->templates?> way again?

Link to comment
Share on other sites

Assuming you have your Javascript in your templates folder, do exactly as you would for css.

So, if your scripts are in a folder called js, then

<script src="<?php echo $config->urls->templates?>js/jmyscript.min.js"></script>

EDIT:

The trick here is to think of your /site/templates/ folder as the root of your site, with the exception that you need to be explicit about the paths when including script and css files.

So, you might have

/site/templates/

--js

--css

--images

mytemplatefile.php

  • Like 1
Link to comment
Share on other sites

What you have hilighted works as long as you have jquery in your js folder.

If you are trying to use it from a CDN, then just call the CDN as you have done.

However, do remember you MUST load JQuery first before any other jquery plugin. So;

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="<?php echo $config->urls->templates?>js/jquery.myplugin.min.js"></script>
Link to comment
Share on other sites

Joss

the code works as it is since it is a working template from responsee. when I just use the original html file from the template.

im trying to port it on pw, right now im just changing the path of the files (css, js ) etc.. to make it look like the original template

the problem is i dont think the .js files are being loaded by pw? thats why the slider and the feature slider at the bottom part wont show up

also the logo?

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
 Share

×
×
  • Create New...