feedburner

Enter your email to subscribe to articles:

Delivered by FeedBurner

Simulation of Artificial AJAX

Label:

Hi all colleagues, this time I will share knowledge about the world of ya but web programming. This time I will discuss about the AJAX simulation but could not use AJAX. Qo Why? Is not it funny?
We will make our current simulation as data input. So Click the Save button, then what we are typing in the Input Text will appear at the bottom of an area without doing the refresh page.

If you're still curious, please try the tutorial below:


1. We create a php file named index.php which more or less like the script below.


<html>
<body>
<div id="menu">
<form action="proses.php" target="myiframe">
<input type="text" name="kata">
<input type="submit" value="Simpan">
</form>
</div>
<div id="isi"></div>
<iframe name="myiframe" style="display:none;"></iframe>

</body></html>

2. Create another file named script proses.php more or less as follows ..

<div id="data">
<?php
echo $_GET['kata'];
?>
</div>
<script language="javascript" type="text/javascript">
//--- Javascript below will move the contents of the iframe to the main document.
top.document.getElementById('isi').innerHTML=document.getElementById('data').innerHTML;

</script>


Please try .. If there is any script above is not working properly, Please leave a comment.

Please understand, this is only a simulation only. Could be developed if we has an database.


by: Ivan




Bookmark and Share


0 komentar:

:)) :)] ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} ~x( :-t b-( :-L x( =))

Post a Comment