Uncategorized

New foursquare Badge Alert: Eater 38

The Badge The Name
Status
How to Earn It
Badge Message
Sponsor
Event
Eater 38 foursquare badge brought to you by thekruser Eater 38

 

Active

Follow Eater on foursquare and check in to 4 venues from their foursquare page.
Game-changer. You’ve now been to # restaurants on Eater.com’s ever-evolving list of our 38 most favorite restaurants in this here city. Sir or ma’am, may we simply say, Bravo.

Eater

 

sandtrapafteredit_419

thekruser’s Sand Trap

1

An awesome summer drink. Try it!!

Shake the following ingredients:

  • 2 parts Arnold Palmer
  • 1 part vodka

In case you didn’t know, an Arnold Palmer is equal parts Iced Tea and Lemonade. So, the drink would then be (shaken):

  • 1 part iced tea (sweet or unsweetened, your choice)
  • 1 part lemonade
  • 1 vodka

Enjoy!

HELP: Need to Pass JavaScript Vars in POST

13

The problem is, I am a bit of a moron.

I have a need to include geolocation info in the POST data of a form. I have put links to download the files as well as snippets of the code. I would appreciate any insight you could give. I am not a JavaScript guy…I am more of a html/php/sql guy.

Thanks in advance for your time and help!!

thekruser.com/downloads/code.zip

geo.js snippet

function getLocation(params)
{
try
{
clearOutput();

//Save timestamp to measure how long it takes to get geolocation info
startTime = new Date();

//First test to see that the browser supports the Geolocation API
if (navigator.geolocation !== null)
{
//Configure optional parameters:
var options;
if (params)
{
displayOutput("Retrieving location information using custom parameters: " + params + " ..." );
options = eval("options = " + params + ";");
}
else
{
options = { enableHighAccuracy : true, timeout : 60000, maximumAge : 0 };
displayOutput("Please stand by. Retrieving location information.");
}
navigator.geolocation.getCurrentPosition(LocationSuccess, geolocationError, options);
}
else
{
errorMessage("HTML5 geolocation is not supported.");
}
}
catch (e)
{
errorMessage("exception (getPosition): " + e);
}
}

function LocationSuccess(position)
{
try
{
displayOutput("<h3>You only had to wait " + (getDuration(startTime) / 1000) + " seconds! Stop complaining.<\/h3>");

var coordinates = position.coords;
var gpsTime = position.timestamp;

displayLocationInfo(gpsTime, coordinates);
}
catch (e)
{
errorMessage("exception (geolocationSuccess): " + e);
}
}

function displayLocationInfo(time, coordinates)
{
try
{
var lat = coordinates.latitude;
var lon = coordinates.longitude;
var acc = coordinates.accuracy;

var locationInfo = "<h3>Your current location is:</h3>";
locationInfo += "Latitude: " + coordinates.latitude + "<br/>";
locationInfo += "Longitude: " + coordinates.longitude + "<br/>";
locationInfo += "Accuracy: " + coordinates.accuracy + "<br/>";

displayOutput("<p>" + locationInfo + "</p>");
}
catch (e)
{
errorMessage("exception (displayLocationInfo): " + e);
}
}

Form.php snippet

<html>
<head>
<script type="text/javascript" src="/js/html5_init.js"></script>
<script type="text/javascript" src="/js/ba_geo.js"></script>
<script type="text/JavaScript">
var startTime;

/**
* The following are helper methods used for displaying text on the screen:
*/
function clearOutput()
{
var ele = document.getElementById("geolocationInfo");
if (ele)
{
ele.innerHTML = "";
}
}
function displayOutput(output)
{
var ele = document.getElementById("geolocationInfo");
if (ele)
{
ele.innerHTML += "<div>" + output + "</div>";
}
}
function errorMessage(msg)
{
displayOutput("Error:" + msg + "");
}

function submitForm()
{
document.CreateAccess.submit();
}

function resetForm()
{
document.CreateAccess.reset();
}

</script>

</head>

<form name="CreateAccess" action="/ba/php/create-access.php" method="post">

/**************** arbitrary form information ***********************/

</form>

<p><button id="submit" onclick="submitForm()">Submit</button> &nbsp;&nbsp; <button id="reset" onclick="resetForm()">Reset</button></p>

<button id="btnGPSHigh" onClick="getLocation()">Get Coordinates (high accuracy)</button>
<div id="geolocationInfo"></div>

Go to Top