Show popunder for specific countries - Javascript included

Discussion in 'PHP' started by cynia, Mar 24, 2011.

  1. #1
    Hello

    I got a javascript code i want to load each time the user is NOT chinese


    i got a predefine javascript code to load it

    This is the code for example

    What should i put to make it load only when the visitor is not chinese? or at least 90% of the times not chinese?



    <JAVASCRIPT>


    Please let me know


    regards
     
    cynia, Mar 24, 2011 IP
  2. bledileka

    bledileka Peon

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i believe its not possible to do it simply by javascript, you have to use some other things such php for remote IP checking and then generate the javascript code based on it.
    You can use maxmind free geolocator to get user country and then do what ever you need.
    
    $country = "CN";// CN will be generated from the geolocator script
    if ($country!="CN") { ?>
    <script type="text/javascript">....</script>
    <? }
    
    Code (markup):
     
    bledileka, Mar 24, 2011 IP
    cynia likes this.
  3. cynia

    cynia Well-Known Member

    Messages:
    890
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    140
    Digital Goods:
    1
    #3
    != symbol means not equal to?
     
    cynia, Mar 24, 2011 IP
  4. bledileka

    bledileka Peon

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes, if not equal then call the javascript function...
     
    bledileka, Mar 24, 2011 IP
  5. cynia

    cynia Well-Known Member

    Messages:
    890
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    140
    Digital Goods:
    1
    #5
    Yeah thats great . I figured it out . it works like charm
    !

    thanks a lot
     
    cynia, Mar 26, 2011 IP