Javascript Codes don't work

Go down

Solved Javascript Codes don't work

Post by SSYT on August 5th 2018, 11:15 am

Technical Details


Forum version : #ModernBB
Position : Administrator
Concerned browser(s) : Mozilla Firefox, Google Chrome, Internet Explorer, Opera, Safari, Other
Who the problem concerns : All members
When the problem appeared : Probleme is only javascript codes, don't work any codes, new don't work.
Forum link : https://www.depanatorul-tv.com

Description of problem

Hello, on my forum, i have 10 codes js, 3 don't execute, 6 month later work, today don't work, is a general problem? Or only my forum is problem?
And lot problem is localStorage codes dont work to save and read...


Last edited by SSYT on August 6th 2018, 10:07 am; edited 1 time in total
avatar
SSYT
Forumember

Male Posts : 77
Reputation : 15
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Solved Re: Javascript Codes don't work

Post by ChanelW on August 5th 2018, 11:32 am

Hi there @SSYT,

Could you please post the codes below, use the code tags please.

Are you sure you have JS codes activated? Could you also state the function of the code. Have the codes been working for 6 months and only just today they have stopped working?

Regards,
Chanel Smile
avatar
ChanelW
Forumember

Female Posts : 119
Reputation : 16
Language : English

Back to top Go down

Solved Re: Javascript Codes don't work

Post by SSYT on August 5th 2018, 12:00 pm

