The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Problem with javascript which change text in index_body template

View previous topic View next topic Go down

Solved Problem with javascript which change text in index_body template

Post by Van-Helsing on 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
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

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

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


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


SLGray
Administrator
Administrator

Male Posts : 36692
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

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

Post by Van-Helsing on 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
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

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

Bump

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

Post by Zzbaivong on 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
Forumember

Posts : 95
Reputation : 46
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 on June 22nd 2015, 10:32 pm

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

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

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

Topic solved and archived


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


SLGray
Administrator
Administrator

Male Posts : 36692
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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