Well, we often have very nice website and good systems but with the old fashioned design, ie, with programming that makes each link is loaded again we have to reload the entire page, AJAX allows us to do loads of parts of code without having to reload Full page and delays and inconvenience that this creates.
Friday, February 6, 2009
Riddell Speed Facemasks
Xelupload Some AJAX with ASP's quote Knowledge
Well, we often have very nice website and good systems but with the old fashioned design, ie, with programming that makes each link is loaded again we have to reload the entire page, AJAX allows us to do loads of parts of code without having to reload Full page and delays and inconvenience that this creates.
Well, we often have very nice website and good systems but with the old fashioned design, ie, with programming that makes each link is loaded again we have to reload the entire page, AJAX allows us to do loads of parts of code without having to reload Full page and delays and inconvenience that this creates.
Here I show you a very basic but functional as using this technology in our pages, and depends on the creativity of each person's use are given.
To implement this we need to identify 3 things, a. JS AJAX call, the second of a button, link, form or part that could call a Javascript function, and third, a DIV which will display the result, he explained each .
First and foremost we need the file. JS which I put here
ajax_loader.js
for download, which will call on our page as well: \u0026lt;script src = "ajax_loader.js" type = "text / javascript"> \u0026lt;/ script>
This within tags \u0026lt;head> \u0026lt;/ head>
After the method need to call the function that performs the magic of the matter in this case will a SELECT with a code like this: \u0026lt;select name = "test" onchange = "HTMLData ('
ajax.asp
', ' result', ' send =' + this.value) "> \u0026lt;option value="1"> OPTION 1 \u0026lt;/ option> \u0026lt;option value="2"> OPTION 2 \u0026lt;/ option> \u0026lt;option
value="3"> OPTION 3 \u0026lt;/ option>
\u0026lt;/ select> \u0026lt;div id="
result "> \u0026lt;/ div>
Where what is in bold is what needs to change as the case: ajax.asp
: is the file that processes the information to publish
result is the name of the DIV which show send = '+ this .
value: it is where we put information to be sent using the GET method as that used in forms may be different, we must consider is the information we receive the file and that will be used for information to be processed, another example would be something like a = 1 & b = 2 & c = 3 in the above example takes the value of SELECT using some JavaScript. short:
- is necessary to generate and embed the file.
JS ajax_loader.js
- Add the code to call the function HTMLData ()
within any system that allows - Generate ASP file that will process the information sent in the previous function, in the example is ajax.asp
.
can see an example here
. In the example of the site is used the following codes:
ejemplo_ajax.asp
PAGE (Wrapper script and SELECT)
\u0026lt;! DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Transitional / / EN" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd "> \u0026lt;html xmlns="http://www.w3.org/1999/xhtml">
\u0026lt;head>
\u0026lt;meta http-equiv =" Content-Type "content = "text / html; charset = utf-8" />
\u0026lt;title> AJAX \u0026lt;/ title> \u0026lt;script src="ajax_loader.js"
type="text/javascript"> \u0026lt;/ script>
\u0026lt;/ head>
\u0026lt;form
\u0026lt;body>
action="javascript:void%200">
\u0026lt;select name = "test" onchange = "HTMLData ('ajax.asp', 'result', 'sample = HI & test = '+ this.value) ">
\u0026lt;option value=""> SELECT AN OPTION \u0026lt;/ option> \u0026lt;option value="1">
OPTION 1 \u0026lt;/ option>
\u0026lt;option value = "2"> Option 2 \u0026lt;/ option> \u0026lt;option value="3">
OPTION 3 \u0026lt;/ option>
\u0026lt;/ select>
\u0026lt;/ form> \u0026lt;div
id="resultado"> ORIGINAL TEXT \u0026lt;/ div> \u0026lt;br /> \u0026lt;br />
\u0026lt;% = now ()%>
\u0026lt;/ body>
\u0026lt; ; / html> PAGE
ajax.asp
(The one that processes the info to be published)
\u0026lt;% Response.Charset = "ISO-8859-1"
Response.AddHeader "pragma", "no -cache "
Response.CacheControl =" Private "
Response.Expires = 0 sample = Request.QueryString (" sample ")
test = Request.QueryString (" test ")
if test = "" then response.write
"NO CHOICE HAS NOTHING"
else response.write "SAMPLE:" & shows & "\u0026lt;br>"
response.write "option selected:" & test & , "\u0026lt;br> \u0026lt;br>"
response.write now ()
end if%>
really is something that is moving much I use technology for the agility that gives our systems I hope the explanation has been clear and I can prove it.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment