Hi all,
i am new to AJAX, so need some help
I want to create simple feedback (comment) form, base on AJAX.
So, I have my HTML form, and even have my SQL database, and PHP script.
All is working quite ok, but I need to make it AJAX - the main reason is, that I DONT NEED PAGE TO BE RELOADED.
What can You suggest?
If needed, I will post all the codes here.
Thx.
3 1745
First of all, read up on AJAX - see links in Offsite Links sticky thread.
Presumably, you'll want to make a POST request. The tutorials (or some of them at least) explain this very well.
If you get stuck, post your javascript code.
Hi all,
i am new to AJAX, so need some help
I want to create simple feedback (comment) form, base on AJAX.
So, I have my HTML form, and even have my SQL database, and PHP script.
All is working quite ok, but I need to make it AJAX - the main reason is, that I DONT NEED PAGE TO BE RELOADED.
What can You suggest?
If needed, I will post all the codes here.
Thx.
If you are new then read w3.org for the ajax details. Underatand the basic concepts and apply after that. I am using ajax in my projects. It also
creats some problems. For initial code wait for one ot two days. I will be posting it.
If you are new then read w3.org for the ajax details. Underatand the basic concepts and apply after that. I am using ajax in my projects. It also
creats some problems. For initial code wait for one ot two days. I will be posting it.
-------------------------
write the following code and save as ajaxtest.html . create another file and write some text there and save as test1.html . now run ajaxtest.html from a server. a button will appear on browser. click it you will get the text written in the test1.html file at the div tag without refreshing the browser. Test it with some images you will feel the difference. -
-
-
<html>
-
<head>
-
<title>Ajax at work</title>
-
-
<script language = "javascript">
-
-
-
var httpObj = false;
-
-
if (window.XMLHttpRequest)
-
{
-
httpObj = new XMLHttpRequest();
-
}
-
else if (window.ActiveXObject)
-
{
-
httpObj = new ActiveXObject("Microsoft.XMLHTTP");
-
}
-
-
-
-
-
function getData(dataSource, divID)
-
{
-
if(httpObj)
-
{
-
var obj = document.getElementById(divID);
-
httpObj.open("GET", dataSource,true);
-
httpObj.onreadystatechange = function()
-
{
-
if (httpObj.readyState == 4 && httpObj.status == 200)
-
{
-
obj.innerHTML = httpObj.responseText;
-
-
}
-
}
-
httpObj.send(null);
-
}
-
}
-
</script>
-
</head>
-
<body>
-
<H1>Fetching data with Ajax</H1>
-
-
<form>
-
-
<input type="button" value="Display Message" onmouseover='getData("test1.html","targetDiv")'>
-
-
</form>
-
-
<div id="targetDiv">
-
<p>The fetched data will go here.</p>
-
</div>
-
</body>
-
</html>
-
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Steve |
last post by:
I need to build a very dynamic client and would be interested in knowing the pros and
cons of using JSF and Ajax to accomplish this.
Thanks.
Steve
|
by: Tony |
last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET
distribution - I'm pretty concerned about this. Does anyone know if this
is the same "prototype.js" that is not well-liked...
|
by: gamernaveen |
last post by:
Hey guys , am just getting into the AJAX scene and am a noob.
I am really worried about Ajax upload , cant figure it out.
I have a basic html form , like this
<form action="upload.php"...
|
by: Tim Johnson |
last post by:
I'm an experienced web/CGI programmer, but new to ajax.
I'd like to review some examples of how to post data from a
form to server using AJAX. I have already created some examples
successfully...
|
by: Mark B |
last post by:
This is my first try at using AJAX. I want the calendars to be enabled if
the user checks CheckBox1. It works OK for a normal all page refresh but
once I introduced the AJAX code it stopped...
|
by: RichB |
last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am
trying to add a tabbed control to the page.
I have no problems within the aspx file, and can dynamically manipulate a...
|
by: Peter |
last post by:
ASP.NET 2.0
I have an AutoCompleteExtender which works fine- I am using name, id pair in
the WebService , but what I am trying to do is: once the user selects an
item from the...
|
by: ToddFur |
last post by:
I see several postings on this but I am still unable to figure out my problem. I can pass the values of my text field but not radio button (or even checkboxes).
My PHP file
<?php
//declare...
|
by: mike57 |
last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers.
...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |