Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
AJAX and PHP: Building Responsive Web Applications
AJAX and PHP: Building Responsive Web Applications

AJAX and PHP: Building Responsive Web Applications: Enhance the user experience of your PHP website using AJAX with this practical tutorial featuring detailed case studies

eBook
$15.99 $22.99
Paperback
$38.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

AJAX and PHP: Building Responsive Web Applications

Chapter 2. Client-Side Techniques with Smarter JavaScript

It is said that one picture is worth a thousand words. And so is a well-written piece of code, we would say. You will get plenty of both, while building the foundations for your future AJAX‑enabled applications, in this chapter and the next.

Hopefully, the first chapter has developed your interest in AJAX well enough that you will endure a second chapter with lots of theory to be learned. On the other hand, if you found the first exercise too challenging, be assured that this time we will advance a bit slower. We will learn the theory in parts by going through many short examples. In this chapter, we will meet client AJAX technologies, which include:

  • JavaScript

  • The JavaScript DOM

  • Cascading Style Sheets (CSS)

  • The XMLHttpRequest object

  • Extensible Markup Language (XML)

You will learn how to make these components work together smoothly, and form a strong foundation for your future AJAX applications. You will see how to implement efficient...

JavaScript and the Document Object Model


As mentioned in Chapter 1, JavaScript is the heart of AJAX. JavaScript has a similar syntax to the good old C language. JavaScript is a parsed language (not compiled), and it has some Object‑Oriented Programming (OOP) capabilities. JavaScript wasn’t meant for building large powerful applications, but for writing simple scripts to implement (or complement) a web application’s client-side functionality (however, new trends are tending to transform JavaScript into an enterprise-class language—it remains to be seen how far this will go).

JavaScript is fully supported by the vast majority of web browsers. Although it is possible to execute JavaScript scripts by themselves, they are usually loaded on the client browsers together with HTML code that needs their functionality. The fact that the entire JavaScript code must arrive unaltered at the client is a strength and weakness at the same time, and you need to consider these aspects before deciding upon...

JavaScript Events and the DOM


In the next exercise, we will create an HTML structure from JavaScript code. When preparing to build a web page that has dynamically generated parts, you first need to create its template (which contains the static parts), and use placeholders for the dynamic parts. The placeholders must be uniquely identifiable HTML elements (elements with the ID attribute set). So far we have used the <div> element as placeholder, but you will meet more examples over the course of this book.

Take a look at the following HTML document:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>
<html>
  <head>
    <title>AJAX Foundations: More JavaScript and DOM</title>
  </head>
  <body>
    Hello Dude! Here’s a cool list of colors for you:
    <br/>
    <ul>
      <li>Black</li>
      <li>Orange</li>
      <li>Pink</li>
    </ul>
  &lt...

Even More DOM


In the previous exercise, you have created the list of elements by joining strings to compose a simple HTML structure. The same HTML structure can be built programmatically using the DOM. In the next exercise, you will generate this content programmatically:

<div id=”myDivElement”>
  Hello Dude! Here’s a cool list of colors for you:
  <br/>
  <ul>
    <li>Black</li>
    <li>Orange</li>
    <li>Pink</li>
  </ul>
</div>

A DOM document is a hierarchical structure of elements, where each element can have one or more attributes. In this HTML fragment, the single element with an attribute is <div>, which has an attribute called id with the value myDivElement. The root node that you can access through the document object is <body>. When implementing the above HTML document, you will end up with a structure such as the one in the figure below:

Figure 2.3: A Hierarchy of HTML Elements

In Figure 2.3, you see an...

JavaScript, DOM, and CSS


CSS (Cascading Style Sheets) is certainly a familiar term for you. CSS allows setting formatting options in a centralized document that is referenced from HTML files. If the job is done right, and CSS is used consistently in a website, CSS will allow you to make visual changes to the entire site (or parts of the site) with very little effort, just by editing the CSS file. There are many books and tutorials on CSS, including the free ones you can find at http://www.w3.org/Style/CSS/ and http://www.w3schools.com/css/default.asp. Although the article that invented the name AJAX (http://www.adaptivepath.com/publications/essays/archives/000385.php) mentions CSS as one of the AJAX ingredients, technically CSS is not required to build successful dynamic web applications. However, its usage is highly recommended because of the significant benefits it brings.

We will do a simple exercise to demonstrate using CSS, and manipulating HTML elements’ styles using the DOM. These...

Using the XMLHttpRequest Object


XMLHttpRequest is the object that enables the JavaScript code to make asynchronous HTTP server requests. This functionality allows you to make HTTP requests, receive responses, and update parts of the page completely in the background, without the user experiencing any visual interruptions. This is very important because one can keep the user interface responsive while interrogating the server for data.

The XMLHttpRequest object was initially implemented by Microsoft in 1999 as an ActiveX object in Internet Explorer, and eventually became de facto standard for all the browsers, being supported as a native object by all modern web browsers except Internet Explorer 6.

Note

Note that even if XMLHttpRequest has become a de facto standard in the web browsers, it is not a W3C standard. Similar functionality is proposed by the W3C DOM Level 3 Load and Save specification standard, which hasn’t been implemented yet by web browsers.

The typical sequence of operations...

Working with XML Structures


XML documents are similar to HTML documents in that they are text-based, and contain hierarchies of elements. In the last few years, XML has become very popular for packaging and delivering all kinds of data.

Incidentally, XML puts the X in AJAX, and the prefix in XMLHttpRequest. However, once again, note that using XML is optional. In the previous exercise, you created a simple application that made an asynchronous call to the server, just to receive a text document; no XML was involved.

Note

XML is a vast subject, with many complementary technologies. You will hear people talking about DTDs, schemas and namespaces, XSLT and XPath, XLink and XPointer, and more. In this book we will mostly use XML for transmitting simple structures of data. For a quick-start introduction to XML we recommend http://www.xmlnews.org/docs/xml-basics.html. If you don’t mind the ads, http://www.w3schools.com/xml/default.asp is a good resource as well. Appendix C available at http://ajaxphp...

Summary


This chapter walked you through many fields. Working with HTML, JavaScript, CSS, the DOM, XML, and XMLHttpRequest is certainly not easy to start with, especially if some of these technologies are new to you. Where you don’t feel confident enough, have a look at the aforementioned resources. When you feel ready, proceed to Chapter 3, where you will learn how to use PHP and MySQL on the server, and make them interact nicely with the AJAX-enabled client.

Left arrow icon Right arrow icon

Key benefits

  • Build a solid foundation for your next generation of web applications
  • Use better JavaScript code to enable powerful web features
  • Leverage the power of PHP and MySQL to create powerful back-end functionality and make it work in harmony with the smart AJAX client
  • Go through numerous case studies that demonstrate how to implement AJAX-enabled features in your site such as: real-time form validation, online chat, suggest & autocomplete, whiteboard, SVG realtime charting, whiteboard, web data grid, RSS reader, drag & drop

Description

