LONG ISLAND SOFTWARE DEVELOPMENT
JavaScript Programming for Long Island and New York
Custom JavaScript development for data-driven websites, business applications, interactive calculators and automation. We build complete applications and improve existing systems, whether the project is large or small.
Net/Works combines front-end JavaScript with back-end services and databases, including PHP, MySQL and Node.js. We also work with the Linux servers and hosting environments that support those applications.
A real-world JavaScript project
One client needed an interactive calculator that estimated heating degree days by location. We sourced climate information by ZIP code, stored it in a MySQL database on a Linux cloud server we configured, and built a PHP/HTML form to collect the user's ZIP code. JavaScript retrieved the relevant information, performed calculations and displayed the results on the page.
JavaScript in the browser and on the server
Browser-side development
Interactive forms, validation, dynamic calculations, AJAX requests, and data-rich web interfaces.
Node.js development
JavaScript can also run outside the browser. We build server-side software and APIs using Node.js.
Selected JavaScript code
These excerpts are from the original project description and illustrate the form validation, AJAX integration and calculator logic. They are historical examples, not a complete standalone application; the full client project is proprietary.
Form validation
function validateForm() {
window.alert(5 + 16);
var x = document.forms["theform"]["t12"].value;
if (x == null || x == "") {
alert("DAYS PER WEEK IN SERVICE must be filled out.");
return false;
}
var y = document.forms["theform"]["zip"].value;
if (y == null || y == "") {
alert("ZIP CODE must be filled out.");
return false;
}
var a = document.forms["theform"]["t14"].value;
if (a == null || a == "") {
alert("HOURS SPENT PER DAY must be filled out. ");
return false;
}
}
But then we get into the AJAX calls to the PHP code, which looks up data in a MYSQL table - here's just a small part of it as an example :
///////////////////////////////
AJAX request to a PHP endpoint
function frate()
{
var zip = $("#zip").val();
console.log(zip);
$.ajax({
type: "POST",
url: "rateseek2d2.php",
data: "zip="+zip,
cache: false,
success: function(response)
{
// alert(response);
// document.getElementById("dd2").innerHTML = response;
$('#rate').val(response);
//response =response*100;
r=response*100;
r= parseFloat(Math.round(r * 100) / 100).toFixed(0);
$('#prate').val(r);
// $("#dd2").html(response);
}
});
}
and then the calculator code itself - or at least some small parts of it:
Calculator logic
function calc() {
var dd = $("#totalDD").val();
var t12 = $("#t12").val();
var vr = $("#rate").val();
var t14 = $("#t14").val();
var t16 = $("#t16").val();
//var t18 = $("#t18").val();
t18 = t12 * t14 * t16 * 52
document.getElementsByName('t18')[0].value = t18;
var t20 = $("#t20").val();
var t22 =t18*t20
document.getElementsByName('t22')[0].value = t22;
var t24 = $("#t24").val();
var t26 = $("#t26").val();
var t28 = $("#t28").val();
Related programming and server services
Server-side application logic and database-backed websites.
MySQL programmingData storage, queries and integration.
MongoDB programmingJavaScript services beyond the browser.
Apache web serversWeb-server setup and troubleshooting.
Linux administrationHave a JavaScript project?
We're based on Long Island and work with clients throughout New York and beyond. Whether you need a new application, database integration, or help with existing code, we'd be glad to discuss it.
Contact Net/Works