Saturday, April 30, 2011

Mapping the Disease Trends

Be The First To Comment
West Nile Virus (WNV) is the most widespread arbovirus (viruses that are transmitted by arthropods) in theworld. . During the period of 1996 -1999, the WNV became prevalent insouthern Romania, the Volga delta in southern Russia, and the northeastern United States. The spread of WNV covered the United States from coast to coast in four years, and by then it had 7 infected about one million Americans, killing about eight hundred.

Here I mapped the spatial trends of WNV virus in the United States of America.

Check website - http://globalmonitoring.sdstate.edu/eastweb/maps/wnv1999_2011/

Thursday, April 21, 2011

Add and Remove DOM Elements..

1 Comment
Snippets for adding DOM elements dynamically to the defined DOM element.
Here, "mydiv2" is added dynamically as "mydiv"1's child.

    //Dynamically generate Div
    var newdiv = document.createElement('div');
    var divIdName ='mydiv2';
    newdiv.setAttribute('id',divIdName);
    newdiv.style.width = "565px";
    newdiv.style.height = "480px";
    newdiv.style.left = "0px";
    newdiv.style.top = "0px";
    newdiv.style.position = "absolute";
   newdiv.style.border = "1px solid #000";
    document.getElementById('mydiv1').appendChild(newdiv);

A good example by Dustin Diaz to remove DOM elements Dynamically.

removeElement JavaScript Function

function removeElement(divNum) {

  var d = document.getElementById('myDiv');

  var olddiv = document.getElementById(divNum);

  d.removeChild(olddiv);

}

Sunday, April 3, 2011

Detect Browser Type Using Javascript and Pass it into PHP variable

3 Comments
<html>
<head>
<script type="text/javascript" language="javascript">
function DetectBrowser(){
// Browser Detection Javascript
// copyright 1 February 2003, by Stephen Chapman, Felgall Pty Ltd
// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("chrome") != -1) return 'Chrome';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}

</script>
</head>
<title>
</title>
<body>
<?php
$browser= "<scriptlanguage=javascript>document.write(DetectBrowser());</script>";
echo $browser;
?>
</body>
</html>
The php portion shows the example of "Passing Javascript variable into the PHP variable"
 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me