[eluser]gullah[/eluser]
EDIT: The code tags seem to remove the script links but they are in there, probably where it says [removed]
This is the template library I'm using.
Code:
class Template {
function load($template = '', $view = '' , $vars = array(), $return = FALSE)
{
$this->CI =& get_instance();
$vars['template_contents'] = $view;
if ($template == "mainTemplate")
return $this->loadMainTemplate($view, $vars, $return);
else
return $this->CI->load->view($template, $vars, $return);
}
function loadMainTemplate($view, $vars = array(), $return = FALSE)
{
if( ! isset($vars['head_title']))
$vars['head_title'] = "Default Title";
return $this->CI->load->view("mainTemplate", $vars, $return);
}
}
This is my main template file without extra junk
if I take this js file out I get the following error
Quote:jQuery is not defined
flash.js()()flash.js (line 1)
[Break on this error] jQuery.noConflict();
which is in the flash.js file
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?=$title?></title>
<?=link_tag('style/reset.css')?>
<?=link_tag('style/style.css')?>
<link href="<?=base_url().$this->config->item('FAL_assets_front').'/'.$this->config->item('FAL_css');?>/fal_style.css" rel="stylesheet" type="text/css" />
[removed][removed]
[removed]config->item('FAL_assets_shared').'/'.$this->config->item('FAL_js');?>/flash.js" type="text/javascript">[removed]
</head>
<body>
<!--STAR FLASH MESSAGE-->
<?php
$flash=$this->db_session->flashdata('flashMessage');
if (isset($flash) AND $flash!='')
{?>
<div id="flashMessage" style="display:none;">
<?=$flash?>
</div>
<?php }?>
<!--END FLASH-->
This is my view without the junk
if I take this one out I get this error
Quote:jQuery is not defined
[Break on this error] jQuery.noConflict();
flash.js (line 1)
jQuery is not defined
[Break on this error] })(jQuery);
jquery.form.js (line 601)
$ is not defined
[Break on this error] $(document).ready(function(){
(line 103)
Code:
[removed][removed]
[removed][removed]
[removed]
$(document).ready(function(){
<?php foreach(array_unique($javascript) as $id) : ?>
$('#show_<?=$id?>').click(function() {
if($('#show_<?=$id?>').attr('value')=="Show all comments for this meaning") {
$('#show_<?=$id?>').attr('value', 'Hide Replies');
} else {
$('#show_<?=$id?>').attr('value', 'Show all comments for this meaning');
}
$('.<?=$id?>_replies').toggle('slideDown');
});
<?php endforeach; ?>
<?php foreach(array_unique($meaningsIds) as $meaningId) : ?>
$('.meaning_<?=$meaningId?>').click(function() {
$('.meaning<?=$meaningId?>').fadeOut('slow', function(){
$('.meaningEdit_<?=$meaningId?>').fadeIn('slow');
});
});
$('.form_<?=$meaningId?>').ajaxForm(function(data) {
if(data==0) {
$('.meaningEdit_<?=$meaningId?>').fadeOut('slow', function(){
$('.meaning<?=$meaningId?>').fadeIn('slow', function() {
$('.meaning_content_body_<?=$meaningId?>').append('<b>Success! You must refresh the page for the changes to take effect</b>');
});
});
} else if(data==1) {
$('.meaningEdit_<?=$meaningId?>').fadeOut('slow', function(){
$('.meaning<?=$meaningId?>').fadeIn('slow', function() {
$('.meaning_content_body_<?=$meaningId?>').append('<b>The edit failed please try again.</b>');
});
});
}
});
<?php endforeach; ?>
});
[removed]
It seems that they both need their respective jquery load or they aren't given access to jquery at all.