White Space Problem with JavaScript

October 31st, 2009 by dr.emi

This tutorial will explain about how to solve white space problem with JavaScript. One time, I founded bug on my PHP script. White space was broke it! Shit!. However javascript doesn’t have trim function like PHP. For example, if you want to validate user form using jQuery and PHP, my advice is: you must check the white spaces before send string to PHP Action Script. Then you will fine to use PHP trim function or class defined.

It’s fuck’n crazy. My jQuery not respond If I don’t check white space before send string into PHP script. So I need to find the white space before send it!

Here are my simple javascript code to find and count the white spaces:

// Count the number of times a substring is in a string.
String.prototype.substrCount =
  function(s) {
    return this.length && s ? (this.split(s)).length - 1 : 0;
  };

//some function to implementad
function loadContentResult(id) {
	if(id.substrCount(' ') > 0)
	{
		window.alert('I found white spaces on field');
	}
       else
       {
		window.alert('White spaces cleared!! You may add the next PHP / jQuery here');
       }

First: counting white space as problem caused

String.prototype.substrCount =
  function(s) {
    return this.length && s ? (this.split(s)).length - 1 : 0;
  };

Next, we will try the scripts as user id validator on my jQuery tutorial. See you!

Popularity: 14% [?]

Website Web Development dan Design dremi.NET Telah Publish

October 27th, 2009 by dr.emi

Malam ini guwe sempet juga nulis di blog kesayangan ini :)

Lama sudah tutorial kagak diupdate. Karena sesuatu dan lain hal, kadang guwe cuma bisa approve komentar dowank. Ya, bagaimanapun waktu sudah berubah. Saat ini sudah banyak para aktifis / blogger-bolgger muda di dunia maya yang telah berkarya dan sharing dengan rajinnya. Mengharapkan rating, publikasi, dan dikenal banyak orang :) semoga yang diatas memberikan balasan terbaik buwat kalian semua yang rajin berbagi :)

read more

 

Popularity: 2% [?]

Kerja Keras Adalah Energi Kita

October 24th, 2009 by dr.emi

Pertamina

Kerja Keras Adalah Energi Kita!!
Memang benar, kalimat ini sempat menghentakkan hati kecilku! Bagaimana tidak, sebuah kalimat dengan makna yang senantiasa melekat di jiwaku sejak awal berkarir di luar daerah, telah banyak memberikan kemudahan dalam menjalankan setiap pekerjaanku.

read more

 

Popularity: 1% [?]

Password Founded for GnomePM.XLS

October 8th, 2009 by dr.emi

Password founded for GnomePM.xls from Civil and Environment Departement of ITB Bandung. GnomePM Application is simple XLS file that build in Macro and Visual Basic. With GnomePM, you can manage Construction Project in Worksheet are.

As you read on this link, GnomePM was last updated in 17/09/2007

http://si.itb.ac.id/~abduh/GnomePM/download.html

Contact me to get password list! and unprotected GnomePM.xls

Popularity: 9% [?]

Download PHP Script: Backup and Restore Database

October 1st, 2009 by dr.emi

Hi guys!

This is PHP Script to backup or restore your SQL Database. It’s Free to download!

Just visit my PHPClasses Page:
http://www.phpclasses.org/browse/package/5720.html

Or let’s discuss about something bug or report on:
http://www.phpclasses.org/discuss/package/5720/

Popularity: 21% [?]

Klentang Sasak Kesukaan Guwe

September 27th, 2009 by dr.emi

Bau Nyale. Sebuah perayaan musiman di Lombok. Dimana terdapat acara menangkap cacing laut yang kami sebut sebagai Nyale. Menurut kepercayaan kami, Nyale merupakan sosok jelmaan seorang Putri Tercantik di Lombok dari kejaraan Sekar Kemuning Lombok.

Ya, Klentang sasak yang guwe persembahkan ini merupakan tembang berjudul Bau Nyale…. Dimana gending klentang sasak adalah salah satu kesenian sasak yang guwe suka dan bermakna sangat dalam bagi suku sasak di Lombok.

Semoga dapat menghibur bagi teman teman sasak lainnya yang sedang merantau maupun yang sedang berada di Lombok. Mari kita senantiasa mengingat dan melestarikan budaya Sasak sebagai salah satu kekayaan Negeri Ini.

Popularity: 1% [?]

Mudik euuuyyy…..

September 13th, 2009 by dr.emi

Halo treman treman, sore menjelang magrib ini guwe siap berangkat ke Lombok NTB. Buwat mudik ke kampung halaman. Hahahahaha… berbekal seadanya akhirnya mudik juga…. uhui….

Bwat semua treman treman, pengunjung, anak anak kosan, mantan mantan guwe, rekan-rekan projek / kerja guwe, dan semuanya aja dah:

MOHON MAAF LAHIR BATIN, SELAMAT BERLEBARAN!

Popularity: 1% [?]

Menginstall Apache, MySQL, PHP dan JSP di Windows XP

September 1st, 2009 by dr.emi

Artikel berikut ini bisa lu pake bwat panduan yang mau belajar PHP+JSP dari awal. Tentu saja sebelum mempelajari kodingna, lu musti install ini dan itu. Nah mudah2an aja arikel ini bermanfaat.

read more

 

Popularity: 12% [?]

Building Administrator Manager for Table Relation Using PHP and jQuery

July 3rd, 2009 by dr.emi

Hello my friends, this tutorial will explain about how to building complete Administrator Manager, Using PHP and jQuery. At the begining of tutorial you will explained about designing interface for our Administrator Page, then will continue with steps about how to make it as ready application.

Well, actually I don’t know how to create good tutorial, but I feel, I must share this tutorial. Based on my recent project last month, this tutorial will guide you to be a webmaster. I am sure, you know about what is webmaster :) Because in this tutorial you will see technic from first designing till hand code your application. Enjoy it friends !

read more

 

Popularity: 13% [?]

How to Illustrate Samsung Monitor – SyncMaster 933SN Series

July 3rd, 2009 by dr.emi


Hi brother ! this tutorial will explain about how to create an illustration for my new Samsung Monitor, SyncMaster 933SN series. Follow my steps, and enjoy my tutorial.

read more

 

Popularity: 14% [?]

 
 
 
 
Category
stack

Switch to our mobile site