Hello, this code does not work on forum, not executed.
Code:
$(function() {
    var points = null;
    var config = {
        forums: ["/f68-arhiva-softuri-statii-cb","/f86-akai","/f87-blaupunkt","/f88-grundig","/f89-jvc","/f90-lg","/f91-orion","/f92-panasonic","/f93-philips","/f94-samsung","/f95-sharp","/f96-sony","/f97-telefunken","/f98-toshiba","/f99-main-board-vestel","/f100-diverse","/f103-vortex","/f104-daewoo","/f105-thomson","/f107-acer","/f108-apple","/f109-asus","/f110-alienware","/f111-dell","/f112-fujitsu","/f113-hp","/f114-lenovo","/f115-msi","/f116-samsung","/f117-sony","/f118-toshiba","/f119-acer","/f120-alienware","/f121-apple","/f122-asus","/f123-dell","/f124-fujitsu","/f125-hp","/f126-lenovo","/f127-msi","/f128-samsung","/f129-sony","/f130-toshiba","/f131-diverse","/f132-diverse","/f155-aeg","/f156-ariston","/f157-beko","/f158-bosch","/f159-candy","/f160-daewoo","/f161-indesit","/f162-samsung","/f163-whirlpool","/f164-diverse","/f173-akai","/f174-beker","/f175-blaupunkt","/f176-jvc","/f177-kemwood","/f178-pionner","/f179-sony","/f180-diverse","/f181-akai","/f182-blaupunkt","/f183-diverse","/f184-grundig","/f185-lg","/f186-jvc","/f187-onkyo","/f188-philips","/f189-pionner","/f190-sharp","/f191-sony","/f192-yamaha","/f211-denon","/f212-denon","/f213-denon"],
        pTopic: ["\/post\?f=68&mode=newtopic","\/post\?f=86&mode=newtopic","\/post\?f=87&mode=newtopic","\/post\?f=88&mode=newtopic","\/post\?f=89&mode=newtopic","\/post\?f=90&mode=newtopic","\/post\?f=91&mode=newtopic","\/post\?f=92&mode=newtopic","\/post\?f=93&mode=newtopic","\/post\?f=94&mode=newtopic","\/post\?f=95&mode=newtopic","\/post\?f=96&mode=newtopic","\/post\?f=97&mode=newtopic","\/post\?f=98&mode=newtopic","\/post\?f=99&mode=newtopic","\/post\?f=100&mode=newtopic","\/post\?f=103&mode=newtopic","\/post\?f=104&mode=newtopic","\/post\?f=105&mode=newtopic","\/post\?f=107&mode=newtopic","\/post\?f=108&mode=newtopic","\/post\?f=109&mode=newtopic","\/post\?f=110&mode=newtopic","\/post\?f=111&mode=newtopic","\/post\?f=112&mode=newtopic","\/post\?f=113&mode=newtopic","\/post\?f=114&mode=newtopic","\/post\?f=115&mode=newtopic","\/post\?f=116&mode=newtopic","\/post\?f=117&mode=newtopic","\/post\?f=118&mode=newtopic","\/post\?f=119&mode=newtopic","\/post\?f=120&mode=newtopic","\/post\?f=121&mode=newtopic","\/post\?f=122&mode=newtopic","\/post\?f=123&mode=newtopic","\/post\?f=124&mode=newtopic","\/post\?f=125&mode=newtopic","\/post\?f=126&mode=newtopic","\/post\?f=127&mode=newtopic","\/post\?f=128&mode=newtopic","\/post\?f=129&mode=newtopic","\/post\?f=130&mode=newtopic","\/post\?f=131&mode=newtopic","\/post\?f=132&mode=newtopic","\/post\?f=155&mode=newtopic","\/post\?f=156&mode=newtopic","\/post\?f=157&mode=newtopic","\/post\?f=158&mode=newtopic","\/post\?f=159&mode=newtopic","\/post\?f=160&mode=newtopic","\/post\?f=161&mode=newtopic","\/post\?f=162&mode=newtopic","\/post\?f=163&mode=newtopic","\/post\?f=164&mode=newtopic","\/post\?f=173&mode=newtopic","\/post\?f=174&mode=newtopic","\/post\?f=175&mode=newtopic","\/post\?f=176&mode=newtopic","\/post\?f=177&mode=newtopic","\/post\?f=178&mode=newtopic","\/post\?f=179&mode=newtopic","\/post\?f=180&mode=newtopic","\/post\?f=181&mode=newtopic","\/post\?f=182&mode=newtopic","\/post\?f=183&mode=newtopic","\/post\?f=184&mode=newtopic","\/post\?f=185&mode=newtopic","\/post\?f=186&mode=newtopic","\/post\?f=187&mode=newtopic","\/post\?f=188&mode=newtopic","\/post\?f=189&mode=newtopic","\/post\?f=190&mode=newtopic","\/post\?f=191&mode=newtopic","\/post\?f=192&mode=newtopic","\/post\?f=211&mode=newtopic","\/post\?f=212&mode=newtopic","\/post\?f=213&mode=newtopic"],
        p_upload: 4,
        p_download: 2,
        field: "profile_field_10_1"
    };

    var getUserPoints = function(userid, callback) {
        if(_userdata.session_logged_in == 0) return;
        $.ajax({
            type: "GET",
            url: "/u" + userid,
            async: false,
            success: callback,
            error: function(xhr, status, error) {
                var err = eval("(" + xhr.responseText + ")");
                alert(error.Message);
            }
        });
    };

    var setUserPoints = function(userid, pointsT, callback) {
        if(_userdata.session_logged_in == 0) return;
        $.post("/ajax_profile.forum?jsoncallback=jQuery1", {
            id: "1",
            user: userid,
            active: "1",
            content: '[["profile_field_10_1", "'+ parseInt(pointsT) +'"]]'
        }, "json").done(callback);
    };

    /* Check forum url on new topic */
    var topicNou = null;
    for(var y = 0; y < config.pTopic.length; y++) {
        if(window.location.href.search(new RegExp(config.pTopic[i], "ig")) !== -1) {
            topicNou = config.pTopic[i];
            break;
        }
    }
   
    if(topicNou !== null) {
        $('input[name="post"]').click(function() {
            my_setcookie('cbHTy_Yh', 1);
        });
    }

    var FLink = $('.sub-header-path:eq(0) a.nav:last').attr('href'), checkForum = null;
   
    for(var i = 0; i < config.forums.length; i++) {
        if(new RegExp(config.forums[i], 'gi').test(FLink)) {
            checkForum = config.forums[i];
        } else { return false; }
    }
   
    if(checkForum !== null) {
        $(".post #download-link a").click(function(e) {
            var $t = $(this);
            e.preventDefault();
            console.log('try');
            getUserPoints(_userdata.user_id, function(data) {
                points = $('#field_id1 dd', data).text();
                 console.log('execute points');
                if(points < 2) return;
                if(points >= 2) {
                    setUserPoints(_userdata.user_id, parseInt(points)-2, function(data) {
                        window.open(($t.attr('data-link') != null) ? $t.attr('data-link') : $t.attr('data-href'), '_blank');
                    });
                }
            });
        });
    }

    console.log("System has been executed sucessfully.");
});
avatar
SSYT
Forumember

