-
Click on map and get Longitude -Latitude.
How To Get Longitude – Latitude When Clicked On Map? <div id=”MyMap” style=”width:100%;height:500px;”></div> <script> function myMap() { var mapCanvas = document.getElementById(“MyMap”); var myCenter=new google.maps.LatLng(51.508742,-0.120850); var mapOptions = {center: myCenter, zoom: 5}; var map = new google.maps.Map(mapCanvas, mapOptions); google.maps.event.addListener(map,’click’, function(event) { LocationMarker(map, event.latLng); }); } function LocationMarker(map, location) { var marker = new google.maps.Marker({ position: location,…
-
Convert PHP Array into JavaScript Array.
We can use PHP array in javascript. For this we have to convert PHP array ,whether the array type is a single or multidimensional or indexed or associative array,into JSON format Using php function json_encode().It’s mostly used when we have create API in PHP to transfer data form one server to other server because data…
-
Ajax login WordPress.
Sometime we need to login in site without reloading the page.so we simply use ajax for it. first we add login form in html than register a ajax path and than use jquery execute process. 1. Form Html using wp_footer hook # add ajax login form to page add_action( ‘wp_footer’, ‘CustomLoginHtml’ ); function CustomLoginHtml() {…
-
Jquery Form Validator.
JQuery Form Validator is a featured jQuery plugin that makes it easy to validate user input while keeping your HTML clean from javascript code. This jQuery plugin makes clientside form validation easy and also offer’s plenty of customization options.The plugin comes with a useful set of validation methods, including URL and email validation etc. This…