WebsiteBaker Support (2.8.x) > jQuery

Problem with javascripts

(1/2) > >>

rumen:
Most of the javasripts doesn't start .... I have CaptionSlider that works properly. But I have a form which is sliding panel and doesn't work at all. I installed jqCollapse and when I put Title and Content - the title appears on the screen but when you click nothing happens.

Here is the code of the header of the template:


--- Code: ---<?php

if (!defined('WB_PATH')) die(header('Location: ../../index.php'));

?>
<!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" xml:lang="EN" lang="EN" dir="ltr">
<head>
<title><?php page_title(); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
if(defined('DEFAULT_CHARSET')) { echo DEFAULT_CHARSET; } else 
{ echo 'utf-8'; }?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="description" content="<?php page_description(); ?>" />
<meta name="keywords" content="<?php page_keywords(); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR; ?>/styles/layout.css" media="screen" />
<!-- <link rel="stylesheet" href="styles/layout.css" type="text/css" /> -->
<script type="text/javascript" src="jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="jquery.slidepanel.setup.js"></script>
<script type="text/javascript" src="jquery.cycle.min.js"></script>
<script type="text/javascript" src="jquery.cycle.setup.js"></script>
<script src="<?php echo TEMPLATE_DIR; ?>/jquery-1.7.2.min.js" type="text/javascript"></script>

<?php
// this allows to include the optional module files (frontend.css, frontend.js) into the head section
if(function_exists('register_frontend_modfiles')) {
  register_frontend_modfiles('css');
  register_frontend_modfiles('jquery');
  register_frontend_modfiles('js');
} ?>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
 
</head>
--- End code ---

What can be wrong? Any Idea?

nibz:
Hi rumen,

Could you post or PM a link to the website.
Because that would speed up troubleshooting!

Kind regards,

Robin

nibz:

--- Quote from: rumen on September 27, 2014, 11:14:10 PM ---
--- Code: ---<script type="text/javascript" src="jquery-1.4.1.min.js"></script>

<?php
// this allows to include the optional module files (frontend.css, frontend.js) into the head section
if(function_exists('register_frontend_modfiles')) {
  register_frontend_modfiles('jquery');
} ?>


--- End code ---

--- End quote ---

It looks to me you are loading jQuery twice.

rumen:
The site is on my localhost (xampp) so I can't give you a link. What I can do is to send you the template if this can help.

When I skip:


--- Code: ---<!-- <script type="text/javascript" src="jquery-1.4.1.min.js"></script> -->

--- End code ---

Nothing happens....

By the way I try to install MP3 player which works properly on other site ... nothing again it is dewplayer (very good one)

Gast:

--- Quote from: nibz on September 27, 2014, 11:43:56 PM ---It looks to me you are loading jQuery twice.

--- End quote ---

only twice? i count four

1.  <script type="text/javascript" src="jquery-1.4.1.min.js"></script>
2.  register_frontend_m odfiles('jquery');
3.  <script src="<?php echo TEMPLATE_DIR; ?>/jquery-1.7.2.min.js" type="text/javascript"></script>
4.  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>

use only one jquery (if you dont use libraryadmin)
change the loading order

1. your css (templates & additional css if needed)
2. the block with register_frontend_m odfiles
3. additional javascripts for modules (if not loading by modules)


--- Code: ---<?php

if (!defined('WB_PATH')) die(header('Location: ../../index.php'));

?>
<!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" xml:lang="EN" lang="EN" dir="ltr">
<head>
<title><?php page_title(); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
if(defined('DEFAULT_CHARSET')) { echo DEFAULT_CHARSET; } else 
{ echo 'utf-8'; }?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="description" content="<?php page_description(); ?>" />
<meta name="keywords" content="<?php page_keywords(); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR; ?>/styles/layout.css" media="screen" />

<?php
// this allows to include the optional module files (frontend.css, frontend.js) into the head section
if(function_exists('register_frontend_modfiles')) {
  register_frontend_modfiles('css');
  register_frontend_modfiles('jquery');
  register_frontend_modfiles('js');
} ?>
<script type="text/javascript" src="jquery.slidepanel.setup.js"></script>
<script type="text/javascript" src="jquery.cycle.min.js"></script>
<script type="text/javascript" src="jquery.cycle.setup.js"></script>
 
</head>
--- End code ---

i use jQuery v1.11.0 and jQuery Migrate v1.2.1

Only if you use jquery 1.11.0
rename the jquery-min.js in the include/jquery-folder  to the used version in this file ( like jquery-min_183.js) and put the jQuery v1.11.0 this folder and jQuery Migrate v1.2.1 into your template folder
rename the jQuery v1.11.0.js to jquery-min.js
and call the migrate.js in a extra call like

--- Code: ---<script src="<?php echo TEMPLATE_DIR; ?>/js/jQuery Migrate v1.2.1.js" type="text/javascript"></script>
--- End code ---
behind the block with register_frontend_m odfiles and before you call other js-file like jquery.slidepanel.s etup.js

if jQuery v1.11.0 doesnt work for your modules, you have only to rename the jquery-files in the include/jquery-Folder

Navigation

[0] Message Index

[#] Next page

Go to full version