Friday, 22 August 2014

Add-on VS Plugin

What is Difference Between Add-on –firebug  and Plugin –flash, java

Add-on and plug-ins are two widely used terms in browsers. Both the terms boost the performance of browser. In Firefox you install add-ons to add extra features as well as add plug-ins to add some missing functionalities. Despite of their matching properties, both the terms are not same.
Plug-in is a complete program and add-on is not a program. For example Flash is an plug-in which is a complete program. Flash player is required to play a video which is made by a company known as Adobe. Also Java is a plug-in made by Sun Microsystem which is used to run programs based on Java. Plug-in is not bounded for browsers only. Flash can be installed in computers to play flash files. Similarly Java can be installed to run Java files.
On the other hand add-on is not a complete program. It is used to add a particular functionality to a browser. If you suppose to install add-on on other work environment, say, your operating system, you can’t do it. It means, add-ons are limited to a certain boundary.
These days there are many browsers which comes with add-on features. Firefox, Chrome, Internet Explorer, Safari and the recently born RockMelt has add-on facility. In Chrome add-on is known as extension. There is no difference between add-on and extension. Both are the same terms used differently in different browsers.


HTTP vs HTTPS

HTTP vs HTTPS

What is HTTP?

The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers.
HTTP works as a request-response protocol between a client and server.
A web browser may be the client, and an application on a computer that hosts a web site may be the server.
Example: A client (browser) submits an HTTP request to the server; then the server returns a response to the client. The response contains status information about the request and may also contain the requested content.

Hypertext Transfer Protocol (HTTP) is a protocol used in networking. When you type any web address in your web browser, your browser acts as a client, and the computer having the requested information acts as a server. When client requests for any information from the server, it uses HTTP protocol to do so. The server responds back to the client after the request completes. The response comes in the form of web page which you see just after typing the web address and press “Enter”.

Hypertext Transfer Protocol Secure (HTTPS) is a combination of two different protocols. It is more secure way to access the web. It is combination of Hypertext Transfer Protocol (HTTPS) and SSL/TLS protocol. It is more secure way to sending request to server from a client, also the communication is purely encrypted which means no one can know what you are looking for. This kind of communication is used for accessing those websites where security is required. Banking websites, payment gateway, emails (Gmail offers HTTPS by default in Chrome browser), and corporate sector websites are some great examples where HTTPS protocols are used.
For HTTPS connection, public key trusted and signed certificate is required for the server. These certificate comes either free or it costs few dollars depends on the signing authority. There is one other method for distributing certificates. Site admin creates certificates and loads in the browser of users. Now when user requests information to the web server, his identity can be verified easily.
Here are some major differences between HTTP and HTTPS:
HTTP
HTTPS
URL begins with “http://”
URL begins with “https://”
It uses port 80 for communication
It uses port 443 for communication
Unsecured
Secured
Operates at Application Layer
Operates at Transport Layer
No encryption
Encryption is present
No certificates required
Certificates required


how_internet_works














Thursday, 21 August 2014

JQM PhoneGap DB session login home page Template

login.html:

<!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8">
<title>KP Mobile Web App</title>
<link href="jquery-mobile/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css"/>
<script src="jquery-mobile/jquery-1.6.4.min.js" type="text/javascript"></script>

<script src="jquery-mobile/jquery.mobile-1.0.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<link rel="stylesheet" href="css/validate.css" />
<link rel="stylesheet" href="kphome.css" />
<script type="text/javascript" src="cordova-2.6.0.js"></script>

<script type="text/javascript">    

            $(document).bind("mobileinit", function()   //page flickering
        {    
                $.mobile.defaultPageTransition = 'none';
                $.mobile.defaultDialogTransition = 'none';
          
        });
            
</script> 
            
<script type="text/javascript">    
            

//var url="http://192.168.1.36:9090/hrms/";
var url="http://localhost:9090/hrms/";


