Adding Jquery to Concrete5

Permalink 2 users found helpful
Hi, I am new to Concrete5 and love it so far, but I am having problems getting Javascript to work. I have cufon and a bit of script to pull in a twitter feed. Neither is working although they were before I made the site into a C5 site. Could someone advise me where I am going wrong please?

This is my header code:

<?php
defined('C5_EXECUTE') or die("Access Denied.");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('typography.css')?>" />
<link rel="icon" href="<?=$this->getThemePath()?>/images/favicon.ico" type="x-icon" />
<link rel="shortcut icon" type="x-icon" href="<?=$this->getThemePath()?>/images/favicon.ico" />

<? Loader::element('header_required'); ?>

<script src="<?php echo $this->getThemePath() ?>/js/cufon.js" type="text/javascript"></script>
<script src="<?php echo $this->getThemePath() ?>/helvetica_700.font.js" type="text/javascript"></script>
<script type="text/javascript">

Cufon.replace('h1');
Cufon.replace('h1.page_title');

</script>
</head>

Many thanks in advance!

 
bridgetdesigns replied on at Permalink Reply
Ok I got it kind of working, realised I had one of the file paths wrong! Doh! So my cufon works fine now, but I am trying to use a link to pull in a twitter feed like this:

<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script>
<script src="http://twitter.com/statuses/user_timeline/arabellarodrigo.json?callback=twitterCallback2&count=1" type="text/javascript"></script>

and it doesn't work. It doesn't even give any errors. Can you reference external files in this way?
Steevb replied on at Permalink Reply
Steevb
Looks OK, maybe a typo, but I can't see one.

Try putting
<? Loader::element('header_required'); ?>


at bottom just before closing head tag.

Maybe weird request but I've had similar problem.
bridgetdesigns replied on at Permalink Reply
Ok, tried moving that bit of code and it worked! Dont quite understand why but thanks you! :)
Steevb replied on at Permalink Reply
Steevb
It has happened before.

Mark it as 'Best answer' if worked for you, it will help others.

Your calling 'header required' under your scripts. Saves a little conflict, I think?