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.

Problem with javascript which change text in index_body template

3 posters

Go down

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.
Van-Helsing
Van-Helsing
Hyperactive

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

http://itexperts.forumgreek.com/

Back to top Go down

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.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51569
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

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

http://itexperts.forumgreek.com/

Back to top Go down

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

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

Bump
Van-Helsing
Van-Helsing
Hyperactive

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

http://itexperts.forumgreek.com/

Back to top Go down

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>
Zzbaivong
Zzbaivong
Forumember

Posts : 101
Reputation : 51
Language : JavaScript ^^

http://devs.forumvi.com

Back to top Go down

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~
Van-Helsing
Van-Helsing
Hyperactive

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

http://itexperts.forumgreek.com/

Back to top Go down

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.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51569
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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