document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady()
{
Dplatform=device.platform;
OSveriosn=device.version;
UUID= device.uuid;
alert('UUID'+UUID+'name'+OSveriosn+'OS'+Dplatform);
deviceinfo='OS: '+Dplatform+'Versionname: '+OSveriosn+'UUID: '+UUID;
alert(deviceinfo);
getDeviceLocation();
//alert("GEO:"+geo);


document.addEventListener("backbutton", Backbutton,false);
//msgloadingimage();
UUID=device.uuid;
//alert(UUID);
   sessionStorage.setItem('uuid',UUID);   
ApplicationVersionName="1.0";

/* if(navigator.network.connection.type==Connection.NONE || navigator.network.connection.type=="unknown" || navigator.network.connection.type==Connection.UNKNOWN)

{
        alert("Check Internet Connectivity");
       
        }
else{ */        
   
 $.ajax({
 url: url+"ANDROID_versionname.php",
 type:"POST",
 data:{"version":ApplicationVersionName}, 
 timeout: 5000,
 success: function(data) {
 if(data==10)
 {
 
 }
 else if(data==20)
 {
 alert("Please update the Current version 1.1");
 navigator.app.exitApp();  
 }
 
   },error:function(x, t, m)
       {   
           if(t==="timeout") {  navigator.notification.alert("Your Data connection is too slow", alertCallback,  "Alert");   } 
           
           else {  navigator.notification.alert("Check Internet Connectivity", alertCallback,  "Alert");           }
       }

}); 
       // }
 


} 


function alertCallback()
{}

 function Backbutton(){
 if($.mobile.activePage.is("#index")){
  
navigator.notification.confirm('Do you want to exit', onConfirm,'Alert');               
     } 
     
     function onConfirm(button) 
     {
      if(button==1)
      {
       //  e.preventDefault();                  
            navigator.app.exitApp();
      }
      else
      {
      }
     }
 }


function  getDeviceLocation() {
//alert('a');
        navigator.geolocation.getCurrentPosition(showPosition, showError, { enableHighAccuracy: true } );
   }

function showPosition(position) {
alert('b');
         alert("Latitude: " + position.coords.latitude + "Longitude: " + position.coords.longitude);    
 geo="Latitude: " + position.coords.latitude + "Longitude: " + position.coords.longitude;
        // geo1=geo.val();
         alert(geo);
        
 }

//5.Create a function to handle the error.

 function showError(error) {

       alert("Errorcode: "    + error.code    + 
                "Errormessage: "+ error.message );
   }
function AlertHandler()
{
       // Codes 
navigator.notification.alert('This is an alert message', AlertHandler, 'Message', 'Exit');
   }
function loginvalidate()
 {
//alert("s");
        
var x=document.forms["loginn"]["username"].value;       
      
      if(x==null || x=="")
      {
navigator.notification.alert("Username cannot be left blank", alertCallback,  "Alert");      
          return false;  
       }

var x=document.forms["loginn"]["password"].value;         
      
      if(x==null || x=="")
      {
navigator.notification.alert("Password cannot be left blank", alertCallback,  "Alert");                                 
          return false;  
       }
    
      else
      {
          
          return true;
      }
 
 }   
 
function help()
{
navigator.notification.alert("Credentials identifies your organization at Kp tech. Your organization may not be on our mobile application support.Please write/check with your Mobile HRMS for your Organization enrolment and the company Details", alertCallback,  "Alert"); 
}

function passingcode()
    {
//var url="http://http://192.168.1.36:9090//hrms/";
alert("passcode")
// $.mobile.loading( 'show' );

        var validate=loginvalidate();
        if(validate==true){
            
    var username= $("#username").val().toString(); //document.getElementById('compcode').value;
    var password= $("#password").val().toString(); 
    datavalue="username="+username+"&password="+password;
    alert(datavalue)
    $.ajax({
    url: url+"kp_login.php",
    type:"POST",
    data:datavalue,
    timeout: 5000,
    success: function(data) {   
   //  alert('c');
     
  data=jQuery.parseJSON(data);
  alert(data);
 
  if(data.status==1){
 
 
 
  sessionStorage.clear();  // storage session info clear
  sessionStorage.setItem('dbname',data.dbname);
sessionStorage.setItem('dbserver',data.dbserver);
//sessionStorage.setItem('logo',data.logo);
sessionStorage.setItem('dbuserid',data.dbuserid);        
sessionStorage.setItem('dbpass',data.dbpass);

//sessionStorage.setItem('uid',username);//empcode
sessionStorage.setItem('url',url);
//sessionStorage.setItem('name',data.name);
//sessionStorage.setItem('companyid',compcode);
sessionStorage.setItem('empid',data.empid);
$.mobile.showPageLoadingMsg();
               window.location='kphome.html';
               //sessionStorage.clear(); do not pass data 
               
  navigator.notification.alert("Login success", alertCallback,  "Alert");
  sessionStorage.setItem('url',url);
  // alert("Login success");
  $.mobile.showPageLoadingMsg();
  window.location="kphome.html";
  //$.mobile.pageLoading;
   }
   else if(data==2)
   {
  navigator.notification.alert("Invalid Username", alertCallback,  "Alert");     
  //alert("Invalid username");
  $('#username').val('');
  $('#password').val('');
  }
 
      },error: function(){
  alert('Network activity error');
  }
  });
        }else{
       
        $.mobile.hidePageLoadingMsg();
          //  $.mobile.loading( 'hide' );
        }
   }

</script>

</head> 
<body> 

<div data-role="page" id="index"><!-- index page -->

<div data-role="header"  data-theme="b" style="background: url(images/bg5.png) repeat-x;">
     <div align="center"><img src="images/icon.png" a style="vertical-align:bottom;height:40px;text-align:center;">
  <span>MOBILE HRMS</span></div>
    </div><!-- /header -->

<div data-role="content" class="pagecontent" >
 
            <div class="inset" >
            <div align="center">  <h3 style="color:#08298A;"> MEMBER LOGIN </h3></div>
            <br>
            <hr size="1px" align="left">
            <!-- <form name="kp_login" method="get"  onSubmit="return loginvalidate();" or add to login function function call action="javascipt:kp_login();"> -->
            <form id="Login" method="post" name="loginn" action="javascript:passingcode()">
            
            <p> USER NAME :<img src="images/Help.png" align="right" style="vertical-align:right;" onclick="help()" /> </p>
            <input type="text" name="username" id="username" value="" autocomplete="off" placeholder="User Name" data-clear-btn="true" min="3" maxlength="10"/>
            <p> PASS WORD : </p>
            <input type="password" data-clear-btn="true" name="password" id="password" autocomplete="off" value=""placeholder="Pass Word" min="3" maxlength="8"/>
          
            <div data-role="fieldcontain">
             <input type="submit" name="login" value="Sign In"  /> 
            </div>
        </form>
            <br />
            <hr size="1px">
            <div data-role="fieldcontain" align="justify">
            <a  href="kp_newreg.html" rel="external" data-role="button"  data-inline="true" data-theme="a">New Registration</a>
      <a  href="kp_forgotpass.html" rel="external" data-role="button"  data-inline="true" data-theme="a">Forgot Password?</a>
     
            </div>
            </div>
        </div>
</div><!-- /content -->
    
    <div data-role="footer" data-position="fixed"  style="background: url(images/bg5.png) repeat-x;overflow:hidden;">
    <h4>KP Tech</h4>
    
</div><!-- /footer -->
</div><!-- /index page -->



</body>
</html>


kp_loign.php :

<?php 
//session_start();
$username =$_POST["username"]; //Storing username in $username variable.
$password =$_POST["password"]; //Storing password in $password variable.
include("kp_dbconn.php"); //including config.php in our file
$row=array();
$qry = mysql_query("select firstname from persons where firstname = '$username' and lastname = '$password'") or die (mysql_error());

