Load jquery-ui.min.js in Article

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed Aug 15, 2012 5:01 pm
Reply with quote
Report this post
Hi,

im trying to show a form on an article. the form contains html, javascript and jQuery.

as much as i understood i have to reference to the jQuery files in the header with
Code: Select all
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" ></script>

in the templates's index file.

looking at this file (or editing it through template manager > edit index.php) it looks like this:
Code: Select all
// No direct access.
defined('_JEXEC') or die;
// enable showing errors in PHP
ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT);
ini_set('display_errors','On');
// include framework classes and files
require_once('lib/gk.framework.php');
require_once('lib/framework/gk.const.php');
// run the framework
$tpl = new GKTemplate($this, $GK_TEMPLATE_MODULE_STYLES);

// EOF



$tpl = .... this is where the template is loaded? i think this is where the header is written and the js references are set. How can I edit these headers? its really important to me...

thanks
User avatar
Fresh Boarder

GK User
Wed Aug 15, 2012 5:37 pm
Reply with quote
Report this post
You can add custom script to your website by adding script declaration in head.php.

File: /templates/gk_bikestore/layouts/blocks/head.php
Lines: 69
Add below code for remote js from your link.
Code: Select all
$this->API->addJS('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js');

Or if you download script to your "/templates/gk_bikestore/js/jquery-ui.min.js" then use below code.
Code: Select all
$this->API->addJS($this->API->URLtemplate() . '/js/jquery-ui.min.js');


See you around...
User avatar
Platinum Boarder


cron