Skip to main content

Use PHP Jquery to build AJAX web application

SISINDOTEK Tips

If you're like most PHP developers, you probably learned your craft the old-fashioned way. You learned how to define and build simple PHP pages, connect them to simple MySQL tables, and off you went. As you progressed through various skill levels, you learned how to create ever-more complex PHP functionality, and you learned how to join tables in MySQL and perform other advanced tasks.

Along the way, you probably picked up a number of client-side skills to bring your Web applications to life. You may have learned a bit about XHTML or CSS, maybe some JavaScript programming. Depending on the kinds of projects you're used to, you may even have had the chance to work with Ajax to give your Web applications that Web 2.0, or "desktop," feel. If your first experience with Ajax was anything like mine, however, you probably did too much work — hand-rolling your functions and struggling through the process of creating an Ajax-driven page.

Frequently used acronyms




  • CSS: Cascading Style Sheet

  • HTML: Hypertext Markup Language

  • XHTML: Extensible Hypertext Markup Language

  • XML: Extensible Markup Language



For some, Ajax is still a mystery. It's something that the "cool kids" and "bad boys" of Web development/interactivity do, and they've never had the time, patience, or skill to take it on. It's a shame, too, because a lot of clients really like adding Ajax-style functionality — it makes Web applications easier to work with. If you're one of these PHP developers, never fear: By the time you're done reading this article, you'll know enough to become a real Ajax pro.

This article shows how to use jQuery to easily add Ajax functionality to any PHP Web application. You'll build a simple Web application with PHP and MySQL — a phone book containing names and phone numbers. The application has all the standard things you'd expect — a way to search for names or phone numbers, a MySQL table, etc. Next, you'll add jQuery to the application, giving you the ability to search for names and phone numbers in real time, as you type. When you're done, you should have a pretty good grounding in not only some jQuery basics but also in the fundamentals of Ajax.

What is Ajax?

The best way to describe Ajax is to compare it to what you already know. Most Web pages and applications work in synchronous mode. You click a link or a form's Submit button, and the request is sent to the server, which then processes that request and sends back a response. The best way to sum up this model is "click, wait, view." It's a never-ending rinse-and-repeat cycle that you know all too well. In other words, if your page needed to show constantly updated information, you either had to put in some kind of auto-refresh hack or make the user refresh or click a link to make things happen.

Ajax changes all that. The first A in Ajax stands for asynchronous. Ajax allows you to create a page in any programming language, then refresh different parts of that page with information from a database or some other back-end server process. For example, say you have an e-commerce site that shows products for sale. On each product page, there are the usual items: headlines, sales copy, thumbnail photos, the number of items in stock.

Say you wanted to keep the site visitor updated on how many items were in stock. You could add an Ajax function that would run a separate PHP page containing a MySQL query, then repopulate the information on the original page without any input from the user or without regard to the synchronous nature of the click-wait-view pattern of events.

The j in Ajax stands for JavaScript, and that's what powers all the behavior you get. That's a blessing and a curse, really — a blessing because it's all client-side code, so it's portable and doesn't affect the server; a curse for a lot of PHP developers because it's a different environment than they're used to. That's where tools and frameworks like jQuery come in: They vastly simplify how you interact with Ajax, speeding our time to code completion.

What about the final two pieces: the + and the x? They stand for and XML, although the XML part is sometimes not really true. Plenty of Ajax applications work well without any XML code at all: They merely pass HTML or even plain text back and forth. It's probably more accurate to have the x stand for XMLHttpRequest, as you're using that object to retrieve data in the background, thereby not interfering with the display or behavior of the existing page.

Comments

Popular posts from this blog

Sewa Ruang Meeting Daerah Citarum Bandung

Sewa ruang meeting kantor, training di Bandung Hubungi 0816-4038-78. Lokasi Ruang Meeting berada di Jl.Pelajar Pejuang 45 No.23B 1. Paket per Jam      - Biaya : Rp.50.000 / org / jam     - Fasilitas : Snack & Drink 2. Paket Half-Day     - Waktu : 09.00 s/d 13.00 Wib     - Biaya : Rp.120.000 / org      - Fasilitas : Makan siang 1x, Snack & Drink 3. Paket Full Day     - Waktu : 09.00 s/d 16.00 Wib     - Biaya : Rp.170.000 / org      - Fasilitas : Makan siang 1x, Coffe break 2x, Snack & Drink 4. Lain-lain     - Sewa Proyektor : Rp.150.000/day     - Extra time : Rp.100.000/Jam Syarat dan Ketentuan : 1. Min. 3org dan Max. 7org 2. Pembayaran H-3 sebelum tgl pelaksanaan 3. Melebihi jam ketentuan dikenakan biaya tambahan Sewa Ruang Meeting Daerah Citarum Bandung Hubungi 0816-4038-78 Ruang meeting murah mulai 50.000 di Buah Batu, Pasteur, Sukajadi, Lengkong, Antapani, Uj...

reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube | www.pijat.xyz

Reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube Yang Ditemukan Pada Tautan www.pijat.xyz Adalah Update Tukang Urut Terdekat Dari Lokasi Saya Terbaru Pada Hari Ini 11 Jun 2020 Yang Terkait Dengan Pencarian Tukang Urut Terdekat Dari Lokasi Saya Mengenail Detail reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube Dan Beberapa Ulasan Lain Dari tukang Urut Terdekat Dari Lokasi Saya Sudah Menjadi Trending Populer Di Internet, Lalu Apakah Arti Atau Yang Dimaksud Dengan Reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube Seperti Yang Ditemukan Pada Website Www.pijat.xyz Dan Dimanakah Lokasi Informasi Terkait Tukang Urut Terdekat Dari Lokasi Saya ? Apakah Headline Utama Dari Tukang Urut Terdekat Dari Lokasi Saya , Trending Topik Saat Ini Atau Info Reaksi Blesteran Bule Di Pijitin Tukang Urut. - Youtube Adalah Informasi Tukang Urut Terdekat Dari Lokasi Saya Plus Plus Di Kota Anda, Silahkan Akses Detailnya Dengan Download Gratis Terkait Tukang Urut Terdekat Dari Loka...

Lowongan Trainer SEO & Internet Marketing (Freelance Bandung), Fee Rp 600 rb/ Hari

SISINDOTEK sebuah perusahaan yang bergerak di bidang IT Training & Solution Provider di Bandung membutuhkan Tenaga trainer untuk subject : Trainer SEO & Internet Marketing Bandung - Jawa Barat Requirements: D3/ S1 Jurusan Informatika (Terbuka untuk mahasiswa yang mahir SEO) Berpengalaman mengajar minimal 1 tahun atau menguasai SEO dengan baik Berdomisili di Bandung dan sekitarnya Menguasai Teknik dan metode SEO dengan baik Bisa menunjukkan prestasi atas SKILL SEO yang dimiliki (Top Rangking Google atas Blog atau Web yang pernah ditangani SEO nya) Memiliki nilai tambah jika pernah memenangkan Kontes SEO Kompensasi : Kompensasi Rp 450.000 - 700.000 / Hari (Tergantung skill, pengalaman dan sertifikasi) * Waktu mengajar : 09.00 - 17.00 diselingi 2x coffee break dan 1 x lunch selama 3 hari berturut turut. CV lengkap di kirim ke : hrd sebelum 20 Juni 2012, hanya yang memenuhi persyaratan yang akan dipanggil untuk mengikuti sesi Interview dan Test mengajar