{ 
 if(mysql_affected_rows()>0){


$empdetail =mysql_query("select * from corpratedetails where empid = '$username'") or die(mysql_error());// select here image of emp and amp logo
if($empdetail==true)


//$row = mysql_fetch_array($empdetail);

  //echo $row[];
 $row['status']=1;$row['empid']=$username; $row['dbname']='test'; $row['dbserver']='localhost'; $row['dbuserid']='root';
  $row['dbpass']=' ';

echo json_encode($row);
}
else{

echo 2;
echo "username and password wrong";
}
}
   

?>

kphome.html :

<!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8">
<title>KP Mobile Web App</title>
<link href="jquery-mobile/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css"/>
<script src="jquery-mobile/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="jquery-mobile/jquery.mobile-1.0.min.js" type="text/javascript"></script>
<script src="json2.js" type="text/javascript"></script>

<script type="text/javascript" src="cordova-2.6.0.js"></script>
<link rel="stylesheet" href="kphome.css" />
<script type="text/javascript">    
            $(document).bind("mobileinit", function()
        {    
                $.mobile.defaultPageTransition = 'none';
                $.mobile.defaultDialogTransition = 'none';
          
        });
</script>  
<script>
document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() { 
url=sessionStorage.getItem('url');

document.addEventListener("backbutton", Backbutton , false);
}


function Backbutton() 
{
//alert('a')
$.mobile.showPageLoadingMsg();
window.location="index.html";
$.mobile.hidePageLoadingMsg();
}
function back_button()
{
navigator.notification.alert("Use logout", alertCallback,  "Alert"); 
/* $.mobile.showPageLoadingMsg();
window.location="index.html";
$.mobile.hidePageLoadingMsg(); */
}
function alertCallback()
{}
function logout()
{
navigator.notification.confirm('Do you want to logout', onConfirm,'Alert');

}


function onConfirm(button) 
{
if(button==1)
{
$.mobile.showPageLoadingMsg();
window.location="index.html";
sessionStorage.clear();
}
else
{

}
}

</script>
</head> 
<body> 

<div data-role="page" id="kphomepage">
<div data-role="header"  data-theme="b" style="background: url(images/bg5.png) repeat-x;">
    <h1 style="color:#FFF">Mobile HRMS</h1>
    
    <!--<a href="#" data-icon="gear" class="ui-btn-right">Options</a>-->
   <!-- <div data-role="navbar" >
        <ul>
            <li><a  href="#page3" style="color:#fff;background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#bdbdbd), to(#000));;border-color:#fff;border-left-color:#fff;border-right-color:#fff;" class="ui-btn-active">Attendence System</a></li>
            <li><a href="#page4"style="color:#fff;background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#bdbdbd), to(#000));;border-color:#fff;border-left-color:#fff;border-right-color:#fff;">Corporate Directory</a></li>
            <li><a href="#page5"style="color:#fff;background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#bdbdbd), to(#000));;border-color:#fff;border-left-color:#fff;border-right-color:#fff;">List of Holidays</a></li>
        </ul>
    </div>--><!-- /navbar -->
</div><!-- /header -->

<div data-role="content" class="pagecontent" >
    <div class="backlogobutton" >
    
    
    <!-- <a href="javascript:back_button()" rel="external"  data-theme="b" data-inline="true" style="float:left; margin-top:0px;" >
<img id="home_icon" alt="home"  style="width:20px;  height:20px; " src="images/2.png"> </a> -->

    <img src="images/kp.gif" id='helplogo' >   
 
  <a href="javascript:logout()"  title="Logout" rel="external"  data-theme="b" data-inline="true" style="float:right;margin-top:0px; " >
<img id="logout_icon" alt="logout"  style="width:35px;  height:35px;vertical-align: center " src="images/logout.png"  > </a>
<br>

   
    
    </div>
     <div class="inset" >
<ul data-role="listview" data-inset="true">
        <li><a href="kpattendence.html" rel="external">Attendance Management</a></li>
<li><a href="kp_corp_add.html" rel="external" >Corporate Directory</a></li>
            <li><a href="kp_listofholidays.html" rel="external" >List of Holidays</a></li>
            <li><a href="kp_timsheet.html" rel="external">Time sheet</a></li>
