HTML DOM getElementById()
ThumbnailsDocument OutlineAttachments
Previous
Next
Highlight allMatch case
Presentation ModeOpenPrintDownloadCurrent View
Go to First PageGo to Last Page
Rotate ClockwiseRotate Counterclockwise
Text Selection ToolHand Tool
Document Properties…
Toggle Sidebar
Find
Zoom Out
Zoom InPresentation ModeOpenPrintDownloadCurrent View
Tools
Previous
NextAutomatic ZoomActual SizePage FitPage Width50%75%100%125%150%200%300%400%
More InformationLess Information
Close
Enter the password to open this PDF file:
CancelOK
File name:
-
File size:
-
Title:
-
Author:
-
Subject:
-
Keywords:
-
Creation Date:
-
Modification Date:
-
Creator:
-
PDF Producer:
-
PDF Version:
-
Page Count:
-
Close
Preparing document for printing…
0%
Cancel
Développement de logiciels
13 déc. 2013 (il y a 7 années et 7 mois)
757 vue(s)
757
Nombre total de vues
757
Voir sur TechyLib
0
Vues depuis Embeds
0
Favoris
0
Téléchargements
Largeur: pixels
Hauteur: pixels
Après avoir fait votre sélection, copiez/collez le code ci-dessous.
Retranscription de la présentation
HTML DOM getElementById()
Method
The getElementById() method returns a
reference to the first object with the
specified ID.
Syntax
document.getElementById(id)
function getValue()
{
var x=document.getElementById("myHeader")
alert(x.innerH)
}
This is a header
Click on the header to alert its value
DHTML
http://www.midlandstech.com/edu/ed/ism/k
irkpatrick/dhtml.html
AJAX
Asynchronous JavaScript And XML
AJAX is a type of programming made popular in 2005.
AJAX is not a new programming language, but a new way to use
existing standards combining JavaScript, CSS, HTML and XML.
Asynchronous
Not synchronized; that is, not occurring at
predetermined or regular intervals. The
term asynchronous is usually used to
describe communications in which data
can be transmitted intermittently rather
than in a steady stream.
For example, a telephone conversation is
asynchronous because both parties can
talk whenever they like. If the
communication were synchronous, each
party would be required to wait a specified
interval before speaking.
http://www.webopedia.com/TERM/A/asynch
ronous.html
AJAX uses JavaScript’s capability to use a
built
-
in object, XMLHttpRequest, to
communicate with a web server without
submitting a form or loading a page. It is
supported by most modern browsers.
Client
-
side
-
JavaScript
The script creates an XMLHttpRequest
object and sends to the web server.
The server responds by sending the
contents of a file, or the output of a
server
-
side program.
When the response arrives from the
server, a JavaScript function is triggered
to act on the data.
Because the goal is a more responsive
user interface, the script usually displays
the data from the server using the DOM,
eliminating the need for a page refresh.
Server
-
Side
The server responds to the client
-
side
request by sending the contents of a file,
or the output of a server
-
side program.
Not limited to XML on the server side. Can
be a program running a language such as
PHP, Perl, ASP.net, ColdFusion or even a
static file.
JavaScript can send data to a server
-
side
program using GET or POST methods, the
same two ways and HTML form works.
In a GET request, the data is encoded in the
URL that loads the program. In a post
request, it is sent separately and can
contain more data.
Example
EW.com
poll
Limitations of AJAX
The script and the XML data or server
-
side
program it requests data from must be on
the same domain.
IE 6 uses ActiveX to implement
XMLHttpRequest. Security settings in the
browser must be set to allow ActiveX.
Older browsers don’t support
XMLHttpRequest.
Can compromise the accessibility of a site
for users with disabilities
Users unaccustomed to AJAX may have
learning curve.
AJAX is based on the XMLHttpRequest
object.
Different browsers use different methods
to create the XMLHttpRequest object.
Internet Explorer 5 and IE 6 use an Active
Object, while other browsers use the built
-
in JavaScript object called
XMLHttpRequest.
Example
http://www.midlandstech.com/edu/ed/ism
/kirkpatrick/ajax/ajaxquiz.html
Files used
Ajax.js
Questions.xml
Quiz.js
List17.4.js