Male Posts : 77
Reputation : 15
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Solved Re: Javascript Codes don't work

Post by ChanelW on August 5th 2018, 12:11 pm

JavaScript is activated, yes? What does this piece of code do so that I can take look at your forum incase it's an issue on your end.

Regards,
Chanel Smile
avatar
ChanelW
Forumember

Female Posts : 119
Reputation : 16
Language : English

Back to top Go down

Solved Re: Javascript Codes don't work

Post by SSYT on August 5th 2018, 12:17 pm

Yeah, javascript it's enabled, problem is code does not executed .
avatar
SSYT
Forumember

Male Posts : 77
Reputation : 15
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Solved Re: Javascript Codes don't work

Post by ChanelW on August 5th 2018, 12:35 pm

Where did you get the code from? It worked before, did you make any changes to the code recently?

Regards,
Chanel Smile
avatar
ChanelW
Forumember

Female Posts : 119
Reputation : 16
Language : English

Back to top Go down

Solved Re: Javascript Codes don't work

Post by SSYT on August 5th 2018, 12:47 pm

The code went up to 2 days ago, for 6 months I had no problems with JS codes, but now it only runs what she wants, I'm having problems with it.
avatar
SSYT
Forumember

Male Posts : 77
Reputation : 15
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Solved Re: Javascript Codes don't work

Post by ChanelW on August 5th 2018, 1:04 pm

Sounds like an issue with the code. I'm sure someone will be able to help you with the code. Unfortunately, I'm not very good at JavaScript Razz

Regards,
Chanel Smile
avatar
ChanelW
Forumember

Female Posts : 119
Reputation : 16
Language : English

Back to top Go down

Solved Re: Javascript Codes don't work

Post by brandon_g on August 5th 2018, 3:14 pm

Hello,

Did you add the only topic to the title @SSYT ? If so only staff mwmbers are allowed to make only topics.

As for your issue? Do any of your javascripts work? Or do they all not work?


Remember to mark your topic when a solution is found.
avatar
brandon_g
Manager
Manager

Male Posts : 7716
Reputation : 703
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Javascript Codes don't work

Post by Jadster on August 5th 2018, 6:48 pm

There is the possibility that some of your JS codes are conflicting with one another. I would recommend disabling all of them and enabling them one at a time to see if any of them start having issues when others are added to it. That was we can see what might be causing the issue.

Regards,
James
avatar
Jadster
Trial Reviewer
Trial Reviewer

Male Posts : 233
Reputation : 31
Language : English
Location : Omaha, NE

http://adminvortex.forumotion.com/

Back to top Go down

Solved Re: Javascript Codes don't work

Post by SarkZKalie on August 5th 2018, 7:05 pm

In case your site cache didn't clear, turn JS off and re-synchronize your site. Sometime my main script (thing works in all the page) may conflicted itself, so I had to delete and re-uploaded it. Sometime this trick works, sometime don't.


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 966
Reputation : 158
Language : English

http://rotavn.forumotion.com

Back to top Go down

Solved Re: Javascript Codes don't work

Post by Draxion on August 7th 2018, 2:13 am

@SSYT, I see you marked this topic as solved. Can I go ahead and assume it is so?


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 2233
Reputation : 283
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

Solved Re: Javascript Codes don't work

Post by APE on August 7th 2018, 11:37 pm

Problem solved & topic archived.
Please read our forum rules:  ESF General Rules



avatar
APE
Administrator
Administrator

Male Posts : 13383
Reputation : 1420
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum