Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8370215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:51:43+00:00 2026-06-09T13:51:43+00:00

I have following Code for Get IP address i want to store that data.ip

  • 0

I have following Code for Get IP address i want to store that data.ip with global scope that i can access anywhere in file.

 <script>
ip = null;
$.getJSON("http://jsonip.appspot.com?callback=?",
  function(data){
       ip = data.ip;
alert(ip); //return ip address correctly
  });
alert(ip); //undefined or null
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:51:44+00:00Added an answer on June 9, 2026 at 1:51 pm

    This will set the IP Address to a hidden input field.

    <script>
    ip = null;
    $.getJSON("http://jsonip.appspot.com?callback=?", function(data) {
        ip = data.ip;
        $("#getip").val(ip)
        alert(ip); //return ip address correctly
    });
    alert(ip); //undefined or null
    </script>
    
    <input id="getip" type="hidden" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code to get details of a contact. data: is the
I have following code that does not work: I never get to goToFoodDetail .
I have written a following code to get just the file name without extension
I have the following code: // GET: /PlayRoundHole/Create public ActionResult Create(int id) { DB
I have the following code to get the object type of a collection: Dim
i have the following code def get(self): date = datetime.date.today() loc_query = Location.all() last_cursor
I have a following simple code: def get(): return [lambda: i for i in
I have used the following code to get the document root. $path = get_file_dir();
I have the following code: $.ajax({ type: 'GET', url: 'index.php?route=checkout/onepagecheckout/getpaypaldata', dataType: 'json', success: function(json)
Having a major brain freeze, I have the following chunk of code: // Get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.