- Coloring search result
We have discussed multiple keyword searching on the previous artikel. Building web portal must follow visitor needs. We must display information in neat format, so information can be read easily. Based on this need, we want to display string found on the search in certain format. We can make it bold or we can make certain background color. I think bolding the string is more clean and professional rathen than coloring the background with yellow or something like that.
I am choosing to make the ...
More »
- Searching multiple keywords
Searching is one of common feature in database based programming. Information stored on database is queried using certain condition and then display on the application. Searching feature using PHP and MySQL is very easy. we can combine php and mysql feature to easy get data wanted.
We collect keyword using simple form contain one input named 'keyword' and one button named 'Search'. We can use POST or GET and it's same in this case because keyword string will be used on the url combined with ...
More »
- Improve website accessibility
Website accessibility is dimension to measure how fast and how easy is our website accessed by visitor. It's depending on how many seconds or how many minutes consumed to load and display our website contents. We can also see on how good the display or the features working on the browser that used by visitor. Less time on loading is better than heavy load. Websites which working on any browsers can reach more visitor rather than website which can only work on certain browser. Sometime, ...
More »
- Simple Pagination
Data display is one of common feature on web application development. we will often be tasked to display large amounts of data to the user in some kind of easy to read format. Let's say for instance we have a list of accounting entries in our database, and we want to display it easier on accounting report. for big company that has hundred or thousand of transaction each day, displaying all transactions of one month in one page is not good idea. It will slow down the application and it's also ...
More »
- Email validation using Javascript
When collecting input data from user, we must validate all inputed data before inserted into database or another next action. Validation will make sure that data is secure, safe, and it has type or value as designed on the application. One of important validation is email validation. Email validation must be checked on front end using Javascript and also on the backend where script process the input. By doing double check, we can make sure it's working as planed. if we just make validation on ...
More »
- JavaScript Variable Scope
Sometime we need basic concept before doing complex idea. We will try to explore variable scope in Javascript. Javascript uses scope chains to establish the scope for a given function. Important thing, there is typically one global scope, and then each function defined has its own nested scope. Any function defined within another function has a local scope which is linked to the outer function. It's always the position in the source that defines the scope.
For our review, an element in the ...
More »
- Copy to clipboard in Javascript
Reading and modifying the clipboard from a webpage raises security and privacy concerns. There is no jQuery/Javascript only solution available: Most browsers cannot access the clipboard for security reasons. The use of Flash is basically a workaround. There's nice library that work in flash 10. It's called SeroClipboard. The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie, and a JavaScript interface. They said that 'Zero' signifies ...
More »
- How to find event listeners on a DOM node?
Creating user interface using javascript need our attention to to 'hear' what user activity and what they need to easy use our application. Sometime we need to know event made by the user. So we need event listener to 'hear' the event. Rich application may need complex event handler to make better user interface and interactivity.
Event listener depends on how the events are attached. For illustration presume we have the following click handler:
var handler = function() { alert('clicked!') ...
More »
- How to check id a variable defined in Javascript?
Sometime we need to check if certain variable is defined or not on Javascript. We can test it using conditional block using typeof operator. For undefined variable, it will return 'undefined'. and to make sure this return expected result, we can use '===' operator:
if (typeof variable === 'undefined') {
// variable is undefined
}
in JavaScript, a variable can be defined, but hold the value undefined, so the most common answer is not technically correct, and instead performs the ...
More »
- Alternative DOS Printer to print raw format using dot matrix printer
There's solution on the web to print raw format using dot matrix printer. DOSPrinter, DOS Printer, SwitProntFill, Dos2USB, and there's other personal solution to print raw format. These programs bridge ability to print to connected printer using command prompt or we can pass it from our application. We can also build our own small program to handle printing job. We will try to build this program using Delphi and RawPrint unit.
program swinprinter;
{$APPTYPE CONSOLE}
uses
SysUtils, ...
More »