javascript - ajax - Ajax vs document.getElementById().innerHTML -
i new ajax , web development in general. when googled ajax, lot of sites (like here) said 1 of key features or ajax can dynamically update content on webpage without reloading it.
my question this: can't using document.getelementbyid("...").innerhtml = "whatever want change to"
? know ajax can make requests webserver , whatnot. not question. question why people claim changing webpage without reloading special ajax when can normal javascript?
and also, in link above, said ajax can "request/receive data server - after page has loaded". why "after page has loaded"? there way request/recieve data server while page still loading?
thank you!
my question this: can't using document.getelementbyid("...").innerhtml = "whatever want change to"?
you can indeed change inner markup of dom element instances using property.
i know ajax can make requests webserver , whatnot. not question. question why people claim changing webpage without reloading special ajax when can normal javascript?
javascript client side. ajax special in requests data server can use in client (javascript). javascript (understand, without xmlhttprequest
object) not allow that. can client side dom manipulation, not knowing what's on server side (which means, among other things, no access shared databases)
and also, in link above, said ajax can "request/receive data server - after page has loaded". why "after page has loaded"? there way request/recieve data server while page still loading?
yes.
jsp, php, 2 examples of server side languages. when request http://page.php (for example), server routes request *.php interpreter. code inside page used generate http headers , html content client. round trip happens every time page accessed. page first loaded using system. ajax allows proceed subsequent calls php script, while page loaded.
Comments
Post a Comment