Find Jobs
Hire Freelancers

Simple add Geolocation through GET Function

$10-30 USD

Completed
Posted almost 9 years ago

$10-30 USD

Paid on delivery
I have everything working but because Im new at this I just need a few lines of code added to make it work. Basically i just need to add a $Get function to below line that will send the latitude, longitude, street,city,state,country to a page that will post to my database... As I mention the geolocation aspect already works i just need the post feature. I included the zip file it does not have to be written from scratch so i posted it as a small project //use array to determine how it goes into DOM, I think you could use Data Attributes: [login to view URL] var selector = []; [login to view URL] = function() { //push in one or multiple IDs depending if its one address field or multiple [login to view URL]("address-line-1","city","state","zip"); //go get the location getLocation(); }; function putInDom(address){ if([login to view URL] == 1){ //one field for address var field = [login to view URL](selector[0]); [login to view URL] = address; } else { //multiple fields var street = [login to view URL](selector[0]); var city = [login to view URL](selector[1]); var state = [login to view URL](selector[2]); var zip = [login to view URL](selector[3]); var a = [login to view URL](","); [login to view URL] = a[0].trim(); [login to view URL] = a[1].trim(); [login to view URL] = a[2].trim().split(" ")[0]; [login to view URL] = a[2].trim().split(" ")[1]; } // $.get("[login to view URL]", { url:"EDMStaff", town:"Ducktown" }); //clear array selector = []; } function getLocation(){ if ([login to view URL]){ //remember this is async behavior, the browser does not have access to your locations right away but it does not want to stop executing code [login to view URL](getAddress); } else{ info.innerHTML="Geolocation is not supported by this browser."; } } function getAddress(position){ putInDom(address); getLocation(); var lat = [login to view URL]; var lon = [login to view URL]; //Google does not allow Cross Domain Access so let's use a Proxy: [login to view URL] var url = '[login to view URL]'+city+','+lon+'&sensor=true'; //make the Ajax request var xhr = new XMLHttpRequest(); [login to view URL]("GET", url); [login to view URL] = function() { //if we make a successful request and it returns an address if(this.status==200 && [login to view URL]([login to view URL]).[login to view URL] > 0){ //get formatted address from [login to view URL] var result = [login to view URL]([login to view URL]).[login to view URL][0].formatted_address; putInDom(result); } else { //send some general error [login to view URL] = "Could not find your location."; } } [login to view URL](); }
Project ID: 7811218

About the project

7 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
A proposal has not yet been provided
$25 USD in 1 day
5.0 (9 reviews)
3.7
3.7
7 freelancers are bidding on average $25 USD for this job
User Avatar
Hello man, I'm already coded this function, so if you want get it ASAP just award this project for me. Thanks you
$30 USD in 1 day
5.0 (4 reviews)
2.8
2.8
User Avatar
I have checked the requirement you have mentioned in the job post. First of I am from India, So may be this proposal will be ignored. You can first make a chat with us and you can decide later. Please note that, we have worked on the popular frameworks such as Laravel, Codginiter, CakePHP etc. We have worked on the latest version in these frameworks. So we have experienced in REST API, Bootstrap, Linux, MySql, Jquery etc. So please have a quick chat with us and you can decide later. You can also check our portfolios mentioned in the profile. Let me introduce our profile, please note that, if your are checking our rating, currently we haven't any rating. Because our work from other networks We are a group of Web & Mobile developers having expertise in Open Source technologies such as PHP, Wordpress, Drupal, Mobile Apps & Game Development, etc. As per the requirement mentioned, I am interested to work with you. Our core competency lies in complete end-end management of a new website development project, and we are seeking opportunities to build websites from the ground up for you or your business. We have experience in the following areas: Codeigniter, Yii, Laravel, Magento, Opencart, ZenCart, NodeJs, MySql, MongoDb, jQuery, Facebook API, Twitter API, Google API, Paypal, CyberSource, Braintree, CCAvenue I think the best way to demonstrate our expertise is to show you our work with reference to your requirement. We would like to hear your requirement so that we can anal
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hello, I am working in well know IT mnc company and i am working in java script so i am very helpful to you to do your task. It just 3 to 4 hrs task may be it will take less time also.
$18 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
I am a 38 years analist/programmer with 18 years of experience. Have worked on enterprises projects for financial companies and for general purposes for web. I know technologies like Python, ASP.NET, PHP and more. Relational and non relational databases. Microsoft MCP certified. I have worked on UX Systems for Hewllet Packard too.
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi, I have 10 years of experience using ASP, javascript and SQL Server. Contact me, so I can create the function to send the values to your database. Regards, Luciano.
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
port orange, United States
5.0
25
Payment method verified
Member since Jun 5, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.