<li><a href="kp_payslip.html" rel="external">Pay slip</a></li>
            <li><a href="kp_helpdesk.html" rel="external">Help Desk</a></li>
            <!--<li><a href="#page8">Help Desk</a></li>
            
<li><a href="#page10">Page ten</a></li>-->
</ul>
</div>
    </div>
<!--<div data-role="footer" data-position="fixed" style="background: url(images/bg5.png) repeat-x;";>
<h4>Kp Tech</h4>
</div>-->
    
    <div data-role="footer" data-position="fixed"  style="background: url(images/bg5.png) repeat-x;overflow:hidden;">
    <h3 align="center">@KpTech</h3>
    <!--<div data-role="navbar">
        <ul>
            <li><a  href="#page3" style="color:#fff;background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#000), to(#bdbdbd));border-color:#fff;border-left-color:#fff;border-right-color:#fff;" class="ui-btn-active">Time Sheet</a></li>
            <li><a  href="#page3" style="color:#fff;background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#000), to(#bdbdbd));border-color:#fff;border-left-color:#fff;border-right-color:#fff;" class="ui-btn-active">Pay Slip</a></li>
            <li><a  href="#page3" style="color:#fff;background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#000), to(#bdbdbd));border-color:#fff;border-left-color:#fff;border-right-color:#fff;" class="ui-btn-active">Help Desk</a></li>
        </ul>-->
    </div><!-- /navbar -->
</div><!-- /footer -->
</div>




</body>

</html>


Saturday, 16 August 2014

Cordova / PhoneGap Simple Commands

npm install -g cordova

npm uninstall cordova -g


cordova install -g cordova@<version> eg cmd:>cordova install -g cordova@3.3  ok

cordova <projectname> <package name com.sa > <Folder name>

cd poject folder

cordova platform add android

cordova platform ls

cordova -v

cordova platform rm android

cordova build android <import eclpise>

cordova emulate android  <run on emulator>

cordova run android      <Run on android deveice>

cordova prepare android

cordova compile android

cordova plugin ls    # or 'plugin list'

$ cordova plugin rm org.apache.cordova.console
$ cordova plugin remove org.apache.cordova.console    # same

cordova update
cordova up



$ cordova platform update android
$ cordova platform update ios

$cordova info

Aadd-remove-input-fields

Add-Remove-input-fields

<!-- Thanks for the Reference
Tutorial: How to add/remove input field with jquery
Author: Anand Roshan
Author URI: http://voidtricks.com
Documentation: http://voidtricks.com/jquery-add-remove-input-fields
Demo URI: http://demo.voidtricks.com/jquery-add-remove-input-fields
-->

<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
$(document).ready(function(){
//when the Add Filed button is clicked
$("#add").click(function (e) {
//Append a new row of code to the "#items" div
$("#items").append('<div><input type="text" name="input[]"><button class="delete">Delete</button></div>');
});

$("body").on("click", ".delete", function (e) {
$(this).parent("div").remove();
});
});
</script>
</head>
<body>
<button id="add">Add Field</button>
<div id="items">
<div><input type="text" name="input[]"></div>
</div>
</body>
</html>

Responsive Design Image Map Multi Screen Size

Thanks for the REF :

http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html

https://github.com/stowball/jQuery-rwdImageMaps

<!DOCTYPE html>
<!-- saved from url=(0072)http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Responsive Image Maps jQuery Plugin</title>
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">

<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1">
<script src="./Responsive Image Maps jQuery Plugin_files/ios-orientationchange-fix.min.js"></script>
<script src="./Responsive Image Maps jQuery Plugin_files/jquery.min.js"></script>
<script src="./Responsive Image Maps jQuery Plugin_files/jquery.rwdImageMaps.min.js"></script>
<script>
$(document).ready(function(e) {
$('img[usemap]').rwdImageMaps();

$('area').on('click', function() {
alert($(this).attr('alt') + ' clicked');
});
});
</script>



