Posted May 17, 2011 by Nick Vogt in Programming
JSON stands for JavaScript Object Notation. It is a widely-used model for transferring variable data as text, and is often used in combination with AJAX to create the basis for highly-interactive, portable, and modular websites (Facebook, Twitter, etc).
If you are familiar with JavaScript objects, then you already know JSON! If you aren't, it is very easy to learn. A JavaScript object is just like an object in ActionScript 3 or an associative array in PHP, just with slightly different syntax.
Here is the basic syntax for JSON. This object contains two strings, an array, and an object:
Continue reading...
If you are familiar with JavaScript objects, then you already know JSON! If you aren't, it is very easy to learn. A JavaScript object is just like an object in ActionScript 3 or an associative array in PHP, just with slightly different syntax.
Here is the basic syntax for JSON. This object contains two strings, an array, and an object:
{
"one": "A Number",
"hello": "world",
"myarray": [
"orange",
"apple",
"banana"
],
"myobject": {
"library": "books",
"bar": "alcohol"
}
}
"one": "A Number",
"hello": "world",
"myarray": [
"orange",
"apple",
"banana"
],
"myobject": {
"library": "books",
"bar": "alcohol"
}
}
Continue reading...
Posted May 12, 2011 by Nick Vogt in Programming
In a nutshell, AJAX allows you to update parts of a page with server-side content using JavaScript, without reloading the whole page. AJAX is not a new language, it's just a method for using JavaScript to achieve this functionality.
To use AJAX you will need to know a bit of JavaScript and (for this example) PHP, and have a server that can parse PHP. If you don't have this, you can download Apache server and PHP for free from their respective websites (follow my guide on setting up Apache, MySQL, and PHP on Windows).
Before diving into AJAX, first take a look at this example:
Continue reading...
To use AJAX you will need to know a bit of JavaScript and (for this example) PHP, and have a server that can parse PHP. If you don't have this, you can download Apache server and PHP for free from their respective websites (follow my guide on setting up Apache, MySQL, and PHP on Windows).
Before diving into AJAX, first take a look at this example:
<html>
<head>
<script type="text/javascript">
function hello()
{
document.getElementById('content').innerHTML = 'Hello World!';
}
</script>
</head>
<body>
<input type="button" value="Click Me" onclick="hello();">
<div id="content">Nothing here yet.</div>
</body>
</html>
<head>
<script type="text/javascript">
function hello()
{
document.getElementById('content').innerHTML = 'Hello World!';
}
</script>
</head>
<body>
<input type="button" value="Click Me" onclick="hello();">
<div id="content">Nothing here yet.</div>
</body>
</html>
Continue reading...
Posted February 5, 2010 by Nick Vogt in Web and Internet
A lot of people use ad blockers these days. They are generally the most popular plug-ins for browsers, and most come with comprehensive blacklists that will block most ads on the Internet right from the get-go. As a web designer and developer, there isn't much you can do about it. I myself use AdBlocker Plus for Firefox, and I'm not about to complain when other people use it to block my own website ads.
But what does bug me is how some websites can end up looking a little awkward with the ads blocked. DIVs and other elements will not be positioned properly, or may overlap. This is because web design/developers design with the ads in mind and generally don't care what the site looks like with the ads blocked. Whether this is an ethical complaint or not is meaningless, my point is that you should design your site so that it still looks good even with blocked ads. One way to do this is to use JavaScript to detect when ads have been blocked, and then adjust/remove certain elements accordingly.
Continue reading...
But what does bug me is how some websites can end up looking a little awkward with the ads blocked. DIVs and other elements will not be positioned properly, or may overlap. This is because web design/developers design with the ads in mind and generally don't care what the site looks like with the ads blocked. Whether this is an ethical complaint or not is meaningless, my point is that you should design your site so that it still looks good even with blocked ads. One way to do this is to use JavaScript to detect when ads have been blocked, and then adjust/remove certain elements accordingly.
Continue reading...

