The document discusses a lecture on AJAX and JSON. It provides an introduction to AJAX, where and how it can be used, and how to combine AJAX with JSON. It then reviews JavaScript objects and JSON, and demonstrates how to make AJAX requests with simple JavaScript. The document outlines the steps to create an XMLHttpRequest object and make asynchronous requests. It also discusses properties and methods of the XMLHttpRequest object like open(), send(), status, and readyState. Finally, it provides examples of using AJAX to fetch JSON data and display it on a page.
A three hour tutorial I gave at PHP Quebec on the challenges, theory, and concepts behind making asynchronous JavaScript calls for Web 2.0 Applications using PHP
Slick: Bringing Scala’s Powerful Features to Your Database Access Rebecca Grenier
This talk will teach you how to use Slick in practice, based on our experience at EatingWell Media Group. Slick is a totally different (and better!) relational database mapping tool that brings Scala’s powerful features to your database interactions, namely: static-checking, compile-time safety, and compositionality.
Here at EatingWell, we have learned quite a bit about Slick over the past two years as we transitioned from a PHP website to Scala. I will share with you tips and tricks we have learned, as well as everything you need to get started using Slick in your Scala application.
I will begin with Slick fundamentals: how to get started making your connection, the types of databases it can access, how to actually create table objects and make queries to and from them. We will using these fundamentals to demonstrate the powerful features inherited from the Scala language itself: static-checking, compile-time safety, and compositionality. And throughout I will share plenty of tips that will help you in everything from getting started to connection pooling options and configuration for use at scale.
Os bancos NoSQL estão cada vez mais popular no mundo do desenvolvimento de software. Os seus diversos tipos (chave valor, documentos, coluna e grafos) fazem com que a escolha do banco de dados seja algo tão crucial quanto a definição de uma linguagem de programação. Um dos grandes problemas do mundo NoSQL se refere a grande variedade e o alto impacto na mudança de um banco de dados, lock-in. Com o intuito de tornar a tecnologia ainda mais popular, além do baixo impacto na migração de um banco de dados, lock-in, nasceu o projeto JNoSQL. O JNoSQL é um projeto, da Eclipse Foundation, cujo o intuito é criar ferramentas para realizar a integração da aplicação Java com o banco não relacional.
A three hour tutorial I gave at PHP Quebec on the challenges, theory, and concepts behind making asynchronous JavaScript calls for Web 2.0 Applications using PHP
Slick: Bringing Scala’s Powerful Features to Your Database Access Rebecca Grenier
This talk will teach you how to use Slick in practice, based on our experience at EatingWell Media Group. Slick is a totally different (and better!) relational database mapping tool that brings Scala’s powerful features to your database interactions, namely: static-checking, compile-time safety, and compositionality.
Here at EatingWell, we have learned quite a bit about Slick over the past two years as we transitioned from a PHP website to Scala. I will share with you tips and tricks we have learned, as well as everything you need to get started using Slick in your Scala application.
I will begin with Slick fundamentals: how to get started making your connection, the types of databases it can access, how to actually create table objects and make queries to and from them. We will using these fundamentals to demonstrate the powerful features inherited from the Scala language itself: static-checking, compile-time safety, and compositionality. And throughout I will share plenty of tips that will help you in everything from getting started to connection pooling options and configuration for use at scale.
Os bancos NoSQL estão cada vez mais popular no mundo do desenvolvimento de software. Os seus diversos tipos (chave valor, documentos, coluna e grafos) fazem com que a escolha do banco de dados seja algo tão crucial quanto a definição de uma linguagem de programação. Um dos grandes problemas do mundo NoSQL se refere a grande variedade e o alto impacto na mudança de um banco de dados, lock-in. Com o intuito de tornar a tecnologia ainda mais popular, além do baixo impacto na migração de um banco de dados, lock-in, nasceu o projeto JNoSQL. O JNoSQL é um projeto, da Eclipse Foundation, cujo o intuito é criar ferramentas para realizar a integração da aplicação Java com o banco não relacional.
AJAX is an acronym standing for Asynchronous JavaScript and XML and this technology helps us to load data from the server without a browser page refresh.
If you are new with AJAX, I would recommend you go through our Ajax Tutorial before proceeding further.
JQuery is a great tool which provides a rich set of AJAX methods to develop next generation web application.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
2. AJAX introduction
Where t use AJAX
Combining AJAX with JSON
Review of JavaScript Object & JSON
AJAX with simple JavaScript
3. Asynchronous JavaScript and XML
Technique for creating better, faster, and more interactive web applications
Uses XHTML for content with DOM & JavaScript to display dynamic content
Traditional Page is synchronous
You submit form, hit enter and wait to be redirected to another page
AJAX is Asynchronous
Will make a background request and update the page, while you are doing other things in the
page
Where to use
Scroll a page, some of the contents will load after scroll (just like Google image search)
Do chat, after certain time pull new contents
Notifications, after certain time pull new notification
Tell that you are active; after certain time ping server with some data
When doing search, show hits; or provide some data, remaining will be filled
Use where you do not want to reload page
4. Runs on browser not Server
Not a language, can say a technique or Library
Basically Designed for XML Response
But can use any data format (plain text, XML, CSV, JSON, HTML etc)
Behind the scene, HTTP request is sent
Powerful use is in searching & forms submission, chat, notifications etc
Real Examples
Comments pull on youtube
Search hints in Google or on some site
Like option in Facebook
Next posts pull on Facebook
Cricket score updates
… and much more
5. User interface
Browser
Database
Web server
http request
HTML+CSS Data
User interface
Browser
Database
Web server
http request
XML Data
AJAX Engine
Javascript call
HTML CSS data
Classic web app model AJAX web app model
6.
7. Create XHR (XML HTTP Request) Object
Create a function that will be called when request status change
It will be a callback function
Use the data, modify the DOM or what ever you want
Set options
where to fetch/send data
what is the method
Want Asynchronous or not
What is HTTP authentication username
What is HTTP authentication password
Initiate the connection
8. var xhr = new XMLHttpRequest(); //object
//callback function
xhr.onreadystatechange = function () {
//check ready state
//check server response code, based on that use data or show error
};
//set request parameters
xhr.open(method, url, [asyn/synch, username, pwd]);
//e.g. xhr.open(“GET”, “http://uet.edy.pk”, true);
//call it on some event
xhr.send();
9. abort()
Cancel current request
getAllResponseHeaders()
Get all headers as string
getResponseHeader(headerName)
Get all specific headers
open(method, url, async, username, pwd)
Specify options
PUT, DELETE may not possible
send(contents)
Sent the request
setRequestHeader(header, value)
Add header to be sent to server
10. status
Response status code e.g 200, 404 etc
statusText
Response status text e.g. OK, Not Found etc
readyState
Information about the current request object (it is a number 0-4)
onreadystatechange
An event handler that is fired at every state change
responseText
Response as a string
responseXML
Response as XML
11. readyState property defines current state of XMLHttpRequest object
State Description
0 Request is not initialized
- Created object but not called open yet
1 Request has been setup
- after open has been called but sent not called yet (connected to server)
2 Request has been sent
- After send has been called
3 Request is in process
- browser established a communication but before server completed
response
4 Request has been completed
- request completed, all the response received, data ready
12. AJAX not supported by Old browsers
All modern browsers (Chrome, IE7+, Firefox, Safari, and Opera)
have a built-in XMLHttpRequest object
Variable = new XMLHttpRequest();
Old versions of Internet Explorer (IE5 and IE6) use an ActiveX
Object
variable = new ActiveXObject("Microsoft.XMLHTTP");
var xhttp;
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
14. Java
Script
Object
Notation
var objectname = {
property: value,
property:value
};
Will be
{
“property”:value,
“property”:value,
}
var fish= {
name: “tuna”,
weight:150,
color: “black & gray”
};
?
{
“name”: “tuna”,
“weight”:150,
“color”: “black & gray”
}
Just like so mixed objects
This data could be in new file with
json extension
15. Currently we are fetching static contents
hold until we get our hands on PHP
You are provided a folder
Place it in www dir of WAMP
Create a copy of sample page
Create a button, define onclick event and do following
Fetch lect7/data/foods/fruits.json and display using AJAX
List the fruits
Create a copy of sample page
Create a button, define onclick event and do following
Fetch lect7/data/animals/birds_antarctica.json and display using AJAX
Family as h2 and members are as unordered list
Problem
JSON not turning to object
jsonObject = JSON.parse(jsonString);
jQuery.parseJSON( jsonString );
16. Create a copy of sample page
Create a button, define onclick event and do following
Fetch lec7/data/story.txt and display in a div using AJAX
Do same for to get lec7/data/story.html and display in new div
Create new div & do following
Create a button, define onclick event and do following
Fetch lec7/data/story.json and display in a div using AJAX
Title in h1, author in h3, description in italic & story text simple in each line
Fetch lect7/data/colors/web_colors.json
Show it in table having one column
and each row background is hex color given & contents are color name
Fetch lect7/data/colors/palettes.json
Show it in table having four column
and each cell background is hex color given & contents are color code
Fetch lect7/data/foods/vegetable_cooking_times.json
Show detail
17. Represent RCET, UET, KSK in JSON with following details. Use AJAX to get data
and display on the page
Departments (array)
Each department having name, hod name, faculty list (each faculty name, qualification),
no of students in each session
Cafeteria (array) with list of food items each item having category, served
weight and price
Playgrounds (array) with description, area
Hostels (array) with name, warden, rooms (array) with each room resident
name
Represent your time table in JSON
Use AJAX to show it just like time table
* Separate the data that you were changing in the last assignment
Create some json files having some data in same format, name of file is vourcherno
When you change the voucher no use AJAX to get data related to that voucherno & show
18. Is there a batter way to create HTML with JavaScript
Yes! But We used string concatenation
See Handlebars.js
Practice with given JSON files