Reduce window size using jQuery

$(window).load(function(){
    $(window).resize(function(){
      var height = $(this).height() - $("#header").height() + $("#footer").height() - 35
      $('#content').height(height);
      $('#content2').css('marginTop', height); // <-- set here
    });
    $(window).resize();
  });
Advertisements

Find Latitude, Longitude based on address

function getCoordinates($address){

$address = str_replace(” “, “+”, $address); // replace all the white space with “+” sign to match with google search pattern

$url = “http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address“;

$response = file_get_contents($url);

$json = json_decode($response,TRUE); //generate array object from the response from the web

return ($json[‘results’][0][‘geometry’][‘location’][‘lat’].”,”.$json[‘results’][0][‘geometry’][‘location’][‘lng’]);
}

Ajax Code with jQuery

jQuery.ajax({
type: “POST”,
url:”url”,
data:{
“survey_form”: ques1,
“driving_boss”: ques2,
“quick_look”: ques3,
},
}).success(function(result){
//jQuery(‘.send_log_details’).show();
alert(“success”);
})
jQuery.ajax({
type: “POST”,
url: add_user_url,
data:{
“user_login”: user_login[0],
“email”: email,
“role”: “subscriber”,
“createuser”: “Add New User”,
},
}).success(function(result){
alert(“success”);
});