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 Wed 17 Jun 2015 - 17:49

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 Thu 18 Jun 2015 - 4:57

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 : 51555
Reputation : 3524
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 Thu 18 Jun 2015 - 11:19

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 Mon 22 Jun 2015 - 17:21

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 Mon 22 Jun 2015 - 18:42

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 Mon 22 Jun 2015 - 22:32

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 Tue 23 Jun 2015 - 4:05

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 : 51555
Reputation : 3524
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