Blogroll

photoshop cs6 html 5 css php seo backlinks

adsense

Monday, 24 February 2014

How AJAX Loading Web Content from Links?

Ajax Tutorial: In this practice, we try build links in page. Then, from that links we call web content. This is basic and simple way to use ajax in our web. From this practice, we can see how ajax works.
We will modify from previous practice. Ok, open test.php, replace with following code:
01<html>
02<head>
03    <SCRIPT language="JavaScript" SRC="ajax.js"></SCRIPT>
04</head>
05<body onload="callAJAX('home.html','displaydiv')"><b>
06<a href="#" onclick="callAJAX('home.html','displaydiv')">Home</a>
07<a href="#" onclick="callAJAX('news.html','displaydiv')">News</a>
08<a href="#" onclick="callAJAX('about.html','displaydiv')">About</a></b>
09<table>
10<tr>
11<td id="displaydiv"></td>
12</tr>
13</table>
14 
15</body>
16</html>
Create "news.html", enter following test code:
1news page test
Create "about.html" enter following test code:
1about page test
Now, point your browser to http://localhost/test/ajax/test.php. Try click link.

0 comments:

Post a Comment