Assuming a basic knowledge of PHP, XML, JavaScript and MySQL, this book will help you understand how the heart of AJAX beats and how the constituent technologies work together. After teaching the foundations, the book will walk you through numerous real-world case studies covering tasks you'll be likely to need for your own applications: Server-enabled form-validation page Online chat collaboration tool Customized type-ahead text entry solution Real-time charting using SVG Database-enabled, editable and customizable data grid RSS aggregator application A server-managed sortable list with drag&drop support using the script.aculo.us JavaScript toolkit The appendices guide you through installing your working environment, using powerful tools that enable debugging, improving, and profiling your code, working with XSLT and XPath. From the Author, Cristian Darie AJAX and PHP: Building Responsive Web Applications is mainly a book for beginners, but when designing its contents we tried to find the ideal blend of topics that would help both novice and experienced web developers make a big step forward. One customer was very kind to let us know, through a review, that we succeeded: "The theory behind all the technologies used is very clearly explained, without boring you with details about obvious things. Right from the first chapter you start learning by examples. The examples can be easily adapted to many web projects and they cover stuff that is both useful and fun." Here are a few examples of such "useful and fun" things that you can find in this book: details on using proxy scripts to work around the security measures in modern browsers client-side and server-side code that doesn't break when fed with special characters (such as <, ", etc) code that works efficiently with Internet Explorer 5, 6 and 7, Firefox, Opera, Safari, and others a very quick introduction to SVG, the new rebel kid of the web (and of the house) client-server communication based on message queues that guarantee that your messages aren't lost on the way, and arrive in the intended order at the destination server-side state management techniques that use query string parameters and database records to keep track of your client's activity simple yet effective error-handling structures that combine JavaScript code and PHP code to report when something bad happens on the client or on the server a live errata page that is updated as soon as anyone reports a suggestion or a correction a friendly AJAX tutorial and many case studies that teach you how to use JavaScript, PHP, MySQL and XML together in order to achieve wonderful results The book's authors and the publisher are listening to your feedback, and appreciate when you invest some time to let them know what you think. The first result of this collaboration is an updated version of the AJAX Chat case study that uses (and teaches) JSON instead of XML. Find this new chapter in the code download or on my website. Thanks for reading such a long message. Have fun!" Cristian Darie.

Who is this book for?

This book is for web developers willing to build better web applications. A basic knowledge of PHP, XML, JavaScript and MySQL, or a strong will to learn-as-you-type, is assumed.

What you will learn

  • Chapter 1: AJAX and The Future Of Web Applications is an initial incursion into the world of AJAX and the vast possibilities it opens up for web developers and companies, to offer a better experience to their users. In this chapter you ll also build your first AJAX-enabled web page, which will give you a first look of the component technologies. You can read this chapter in full, for free, here: http://ajaxphp.packtpub.com/1825_01_Final.pdf
  • View AJAX and the Future of Web Applications Demo: http://ajaxphp.packtpub.com/ajax/quickstart/
  • Chapter 2: Client-Side Techniques with Smarter JavaScript will guide you through the technologies you""ll use to build AJAX web clients, using JavaScript, DOM, the XMLHttpRequest object, and XML. While not being a complete tutorial for these technologies, you""ll be taken to the right track of using them together to build a solid foundation for your future applications.
  • Chapter 3: Server-Side Techniques with PHP and MySQL completes the theory foundation by presenting how to create smart servers to interact with your AJAX client. You""ll learn various techniques for implementing common tasks, including handling security and error handling problems.
  • Chapter 4: AJAX Form Validation guides you through creating a responsive, modern form with real-time validation based on server data. View AJAX Form Validation Demo: http://ajaxphp.packtpub.com/ajax/validate/
  • Chapter 5: AJAX Chat presents a simple online chat that works exclusively using AJAX code, without Java applets, Flash code, or other specialized library, as most chat applications work these days. Chapter 5 has now been updated to cover JSON. You can read the chapter in full, for free, here: www.PacktPub.com/files/Ajax_Chat_and_JSON.pdf
  • View AJAX Chat Demo: http://ajaxphp.packtpub.com/ajax/chat/
  • Chapter 6: AJAX Suggest and Autocomplete builds a Google-suggest like feature, that helps you find PHP functions, and forward you to the official help page for the chosen function. View AJAX Suggest and Autocomplete demo: http://ajaxphp.packtpub.com/ajax/suggest/
  • Chapter 7: SVG (Scalable Vector Graphics) is a text-based graphics language that can be used to draw shapes and text. (SVG is supported natively by Firefox 1.5, and requires a SVG plugin with other browsers). In this case study you learn how to implement a realtime charting solution with AJAX and SVG. View SVG Demo here: http://ajaxphp.packtpub.com/ajax/svg_chart/
  • Chapter 8: AJAX Grid teaches you how to build powerful updatable data grid. You""ll learn how to parse XML documents using XSLT to generate the looks of your grid. View AJAX Grid Demo here: http://ajaxphp.packtpub.com/ajax/grid/
  • Chapter 9: AJAX RSS Reader uses the SimpleXML PHP library, XML and XSLT, to build a simple RSS aggregator. View AJAX RSS Reader Demo here: http://ajaxphp.packtpub.com/ajax/rss_reader/
  • Chapter 10: AJAX Drag and Drop is a demonstration of using the script.aculo.us framework to build a simple list of elements with drag&amp;drop functionality.
  • Appendix A: Configuring Your Working Environment teaches you how to install and configure the required software: Apache, PHP, MySQL, phpMyAdmin.
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 10, 2006
Length: 284 pages
Edition : 1st
Language : English
ISBN-13 : 9781904811824
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Mar 10, 2006
Length: 284 pages
Edition : 1st
Language : English
ISBN-13 : 9781904811824
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 120.97
Persistence in PHP with Doctrine ORM
$32.99
PHP Ajax Cookbook
$48.99
AJAX and PHP: Building Responsive Web Applications
$38.99
Total $ 120.97 Stars icon

Table of Contents

10 Chapters
AJAX and the Future of Web Applications Chevron down icon Chevron up icon
Client-Side Techniques with Smarter JavaScript Chevron down icon Chevron up icon
Server-Side Techniqueswith PHP and MySQL Chevron down icon Chevron up icon
AJAX Form Validation Chevron down icon Chevron up icon
AJAX Chat Chevron down icon Chevron up icon
AJAX Suggest and Autocomplete Chevron down icon Chevron up icon
AJAX Real-Time Charting with SVG Chevron down icon Chevron up icon
AJAX Grid Chevron down icon Chevron up icon
AJAX RSS Reader Chevron down icon Chevron up icon
AJAX Drag and Drop Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(20 Ratings)
5 star 80%
4 star 0%
3 star 5%
2 star 15%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Daniel Smith Mar 22, 2009
Full star icon Full star icon Full star icon Full star icon Full star icon 5
AJAX and PHP by Cristian Darie, a book that takes us on a journey through a now MUST when you develop web applications. If you are developing anything on the web platform page refreshes are a thing of the past, integrating AJAX is now a standard. This book will help give you the basics on the interaction between AJAX and PHP. This book covers the nitty gritty of JavaScript and their implementations, not using a JS Framework like Prototype.This book will give you a great background in how AJAX functions work in most of the popular frameworks and allow you to build great Web 2.0 application without the need for them. The last chapter however does talk about Drag and Drop using script.aculo.us which is built on Prototype.Some things that can be helpful in this book however include, using the Document Object Model, DOM and CSS, Charting using SVG, and AJAX RSS Readers. Good book overall if you are looking to build apps without frameworks.
Amazon Verified review Amazon
Brian Case Jul 23, 2006
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Ajax and PHP came at exactly the right time in my self-inflicted education as I am just now gaining functional literacy in OOP, Client/Server. PHP, CSS et. al..There are a lot of things to like about this book, starting with its organization. It starts off by documenting what you need to know to best use of this book. And supplies the URL/Hyperlinks to get those literacies if you don't have them. (Thank you!)It achieves a nice balance of choosing what needs to go into an appendix.It dispenses with the common irritating practice of showing code "excerpts" in favor of showing the entire script and follows each script example with a "What just happened" section that is as clear and concise as you will find anywhere.If you only buy one AJAX book, make it this one.
Amazon Verified review Amazon
Nathan Smith Apr 18, 2006
Full star icon Full star icon Full star icon Full star icon Full star icon 5
There need to be more Ajax books like this. No, let me rephrase. Rather, more of the Ajax books out there should've been like this one. I just finished reading through AJAX and PHP: Building Responsive Web Applications and it is by far my favorite book on the topic of Ajax yet. The authors of this book: Bogdan Brinzarea, Mihai Bucica, Cristian Darie and Filip Chereche'-Tosa have done a great job of keeping the topics focused and applicable.While other books I have read covered the concepts behind Asynchronous JavaScript and XML, they did so with a shotgun blast of information. While I appreciate an eclectic approach, it is irrelevant because many examples are for languages I never use. For instance, one single book might have a slew of exercises in ASP.NET and Java, with maybe a few chapters on PHP.Sure, I could install Microsoft's .NET SDK or Sun's J2EE, but the likelihood of me every either using these two platforms is pretty slim. Don't get me wrong, I'm not against Microsoft or Sun as companies. I use Windows like everyone else, and am quite fond of OpenOffice. Suffice it to say, I am a front-end designer who is familiar with PHP.There is a full gamut of examples to test out. I liked the way they list the full code in the text, in addition to offering the option of downloading it from Packt. I've read too many programming books that assume you're right there at your computer while reading. I don't know about you, but I like to take books with me to read when I can grab a spare minute here or there.Before I get into the contents of the book, let me point out a few caveats, in case you are considering purchasing it (which I would still recommend, if you're into PHP). In some of their code examples, they use XHTML 1.1. This is all well and good, but they neglect to specify content-type, meaning that it defaults back to text/html. So, while it still works just fine in a browser, it is against the W3C recommendation for how to serve various media types.XHTML 1.1 should be served only as application/xhtml+xml, so their code examples would be better off as XHTML 1.0 Strict, because they aren't making use of any of the additional features to be found by stepping up to 1.1. Another thing to correct in their code would be line-breaks, which are consistently written throughout as [br/] when really it should be [br /]. Though seemingly innocuous, that single space is important. (Note: I used square brackets in the place of angled brackets, since Amazon does not allow for HTML in their reviews.)Anyway, here is what topics are covered in the book: JavaScript and the Document Object Model, some CSS, XMLHttpRequest, proxy servers, and MySQL. They also touch on how to make use of Prototype and Script.aculo.us. Using this armament, they show you how to create fun stuff such as: live form validation, chat room (with color picker), auto-complete search, real-time SVG charts, XSLT grids, an RSS reader, plus a drag-and-drop to-do list.While some of these topics are covered in other books out there, I had not found one which covered them all from a PHP standpoint. Now that I have, I think I will probably give book reading on Ajax a rest (not REST) for awhile, because I think that with this book, I am contented. Now it's just a matter of going out there and actually making use of the topics that were covered.
Amazon Verified review Amazon
TSilver Mar 06, 2007
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good examples and techniques aside, there's opportunities to turn your investment into cash in from projects in the real world. The later chapters contain great code examples for application pieces all web developers need in their arsenal; from javascript and security tips to interface how-to including a neat drag n' drop sortable list app I enjoy using more (probably because I understand it better from the inside out) than the [...] drag n' drop code I had been tinkering around with.If you're a total newbie to AJAX and PHP this book will get your feet wet and dunk you in. If you're a PHP wiz with a good understanding of AJAX, this book will help "gel" it all together for you and add to your programming "street smarts".Even the most impatient learners will appreciated each chapter section's "Time for Action" samples which let you do stuff within the first 5 minutes of cracking the book open. (I jumped right to those sections then went back to read the other stuff if I felt I didn't understand why something worked or didn't work).
Amazon Verified review Amazon
Geoffrey E. Quelch Aug 09, 2007
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Enjoyed this book. The authors clearly understand their subject and provide useful workable code that can be used as a basis for your own projects.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela