Rss Feed
  1. Encoding Paremeters!!

    Tuesday, 11 December 2012

    base64_encode() and base64_decode() is used to encode the string that can be used in link parameter also.


  2. It works in .htaccess

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteRule ^.*$ http://www.domain.com%{REQUEST_URI} [R=301,L] # <-- Mind the 'L'!
    
    RewriteRule ^$ webroot/    [L]
    RewriteRule (.*) webroot/$1 [L]
    My work Did in website 


    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^dbuy\.com$ [NC]
    RewriteRule ^.*$ http://www.dbuy.com%{REQUEST_URI} [R=301,L] #

    RewriteRule ^$ app/webroot/    [L]
    RewriteRule (.*) app/webroot/$1 [L]

     
    </IfModule>


  3. <!DOCTYPE html>
    <html>
      <head>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
        <meta charset="utf-8">
        <title>Google Maps JavaScript API v3 Example: Reverse Geocoding</title>
       
        <link href="https://google-developers.appspot.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
        <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
        <script src="http://www.google.com/jsapi"></script>
        <script>
          var geocoder;
          var map;
          var infowindow = new google.maps.InfoWindow();
          var marker;
          geocoder = new google.maps.Geocoder();
          function initialize() {
           
            var latlng = new google.maps.LatLng(40.730885,-73.997383);
            var mapOptions = {
              zoom: 8,
              center: latlng,
              mapTypeId: 'roadmap'
            }
           // alert(mapOptions);
            map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
          }

          function codeLatLng() {
           // var input = document.getElementById('latlng').value;
          if(google.loader.ClientLocation)
          {
                    latitude = google.loader.ClientLocation.latitude;
                    longitude = google.loader.ClientLocation.longitude;
          }
           // var input = '13.083,80.3';
           var input = latitude + ',' + longitude;
            alert(input);
            var latlngStr = input.split(',', 2);
            var lat = parseFloat(latlngStr[0]);
            var lng = parseFloat(latlngStr[1]);
            var latlng = new google.maps.LatLng(lat, lng);
            geocoder.geocode({'latLng': latlng}, function(results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                if (results[1]) {
                 /* map.setZoom(11);
                  marker = new google.maps.Marker({
                      position: latlng,
                      map: map
                  }); */
                  //infowindow.setContent(results[1].formatted_address);
                  alert(results[1].formatted_address);
                  //infowindow.open(map, marker);
                } else {
                  alert('No results found');
                }
              } else {
                alert('Geocoder failed due to: ' + status);
              }
            });
          }
        </script>
      </head>
      <body onload="codeLatLng()">
        <div>
          <input id="latlng" type="textbox" value="40.714224,-73.961452">
        </div>
        <div>
          <input type="button" value="Reverse Geocode" onclick="codeLatLng()">
        </div>
        <div id="map_canvas" style="height: 90%; top:60px; border: 1px solid black;"></div>
      </body>
    </html>

  4. <html>
      <head>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
        <meta charset="utf-8">
        <title>Google Maps JavaScript API v3 Example: Reverse Geocoding</title>
        <link href="https://google-developers.appspot.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
        <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
        <script>
          var geocoder;
          var map;
          var infowindow = new google.maps.InfoWindow();
          var marker;
          function initialize() {
            geocoder = new google.maps.Geocoder();
            var latlng = new google.maps.LatLng(40.730885,-73.997383);
            var mapOptions = {
              zoom: 8,
              center: latlng,
              mapTypeId: 'roadmap'
            }
           // alert(mapOptions);
            map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
          }

          function codeLatLng() {
            var input = document.getElementById('latlng').value;
            var latlngStr = input.split(',', 2);
            var lat = parseFloat(latlngStr[0]);
            var lng = parseFloat(latlngStr[1]);
            var latlng = new google.maps.LatLng(lat, lng);
            geocoder.geocode({'latLng': latlng}, function(results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                if (results[1]) {
                  map.setZoom(11);
                  marker = new google.maps.Marker({
                      position: latlng,
                      map: map
                  });
                  infowindow.setContent(results[1].formatted_address);
                  alert(results[1].formatted_address);
                  infowindow.open(map, marker);
                } else {
                  alert('No results found');
                }
              } else {
                alert('Geocoder failed due to: ' + status);
              }
            });
          }
        </script>
      </head>
      <body onload="initialize()">
        <div>
          <input id="latlng" type="textbox" value="40.714224,-73.961452">
        </div>
        <div>
          <input type="button" value="Reverse Geocode" onclick="codeLatLng()">
        </div>
        <div id="map_canvas" style="height: 90%; top:60px; border: 1px solid black;"></div>
      </body>
    </html>

    Refer:

    https://developers.google.com/maps/documentation/javascript/geocoding#ReverseGeocoding



  5. <html>
    <head>
    <title>google location test</title>
    <script src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
                var city = latitude = longitude = country = region = "dunno";
                if (google.loader.ClientLocation) {
                    latitude = google.loader.ClientLocation.latitude;
                    longitude = google.loader.ClientLocation.longitude;
                    city = google.loader.ClientLocation.address.city;
                    region = google.loader.ClientLocation.address.region;
                    country = google.loader.ClientLocation.address.country;
                }
    </script>
    </head>
    <body>
    <h1>You are in (roughly): <script type="text/javascript">
    document.write(city);
    </script></h1>
    Other parts of the location include:

    <script type="text/javascript">
                document.write("Latitude: "+latitude+"<br/>");
                document.write("Longitude: "+longitude+"<br/>");
                document.write("City: "+city+"<br/>");
                document.write("Region: "+region+"<br/>");
                document.write("Country: "+country+"<br/>");
    </script>
    </body>
    </html>





    google location test



    Refer: http://csausdev.wordpress.com/2009/10/12/trying-out-google-client-location-service/

    In this client city info will not be there so use reverse geocoding to get client city info using latitude and longitude value.



  6. Jquery redirecting to privious page!!

    Monday, 3 December 2012

    Jquery redirecting to privious page!!

     history.go(-1);

  7. Jquey to execute on page load



    $(document).ready(function() {
      // Handler for .ready() called.
    });


    Jquey to execute after page load




    $(function() {
     // Handler for .ready() called.
    });