473,385 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Simple Ajax for newb

i look for a simple ajax, for a beignner, able to send a request for a
text file and show its content in a <div />
thanxs in advance.

--
une bévue
Oct 2 '06 #1
6 1480
""Une bévue"" <pe*******@laponie.com.invalidwrote in message
news:1h*****************************@laponie.com.i nvalid...
i look for a simple ajax, for a beignner, able to send a request for a
text file and show its content in a <div />
http://marc.theaimsgroup.com/?l=php-...8633625636&w=2
Oct 2 '06 #2
"McKirahan" <Ne**@McKirahan.comwrote in message
news:Y9******************************@comcast.com. ..
""Une bévue"" <pe*******@laponie.com.invalidwrote in message
news:1h*****************************@laponie.com.i nvalid...
i look for a simple ajax, for a beignner, able to send a request for a
text file and show its content in a <div />
Here's an example that allows the user to refresh the time
without reloading the entire page:

<html>
<head>
<title>ajaxTime.htm</title>
<script type="text/javascript">
var i = 0;
function ajaxTime() {
var sURL = "http://tycho.usno.navy.mil/cgi-bin/timer.pl?"+i++;
var oXML = new ActiveXObject("Microsoft.XMLHTTP");
oXML.open("GET",sURL,false);
oXML.send();
var sTXT = oXML.responseText;
sTXT = sTXT.substr(sTXT.indexOf("<H2>"));
sTXT = sTXT.substr(0,sTXT.indexOf("</B>"));
document.getElementById("ajaxTime").innerHTML = sTXT;
}
</script>
</head>
<body>
<a href="javascript:ajaxTime()">What time is it?</a>
<br><br>
<div id="ajaxTime"
style="border:solid 1px black;width:480px;height:240px"
></div>
</body>
</html>

<!--
http://tycho.usno.navy.mil/cgi-bin/timer.pl
returns the following Web page:

<html>
<body>
<TITLE>What time is it?</TITLE>
<H2US Naval Observatory Master Clock Time</H2<H3>
<BR>Oct. 02, 19:04:43 UTC
<BR>Oct. 02, 03:04:43 PM EDT
<BR>Oct. 02, 02:04:43 PM CDT
<BR>Oct. 02, 01:04:43 PM MDT
<BR>Oct. 02, 12:04:43 PM PDT
<BR>Oct. 02, 11:04:43 AM AKDT
<BR>Oct. 02, 09:04:43 AM HAST
</H3></B><P><A HREF="http://tycho.usno.navy.mil">
Time Service Department, US Naval Observatory</A>

</body></html>

the following is extracted and displayed:

<H2US Naval Observatory Master Clock Time</H2<H3>
<BR>Oct. 02, 19:04:43 UTC
<BR>Oct. 02, 03:04:43 PM EDT
<BR>Oct. 02, 02:04:43 PM CDT
<BR>Oct. 02, 01:04:43 PM MDT
<BR>Oct. 02, 12:04:43 PM PDT
<BR>Oct. 02, 11:04:43 AM AKDT
<BR>Oct. 02, 09:04:43 AM HAST
</H3>
-->
Oct 2 '06 #3
McKirahan <Ne**@McKirahan.comwrote:
http://marc.theaimsgroup.com/?l=php-...8633625636&w=2
ok, thanks, i get it !
--
une bévue
Oct 2 '06 #4
"Une bévue" wrote:
i look for a simple ajax, for a beignner, able to send a request for a
text file and show its content in a <div />
http://www.AjaxToolbox.com

I think the interface I've created is quite straight-forward, and there are
a number of examples on the site.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Oct 2 '06 #5
Matt Kruse <ne********@mattkruse.comwrote:
>
http://www.AjaxToolbox.com

I think the interface I've created is quite straight-forward, and there are
a number of examples on the site.
great, thanks !
--
une bévue
Oct 2 '06 #6
McKirahan <Ne**@McKirahan.comwrote:
Here's an example that allows the user to refresh the time
without reloading the entire page:
fine thanks !
--
une bévue
Oct 2 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bart van Deenen | last post by:
Hi All I'm happily creating an Ajaxified web-app. I use Prototype for encapsulating xml http requests, with method "post". On the backend, I use PHP, and the replies are eval'd by Javascript. I...
2
by: Alex | last post by:
Example uploaded to: http://www.clickatus.com/ajax/ BTW - This is for FIREFOX, won't work in IE. I don't know why but when it is executed the browser still in loading state... Even though...
7
by: Ivan Marsh | last post by:
Hey Folks, I'm having a heck of a time wrapping mind around AJAX. Anyone know of a simple, straight-forward example for pulling a simple query from mysql with PHP using AJAX? As I...
6
by: issac | last post by:
Hi folks Im trying to do a simple query involving the distinct keyword and an access 2000 db, but have been frittering with it for amost and hour and a half and I cant make it work. This is...
1
by: www.web20developers.com | last post by:
http://www.web20developers.com http://www.web20developers.com/index.php?option=com_content&task=view... Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell AJAX -...
1
by: Boris Twila | last post by:
I just want to have 1 drop down list fill the other drop down list without a round trip. Is there some really simple ajax thing i can copy and use, or is it a big deal do i habe to install an...
0
by: minnie | last post by:
An AJAX Simple Example for PHP Article from http://www.joyistar.com Introduction: AJAX WebShop 3 Beta2 supports PHP programming by integrating PHP5 development environment. Here we will give an...
0
by: darrel | last post by:
I was playing with AJAX a bit last year but never really took the time to fully analyze the various AJAX libraries out there for ASP.net 1.1 We're finally using 2.0, so have begun playing with...
4
by: themadjester | last post by:
Simple newb question here. Ok, so I am making a simple site. I wrote some HTML and made a CSS for it. Now, I know the point of the style sheets is to save me work re-doing all of the styles for...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
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...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.