<!doctype html>
<!--[if IE 7 ]> <html class="no-js ie ie7 lte7 lte8 lte9" lang="en-US"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie ie8 lte8 lte9" lang="en-US"> <![endif]-->
<!--[if IE 9 ]> <html class="no-js ie ie9 lte9>" lang="en-US"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head data-live-domain="api.jquery.com">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Acronym Deciphering via jQuery.ajax() - RJM Programming - 2015</title>
<meta name="author" content="jQuery Foundation - jquery.org">
<meta name="description" content="jQuery: The Write Less, Do More, JavaScript Library">
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="http://api.jquery.com/jquery-wp-content/themes/api.jquery.com/i/favicon.ico">
<link rel="stylesheet" href="http://api.jquery.com/jquery-wp-content/themes/jquery/css/base.css?v=1">
<link rel="stylesheet" href="http://api.jquery.com/jquery-wp-content/themes/api.jquery.com/style.css">
<link rel="pingback" href="http://api.jquery.com/xmlrpc.php" />
<!--[if lt IE 7]><link rel="stylesheet" href="css/font-awesome-ie7.min.css"><![endif]-->
<script src="http://api.jquery.com/jquery-wp-content/themes/jquery/js/modernizr.custom.2.6.2.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write(unescape('%3Cscript src="http://api.jquery.com/jquery-wp-content/themes/jquery/js/jquery-1.9.1.min.js"%3E%3C/script%3E'))</script>
<script src="http://api.jquery.com/jquery-wp-content/themes/jquery/js/plugins.js"></script>
<script src="http://api.jquery.com/jquery-wp-content/themes/jquery/js/main.js"></script>
<script src="//use.typekit.net/wde1aof.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<style>
table { border-collapse: collapse; }
tr.even { background-color: #C2C8D4; }
tr.over { background-color: #8797B7; }
td {
border-bottom: 1px solid #C2C8D4;
padding: 5px;
}
th {
border-right: 2px solid #FFF;
color: #FFF;
padding-right: 40px;
padding-left: 20px;
background-color: #626975;
}
th.sortUp {
background: #626975 url(http://www.rjmprogramming.com.au/Javascript/jQuery/SortableTable/jquery/images/asc.gif) no-repeat right center;
}
th.sortDown {
background: #626975 url(http://www.rjmprogramming.com.au/Javascript/jQuery/SortableTable/jquery/images/desc.gif) no-repeat right center;
}
</style>
<script type="text/javascript" src="http://www.rjmprogramming.com.au/Javascript/jQuery/SortableTable/jquery/jquery-latest.js"></script>
<script type="text/javascript" src="http://www.rjmprogramming.com.au/Javascript/jQuery/SortableTable/jquery/jquery.tablesorter.js"></script>
<script type='text/javascript' src='http://api.jquery.com/wp-includes/js/comment-reply.min.js?ver=3.8'></script>
<meta name="generator" content="WordPress 3.8" />
<link href='//www.rjmprogramming.com.au/PHP/emboss_h1.css' rel='stylesheet' type='text/css'>
<script type="text/javascript">
var trclass="odd";
var f400 = location.search.split('topoff=')[1] ? location.search.split('topoff=')[1].split('&')[0] : '400';
$(document).ready(function() {
$('tr').mouseover(function() {
$(this).addClass('over');
});
$('tr').mouseout(function() {
$(this).removeClass('over');
});
$('tr:even').addClass('even');
$('#myt').tablesorter({
sortList:[[1,0]],
cssAcc: 'sortUp',
cssDesc: 'sortDown',
widgets: ['zebra']
});
});
function getacronym(vsselname) {
var stable=document.getElementById('content').innerHTML;
var goes=stable.split("<table");
if (stable.indexOf("</tbody>" + "</table>") == -1) stable = goes[0];
if (vsselname != "") {
vsselname = vsselname.replace(/[.]/g, "");
$.ajax({ url: "getacronymdata.php",
data: {"SELNAME":vsselname},
type: 'get',
success: function(output) {
if (output.replace(" type='text/javascript'", "").indexOf("script>") != -1) {
var w = window.open();
w.document.open();
w.document.write(output);
w.document.close();
//document.write(output);
//var bits=output.replace(" type='text/javascript'", "").replace("</" + "script>", "script>").split("script>");
//eval(bits[1].replace("var ", " ").replace("function onl() {", "").replace("}", ""));
//document.getElementById('content').innerHTML = stable;
} else {
var objJSON = JSON.parse(output.replace("}]}]}]", "}]}]}").replace("[",""));
var i;
if (output != "[]") {
if (stable.indexOf("</tbody>" + "</table>") == -1) stable = stable + "<table id='myt' class='tablesorter' cellpadding=5 cellspacing=5 style='border: 3px solid green;'><thead><tr class='even'><th class='header'>Title</th><th class='header'>Frequency</th><th class='header sortDown'>Since</th></tr></thead><tbody></tbody>" + "</table>";
for (i=0; i<objJSON.lfs.length; i++) {
if (stable.indexOf(">" + objJSON.lfs[i].lf + "</td") == -1) {
stable = stable.replace("</tbody>" + "</table>" , "<tr class='" + trclass + "'><td>" + objJSON.lfs[i].lf + "</td><td>" + objJSON.lfs[i].freq + "</td><td>" + objJSON.lfs[i].since + "</td></tr></tbody>" + "</table>");
trclass = trclass.replace("even", "oxdd").replace("odd", "exven").replace("x", "");
}
}
}
document.getElementById('content').innerHTML = stable;
}
}
});
}
document.getElementById('content').innerHTML = stable;
}
$(document).ready(function() {
$("tr").mouseover(function() {
$(this).addClass("over");
});
$("tr").mouseout(function() {
$(this).removeClass("over");
});
$("tr:even").addClass("even");
$("#myt").tablesorter({
sortList:[[0,0]],
cssAcc: "sortUp",
cssDesc: "sortDown",
widgets: ["zebra"]
});
});
</script>
</head>
<body onload=" document.getElementById('acronym').focus(); " style=" background-color: yellow;" class="api jquery single single-post postid-291 single-format-standard single-author singular">
<div align="center" style=" width:100%; background-color: lightblue; ">
<br><h1 align="center"> Acronym Lookup</h1>
<!--form method="post" style=" background-color: yellow;"-->
<div align="center"> Acronym: <input style=" background-color: pink;" type="text" name="acronym" id="acronym" onblur=" getacronym(this.value);" /></div><br><br>
<!--/form-->
</div>
<div align="center" id="content" style=" width:100%; height: 600px; background-color: yellow; ">
Results go below ...
<table id='myt' class='tablesorter' cellpadding=5 cellspacing=5 style='border: 3px solid green;'><thead><tr class='even'><th class='header'></th><th class='header sortDown'>Title</th><th class='header'>Frequency</th><th class='header'>Since</th></tr></thead><tbody id='tbody'></tbody></table>
</div>
</body>
</html>