<style>
body {
font-family: Helvetica, Arial, sans-serif;
}
h1 {
font-size: 20px;
}
div {
width: 100%;
}
img[usemap] {    // No need if we use some other page.
border: none;
height: auto;
max-width: 100%;
width: auto;
}
</style>
</head>
<body>
<div>
<h1>Responsive Image Maps jQuery Plugin</h1>
<p>Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize.</p>
<p><a href="https://github.com/stowball/jQuery-rwdImageMaps">Download the plugin from github</a></p>
<p>This image map was created in minutes with Adobe Fireworks.</p>
<img src="./Responsive Image Maps jQuery Plugin_files/powerpuff-girls.fw.jpg" width="1024" height="768" usemap="#powerpuffgirls" alt="">
<map name="powerpuffgirls">
<area shape="poly" coords="122,36,281,36,285,37,287,39,289,42,289,46,289,48,278,77,276,81,274,84,271,84,218,84,218,90,210,90,208,95,207,99,204,100,72,100,26,87,23,84,20,81,19,75,35,40,37,37,43,34,62,34,65,30,68,25,72,25,115,25,119,27,121,30,122,36,122,36" href="http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html#ppg" title="The Powerpuff Girls" alt="The Powerpuff Girls">
<area shape="poly" coords="864,667,912,649,922,667,971,667,973,718,981,721,985,729,988,730,1010,730,1010,742,833,742,833,730,865,730,865,721,874,721,874,718,864,667,864,667" href="http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html#cn" title="Cartoon Network" alt="Cartoon Network">
<area shape="poly" coords="1010,297,995,281,979,267,962,255,944,248,927,242,909,237,876,236,857,237,838,240,817,246,797,255,,519,945,522,954,523,966,520,979,516,985,511,989,507,993,499,994,493,991,484,986,475,967,463,982,454,998,439,1013,424,1024,409,1024,329,1017,312,1010,297,1010,297" href="http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html#buttercup" title="Buttercup" alt="Buttercup">
<area shape="poly" coords="51,706,221,694,215,683,213,677,213,670,215,664,219,656,231,645,215,652,206,657,198,660,190,662,181,660,169,655,157,648,150,638,142,617,130,596,120,582,112,571,100,571,100" href="http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html#blossom" title="Blossom" alt="Blossom">
<area shape="poly" href="http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html#bubbles" title="Bubbles" alt="Bubbles">
</map>
</div>

</body>
</html>


Image Map with element map and area


<!DOCTYPE HTML>
<html>
<head>
<style>body{font-family:Verdana;}</style>
</head>
<body>
 An Image Map showing the Seven Wonders of the  World
<p>
<img src="seven_wonders.jpg" usemap="#imagemap"
     alt="Seven Wonders of the World"/>
</p>
<map name="imagemap">
<area href="Chichen_Itza.html" shape="rect" coords="0,0,93,65"
       alt="chichen Itza"/>
<area href="Christ_on_Corcovado_mountain.html" shape="rect" coords="93,1,186,65"
      alt="Christ on Corcovado Mountain"/>
<area href="great_wall_china.html" shape="rect" coords="0,66,94,132"
      alt="great wall of china"/>
<area href="Machu_Picchu.html" shape="rect" coords="92,64,186,132"
      alt="machu picchu"/>
<area href="Al_Kanzneh.html" shape="rect" coords="0,133,94,201"
      alt="al kanzneh"/>
<area href="Taj_Mahal.html" shape="rect" coords="92,134,186,203"
       alt="taj mahal"/>
<area href="Colosseum_Rome.html" shape="rect" coords="0,202,186,260"
      alt="colosseum Rome"/>
</map>
<small>Refresh the Page to goto the Image Map</small>
  </body>
</html>

Thanks for the Ref:
http://www.tutorialspark.com/html5/HTML5_ImageMap.php

Friday, 15 August 2014

HTML table row alternate row color

tr:nth-child(even) {
    background-color: #000000;
}
Note: No support in IE, even IE 8.

Or, if you have jQuery:

$(document).ready(function()
{
  $("tr:even").css("background-color", "#000000");
});
==========================




There is a CSS selector, really a pseudo-selector, called nth-child. In pure CSS you can do the following:

tr:nth-child(even) {
    background-color: #000000;
}
Note: No support in IE, even IE 8.

Or, if you have jQuery:

$(document).ready(function()
{
  $("tr:even").css("background-color", "#000000");
});
=========================

table tr:nth-child(odd) td{
}
table tr:nth-child(even) td{
}

-------------------------------


CSS:

tr.d0 td {
    background-color: #CC9999; color: black;
}
tr.d1 td {
    background-color: #9999CC; color: black;
}
HTML:

<table>
<tr class="d0"><td>One</td><td>one</td></tr>
<tr class="d1"><td>Two</td><td>two</td></tr>
</table>
Here I am using class for tr, but I want to use only for table. When I use class for table than this apply on tr alternative.

Can I write my HTML like this using CSS?

<table class="alternate_color">
    <tr><td>One</td><td>one</td></tr>
    <tr><td>Two</td><td>two</td></tr>
    </table>




PHP Mail format and alternate

$to = "receiver@gmail.com";
   $subject = "'".$sendername."' Send a message to '".$receivername."'";

   $message = "
   <html>
   <head>
   <title>HTML email</title>
   </head>
   <body>
   <p>'".$sendername."' Send a message to '".$receivername."'</p>
   <table>
   <tr>
   <th>Message</th>
   </tr>
   <tr>
   <td>".$_POST['Message']."</td>
   </tr>
   </table>
   </body>
   </html>
   ";

   // Always set content-type when sending HTML email
   $headers = "MIME-Version: 1.0" . "\r\n";
   $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

   // More headers
   $headers .= 'From: <kumarappan@smaatapps.com>' . "\r\n";
   $headers .= 'Cc: myboss@example.com' . "\r\n";

   mail($to,$subject,$message,$headers);

Sunday, 3 August 2014

Simple RWD for css3 based

Responsive web design in 3 steps:

step:1

tep 1. Meta Tag (view demo)

Most mobile browsers scale HTML pages to a wide viewport width so it fits on the screen. You can use the viewport meta tag to reset this. The viewport tag below tells the browser to use the device width as the viewport width and disable the initial scale. Include this meta tag in the <head>.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Internet Explorer 8 or older doesn't support media query. You can use media-queries.jsor respond.js to add media query support in IE.
<!--[if lt IE 9]>
 <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->

Step 2. HTML Structure

In this example, I have a basic page layout with a header, content container, sidebar, and a footer. The header has a fixed height 180px, content container is 600px wide and sidebar is 300px wide.

Step 3. Media Queries

CSS3 media query is the trick for responsive design. It is like writing if conditions to tell the browser how to render the page for specified viewport width.
The following set of rules will be in effect if the viewport width is 980px or less. Basically, I set all the container width from pixel value to percentage value so the containers will become fluid.


<!DOCTYPE HTML>
<html lang="en-US">
<head>
 <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
 <title>Media Responsive Web page</title>


        <style  type="text/css">
@media (min-width: 481px) and (max-width: 768px) 
{
            #banner { width:740px; }
            #banner img { max-width:740px; max-height:222px; }
            #main { width:740px; }           
           
           
}

          @media (min-width: 321px) and (max-width: 480px)
 {
            #banner { width:450px; }
            #banner img { max-width:450px; max-height:135px; }
            #main { width:450px; }           
                   
          }

          @media (max-width: 320px) {
            #banner { width:275px; }
            #banner img { max-width:275px; max-height:83px; }
            #main { width:250px; }           
           
          }

 </style>

<div id="banner"><img src="https://www.ibm.com/developerworks/mydeveloperworks/blogs/bobleah/resource/sky.gif"></div>
<div id="main">

         Proin eu magna a purus feugiat
   
   </div>
 
</head>
</html>


rw

Redux vs Redux Toolkit vs React Context

  These are often confused. Feature Redux Redux Toolkit Context API Purpose State management Simplifies Redux Shares values in Rea...