The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
3 posters

    Problem with javascript which change text in index_body template

    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Problem with javascript which change text in index_body template

    Post by Van-Helsing June 17th 2015, 5:49 pm

    Hello,
    I am using the following javascript to change the text "Members connected during last 24 hours :" in my index_body template

    Code:

              <script type="text/javascript">
                  $(function(){
                    $("div.Today_Members").html($("div.Today_Members").html().replace("Μέλη που έχουν συνδεθεί κατά τις τελευταίες 96 ώρες","Μέλη που έχουν συνδεθεί στο φόρουμ κατά τη διάρκεια των τελευταίων 24 ώρων"));
                  });
                </script>

    can someone helo me to fix it?
    Previously it was working the problem appeared after the translation/correction also I was substitute the previous text in javascript with new one.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51499
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Problem with javascript which change text in index_body template

    Post by SLGray June 18th 2015, 4:57 am

    Have you tried adding it in the JavaScript Management instead of the template?



    Problem with javascript which change text in index_body template Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Problem with javascript which change text in index_body template

    Post by Van-Helsing June 18th 2015, 11:19 am

    Hello @SLGray,
    Yes but it hasn't got any effect. I dont know if the character : is javascript reserved character and making the problem in javascript code.

    Placement: In the homepage
    Javascript code:
    Code:

    $(function(){
    $("div.Today_Members").html($("div.Today_Members").html().replace("Μέλη που έχουν συνδεθεί κατά τις τελευταίες 96 ώρες", "Μέλη που έχουν συνδεθεί στο φόρουμ κατά τη διάρκεια των τελευταίων 24 ωρών"));
    });
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Problem with javascript which change text in index_body template

    Post by Van-Helsing June 22nd 2015, 5:21 pm

    Bump
    Zzbaivong
    Zzbaivong
    Forumember


    Posts : 101
    Reputation : 51
    Language : JavaScript ^^

    Solved Re: Problem with javascript which change text in index_body template

    Post by Zzbaivong June 22nd 2015, 6:42 pm

    There are two spaces here: κατά τις Razz

    Add this script at the end of index_body:
    Code:
    <script>
        $(".Today_Members").html(function() {
            return this.innerHTML.replace("Μέλη που έχουν συνδεθεί κατά  τις τελευταίες 96 ώρες", "Μέλη που έχουν συνδεθεί στο φόρουμ κατά τη διάρκεια των τελευταίων 24 ώρων")
        });
    </script>
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Problem with javascript which change text in index_body template

    Post by Van-Helsing June 22nd 2015, 10:32 pm

    Hello @Zzbaivong,
    Thank you very very much it is solved.
    ~1~
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51499
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Problem with javascript which change text in index_body template

    Post by SLGray June 23rd 2015, 4:05 am

    Topic solved and archived



    Problem with javascript which change text in index_body template Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.

      Current date/time is September 23rd 2024, 6:20 pm