Advertisement:

Author Topic: [Tips] How to hide last 4 digit phone number  (Read 7313 times)

byteGator

  • Osclass Hero
  • Sr. Member
  • *
  • Posts: 346
  • Simple Mind is a Beautiful Mind
[Tips] How to hide last 4 digit phone number
« on: October 14, 2013, 06:13:52 am »
Because a lot of people ask me how to make phone and mail hide like I have in http://iklangratis.net, I will explain a simple method how to hide last 4 digit phone number using javascript.

1. Display number after user click
Code: [Select]
<div id="phonenumber" data-last="1234">949<span>XXXX</span></div>
Code: [Select]
$('#phonenumber').click(function() {
    $(this).find('span').text( $(this).data('last') );
});

2. To make it toggle on click.
Code: [Select]
$('#phonenumber').toggle(function() {
    $(this).find('span').text( $(this).data('last') );
},function() {
    $(this).find('span').text( 'XXXX' );
});

3. To show phonenumber if user have no javascript
Code: [Select]
<div id="phonenumber" data-last="1234">949<span>1234</span></div>
Code: [Select]
$('#phonenumber').toggle(function() {
    $(this).find('span').text( 'XXXX' );
},function() {
    $(this).find('span').text( $(this).data('last') );
})
  .click();

Note: If you want to make your data unreadable by robot or crawler, you have to use image to display phone number.

« Last Edit: January 03, 2014, 10:13:31 pm by byteGator »

creat15

  • Full Member
  • ***
  • Posts: 218
Re: [Tips] How to hide last 4 digit phone number
« Reply #1 on: October 15, 2013, 02:44:06 pm »
hi masgan :)

I've also been asked about the hide phone number on a different thread

this is link thread [solved] how to hide phone number user?

and the same script with the tutorial above

plesk

  • Full Member
  • ***
  • Posts: 188
Re: [Tips] How to hide last 4 digit phone number
« Reply #2 on: October 24, 2013, 09:03:41 pm »
Hello, or should I put this code and especially that file must be edited please thank you

byteGator

  • Osclass Hero
  • Sr. Member
  • *
  • Posts: 346
  • Simple Mind is a Beautiful Mind
Re: [Tips] How to hide last 4 digit phone number
« Reply #3 on: October 28, 2013, 03:17:57 am »
Hello, or should I put this code and especially that file must be edited please thank you
It is a javascript method. you can implement it anywhere you like.

plesk

  • Full Member
  • ***
  • Posts: 188
Re: [Tips] How to hide last 4 digit phone number
« Reply #4 on: October 28, 2013, 11:38:33 pm »
good evening
in where you can place this code? and principally made the file to edit themes I thank you bender :)

data99

  • Full Member
  • ***
  • Posts: 180
Re: [Tips] How to hide last 4 digit phone number
« Reply #5 on: March 06, 2014, 03:57:49 pm »
Can you tell me the location of file that need to be edit

data99

  • Full Member
  • ***
  • Posts: 180
Re: [Tips] How to hide last 4 digit phone number
« Reply #6 on: March 10, 2014, 03:21:49 pm »
I still cant do it Please help  :'( :'( :'( :'(

tempestblaze

  • Newbie
  • *
  • Posts: 4
Re: [Tips] How to hide last 4 digit phone number
« Reply #7 on: September 02, 2014, 02:07:24 pm »
How do you use image to display phone number?

burims

  • Newbie
  • *
  • Posts: 1
Re: [Tips] How to hide last 4 digit phone number
« Reply #8 on: September 12, 2014, 04:22:35 pm »
I have install this scritpt and i create one website for it but i don't know this software how is work may you can help me on this :(
however thanks you bro