× Support for Joomla 2.5 templates is discontinued. This forum category is read-only.

template_scripts.js

More
6 years 5 months ago #3204 by bking1300
bking1300 created the topic: template_scripts.js
Hello

Mode débgu I encounter a script error

template_scripts.js: 119TypeError: 'null' is not an object (Evaluating $ ('style_icon-1'). addEvent ')

An idea?

Ici

" window.addEvent("domready",function(){
if($('jm-stylearea')){
$('style_icon-1').addEvent('click', function(e) {
••••template_scripts.js:119TypeError: 'null' is not an object (evaluating '$('style_icon-1').addEvent')•••••
e = new Event(e).stop();

if (style_1) style_1.dispose();
var file = $template_path+'/css/style1.css';
new Asset.css(file, {id: 'style1'});
style_1 = $('style1');
new Cookie.write('jm_bio','1',{duration: 200,path: "/"});

}); "
Attachments:

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #3307 by marcin
marcin replied the topic: Re: template_scripts.js
Hello,

It seems that you might have removed the code responsible for the style switcher feature.
Please restore the default code (<div id="jm-stylearea"> and its content) and check if the issue still occurs.

Regards,
Marcin

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #3308 by izabela
izabela replied the topic: Re: template_scripts.js
You can disable style switcher at the template manager, do not delete the code in index.php

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #3310 by bking1300
bking1300 replied the topic: Re: template_scripts.js
Hello and thank you

But I disabled the style switcher ...

But the error is

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #3319 by bking1300
bking1300 replied the topic: Re: template_scripts.js
Hello,

I rebooted a template nine :)

But the problem is the same, and the script is in (see picture)
Attachments:

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #3320 by bking1300
bking1300 replied the topic: Re: template_scripts.js
I removed this code and I have no error ...

Should not this is serious ... ?



window.addEvent("domready",function(){
if($('jm-stylearea')){
$('style_icon-1').addEvent('click', function(e) {
e = new Event(e).stop();

if (style_1) style_1.dispose();
var file = $template_path+'/css/style1.css';
new Asset.css(file, {id: 'style1'});
style_1 = $('style1');
new Cookie.write('jm_bio','1',{duration: 200,path: "/"});

});

$('style_icon-2').addEvent('click', function(e) {
e = new Event(e).stop();

if (style_2) style_2.dispose();
var file = $template_path+'/css/style2.css';
new Asset.css(file, {id: 'style2'});
style_2 = $('style2');
new Cookie.write('jm_bio','2',{duration: 200,path: "/"});

});

$('style_icon-3').addEvent('click', function(e) {
e = new Event(e).stop();

if (style_3) style_3.dispose();
var file = $template_path+'/css/style3.css';
new Asset.css(file, {id: 'style3'});
style_3 = $('style3');
new Cookie.write('jm_bio','3',{duration: 200,path: "/"});
});

$('style_icon-4').addEvent('click', function(e) {
e = new Event(e).stop();

if (style_4) style_4.dispose();
var file = $template_path+'/css/style4.css';
new Asset.css(file, {id: 'style4'});
style_4 = $('style4');
new Cookie.write('jm_bio','4',{duration: 200,path: "/"});
});

$('style_icon-5').addEvent('click', function(e) {
e = new Event(e).stop();

if (style_5) style_5.dispose();
var file = $template_path+'/css/style5.css';
new Asset.css(file, {id: 'style5'});
style_5 = $('style5');
new Cookie.write('jm_bio','5',{duration: 200,path: "/"});
});

}


});

Please Log in or Create an account to join the conversation.

Time to create page: 0.285 seconds

INDICO S.C.

ul. Wałowa 10/3, 84-200 Wejherowo, registered in Centralna Ewidencja i Informacja o Działalnosci Gospodarczej
NIP/VATID: PL5882424318

Copyright © 2009-2019 Joomla-Monster.com All rights reserved.

Joomla-Monster.com and this site is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.