473,467 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Ajax example

This is supposed ot be an example:

http://www.ajaxtutorial.net/index.ph...totype-part-2/

It says :

This example is probably the simplest example you will ever find.
We are going to use the prototype feature ‘ajax.Updater’ (see part one
for more details on prototype).

ajax.Updater allows you to specify an element ID and script URL - and
whatever the script URL prints will appear in your element ID. Simple as
that.

I would love to see such an example. Unfortunately, there is no example
on that page.

Does anyone know where there is such an example ?
Jan 2 '07 #1
25 2744
meltedown wrote:
This example is probably the simplest example you will ever find.
I would love to see such an example. Unfortunately, there is no example on
that page.

Does anyone know where there is such an example ?
Besides the simple examples on Ajax.Updater's home page?

http://wiki.script.aculo.us/scriptac...w/Ajax.Updater

That is Google's first citation for "Ajax.Updater"...

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Jan 2 '07 #2
Phlip wrote:
meltedown wrote:
>This example is probably the simplest example you will ever find.
>I would love to see such an example. Unfortunately, there is no example on
that page.

Does anyone know where there is such an example ?

Besides the simple examples on Ajax.Updater's home page?

http://wiki.script.aculo.us/scriptac...w/Ajax.Updater

That is Google's first citation for "Ajax.Updater"...
Where's the example ?
Jan 2 '07 #3
meltedown wrote:
Phlip wrote:
>meltedown wrote:
>>This example is probably the simplest example you will ever find.
>>I would love to see such an example. Unfortunately, there is no
example on that page.

Does anyone know where there is such an example ?

Besides the simple examples on Ajax.Updater's home page?

http://wiki.script.aculo.us/scriptac...w/Ajax.Updater

That is Google's first citation for "Ajax.Updater"...

Where's the example ?
Eh?

In the middle of the page at the link above?
Clearly marked with a green "Examples" heading?
--
Dag.

Listen to your brain - it has a lot of information.
(Chelsey, 7) -
Jan 2 '07 #4
Dag Sunde wrote:
meltedown wrote:
>Phlip wrote:
>>meltedown wrote:

This example is probably the simplest example you will ever find.
I would love to see such an example. Unfortunately, there is no
example on that page.

Does anyone know where there is such an example ?
Besides the simple examples on Ajax.Updater's home page?

http://wiki.script.aculo.us/scriptac...w/Ajax.Updater

That is Google's first citation for "Ajax.Updater"...
Where's the example ?

Eh?

In the middle of the page at the link above?
Clearly marked with a green "Examples" heading?

I see where it says "Examples" but there is no example, only code snippets.
The example should look like this : a form with a text field. When you
add text to the field, the text appears on the page.

Jan 2 '07 #5
meltedown wrote:
Dag Sunde wrote:
>meltedown wrote:
>>Phlip wrote:
meltedown wrote:

This example is probably the simplest example you will ever find.
I would love to see such an example. Unfortunately, there is no
example on that page.
>
Does anyone know where there is such an example ?
Besides the simple examples on Ajax.Updater's home page?

http://wiki.script.aculo.us/scriptac...w/Ajax.Updater

That is Google's first citation for "Ajax.Updater"...
Where's the example ?

Eh?

In the middle of the page at the link above?
Clearly marked with a green "Examples" heading?


I see where it says "Examples" but there is no example, only code
snippets. The example should look like this : a form with a text
field. When you add text to the field, the text appears on the page.
You're kidding, right?

it isn't a tutorial on how to make a form post a textfield to
some serverside script, neither a tutorial on how to make serverside
script that returns some text bak to you.

You surely know how to do the two things above?

It show you an example how to use that particular function
to update an element with the response of a given serverside script.

--
Dag.

Listen to your brain - it has a lot of information.
(Chelsey, 7) -
Jan 2 '07 #6
Dag Sunde wrote:
meltedown wrote:
>Dag Sunde wrote:
>>meltedown wrote:
Phlip wrote:
meltedown wrote:
>
>This example is probably the simplest example you will ever find.
>I would love to see such an example. Unfortunately, there is no
>example on that page.
>>
>Does anyone know where there is such an example ?
Besides the simple examples on Ajax.Updater's home page?
>
http://wiki.script.aculo.us/scriptac...w/Ajax.Updater
>
That is Google's first citation for "Ajax.Updater"...
Where's the example ?
Eh?

In the middle of the page at the link above?
Clearly marked with a green "Examples" heading?

I see where it says "Examples" but there is no example, only code
snippets. The example should look like this : a form with a text
field. When you add text to the field, the text appears on the page.

You're kidding, right?

it isn't a tutorial on how to make a form post a textfield to
some serverside script, neither a tutorial on how to make serverside
script that returns some text bak to you.

You surely know how to do the two things above?
I can make a form, but I don't know how to use ajax to update text on a
page. There's lots of examples where the results are put into an alert
box, but I've never seen one where the result appears on the page
without reloading the page.

>
It show you an example how to use that particular function
to update an element with the response of a given serverside script.
No it doesn't. It shows the code, but there is no working example.
>
Jan 2 '07 #7
meltedown said the following on 1/2/2007 5:50 AM:
Dag Sunde wrote:
<snip>
>You're kidding, right?

it isn't a tutorial on how to make a form post a textfield to
some serverside script, neither a tutorial on how to make serverside
script that returns some text bak to you.

You surely know how to do the two things above?

I can make a form, but I don't know how to use ajax to update text on a
page.
You don't use "ajax" to update the page. You use ajax to retrieve the
data from the server. Then, you use that response and update the page.
Check the group FAQ for DynWrite (see my signature) for a function that
will update the page.
There's lots of examples where the results are put into an alert
box, but I've never seen one where the result appears on the page
without reloading the page.
Instead of alert('something') you do
document.getElementById('someID').innerHTML = 'something';, or, you
DynWrite it.
>It show you an example how to use that particular function
to update an element with the response of a given serverside script.

No it doesn't. It shows the code, but there is no working example.

If you can't take code from the manual and make it work, you need a
different approach.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 2 '07 #8
Randy Webb wrote:
meltedown said the following on 1/2/2007 5:50 AM:
>Dag Sunde wrote:

<snip>
>>You're kidding, right?

it isn't a tutorial on how to make a form post a textfield to
some serverside script, neither a tutorial on how to make serverside
script that returns some text bak to you.

You surely know how to do the two things above?

I can make a form, but I don't know how to use ajax to update text on
a page.

You don't use "ajax" to update the page. You use ajax to retrieve the
data from the server. Then, you use that response and update the page.
Check the group FAQ for DynWrite (see my signature) for a function that
will update the page.
>There's lots of examples where the results are put into an alert box,
but I've never seen one where the result appears on the page without
reloading the page.

Instead of alert('something') you do
document.getElementById('someID').innerHTML = 'something';, or, you
DynWrite it.
>>It show you an example how to use that particular function
to update an element with the response of a given serverside script.

No it doesn't. It shows the code, but there is no working example.


If you can't take code from the manual and make it work, you need a
different approach.
I don't understand why I can't just ask for a working example without
all the snarky responses. If there is no working example of what I'm
asking for, fine, but that's what I'm looking for.
Jan 2 '07 #9
meltedown said the following on 1/2/2007 6:08 AM:
Randy Webb wrote:
>meltedown said the following on 1/2/2007 5:50 AM:
>>Dag Sunde wrote:

<snip>
>>>You're kidding, right?

it isn't a tutorial on how to make a form post a textfield to
some serverside script, neither a tutorial on how to make serverside
script that returns some text bak to you.

You surely know how to do the two things above?

I can make a form, but I don't know how to use ajax to update text on
a page.

You don't use "ajax" to update the page. You use ajax to retrieve the
data from the server. Then, you use that response and update the page.
Check the group FAQ for DynWrite (see my signature) for a function
that will update the page.
>>There's lots of examples where the results are put into an alert box,
but I've never seen one where the result appears on the page without
reloading the page.

Instead of alert('something') you do
document.getElementById('someID').innerHTML = 'something';, or, you
DynWrite it.
>>>It show you an example how to use that particular function
to update an element with the response of a given serverside script.

No it doesn't. It shows the code, but there is no working example.


If you can't take code from the manual and make it work, you need a
different approach.
I don't understand why I can't just ask for a working example without
all the snarky responses. If there is no working example of what I'm
asking for, fine, but that's what I'm looking for.
First, a "complete working example" would have to include the server
side code as well, or, use a static file.
Second, you didn't get a "snarky" response, you got an honest one.
Third, I doubt - very seriously - that you will find very many "complete
working examples" on the web of a complete ajax application.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 2 '07 #10
Randy Webb wrote:
meltedown said the following on 1/2/2007 6:08 AM:
>Randy Webb wrote:
>>meltedown said the following on 1/2/2007 5:50 AM:
Dag Sunde wrote:

<snip>

You're kidding, right?
>
it isn't a tutorial on how to make a form post a textfield to
some serverside script, neither a tutorial on how to make serverside
script that returns some text bak to you.
>
You surely know how to do the two things above?

I can make a form, but I don't know how to use ajax to update text
on a page.

You don't use "ajax" to update the page. You use ajax to retrieve the
data from the server. Then, you use that response and update the
page. Check the group FAQ for DynWrite (see my signature) for a
function that will update the page.

There's lots of examples where the results are put into an alert
box, but I've never seen one where the result appears on the page
without reloading the page.

Instead of alert('something') you do
document.getElementById('someID').innerHTML = 'something';, or, you
DynWrite it.

It show you an example how to use that particular function
to update an element with the response of a given serverside script.

No it doesn't. It shows the code, but there is no working example.
If you can't take code from the manual and make it work, you need a
different approach.
I don't understand why I can't just ask for a working example without
all the snarky responses. If there is no working example of what I'm
asking for, fine, but that's what I'm looking for.

First, a "complete working example" would have to include the server
side code as well, or, use a static file.
Second, you didn't get a "snarky" response, you got an honest one.
Third, I doubt - very seriously - that you will find very many "complete
working examples" on the web of a complete ajax application.
>
Why not ? As I said before, there's lots of complete working examples of
complete ajax applications where the results are put into an alert box.
Here's a bunch of assorted complete working examples of complete ajax
applications right here, but it doesn't include the most obviously
needed example, that of a simple display of text on the web page.

http://wiki.script.aculo.us/scriptaculous/show/Demos

You are not making any sense to me.
Jan 2 '07 #11
meltedown wrote:
Randy Webb wrote:
<snipped/>
>First, a "complete working example" would have to include the server
side code as well, or, use a static file.
Second, you didn't get a "snarky" response, you got an honest one.
Third, I doubt - very seriously - that you will find very many
"complete working examples" on the web of a complete ajax
application.
>>

Why not ? As I said before, there's lots of complete working examples
of complete ajax applications where the results are put into an alert
box. Here's a bunch of assorted complete working examples of complete
ajax applications right here, but it doesn't include the most
obviously needed example, that of a simple display of text on the web
page.
http://wiki.script.aculo.us/scriptaculous/show/Demos

You are not making any sense to me.
The feeling is mutual... :-)

Oh, for God's sake... here you go:
(Completely untested, from the top of my head sample)

server.asp:
<%@ Language=VBScript %>
<%Response.Buffer = True%>
<%
Response.Buffer = True
Dim s

Response.ContentType ="text/html"
Response.CacheControl = "Private"
Response.AddHeader "Cache-Control", "no-cache"

If Not isempty(Request.Form("someString")) Then
s = "<h1>" & Request.Form("someString") & "</h1>"
Else
s = "<h1>you didn't say anything</h1>"
End If
Response.Write s
Response.End()
%>

test.html:
<html
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>TestSomeAjaxThingy</title>
<script src="/scripts/prototype.js" type="text/javascript"></script>
<script type="text/javascript">
function sendIt() {
}
</script>
</head>

<body>
<input type="text" id="someString" name="someString" value="" /><br />
<input type="button"
id="btnSend"
name="btnSend"
value="Send"
onclick="new Ajax.Updater('results', 'server.asp',
{asynchronous:true});"/>
<br />
<div id="results">It should appear here</div>
</body>
</html>
Note: I've never used prototype.js in my life, but the above is the
principle.

--
Dag.

Listen to your brain - it has a lot of information.
(Chelsey, 7) -
Jan 2 '07 #12
Dag Sunde wrote:
meltedown wrote:
>Randy Webb wrote:
<snipped/>
>>First, a "complete working example" would have to include the server
side code as well, or, use a static file.
Second, you didn't get a "snarky" response, you got an honest one.
Third, I doubt - very seriously - that you will find very many
"complete working examples" on the web of a complete ajax
application.
Why not ? As I said before, there's lots of complete working examples
of complete ajax applications where the results are put into an alert
box. Here's a bunch of assorted complete working examples of complete
ajax applications right here, but it doesn't include the most
obviously needed example, that of a simple display of text on the web
page.
http://wiki.script.aculo.us/scriptaculous/show/Demos

You are not making any sense to me.

The feeling is mutual... :-)

Oh, for God's sake... here you go:
(Completely untested, from the top of my head sample)

server.asp:
<%@ Language=VBScript %>
<%Response.Buffer = True%>
<%
Response.Buffer = True
Dim s

Response.ContentType ="text/html"
Response.CacheControl = "Private"
Response.AddHeader "Cache-Control", "no-cache"

If Not isempty(Request.Form("someString")) Then
s = "<h1>" & Request.Form("someString") & "</h1>"
Else
s = "<h1>you didn't say anything</h1>"
End If
Response.Write s
Response.End()
%>

test.html:
<html
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>TestSomeAjaxThingy</title>
<script src="/scripts/prototype.js" type="text/javascript"></script>
<script type="text/javascript">
function sendIt() {
}
</script>
</head>

<body>
<input type="text" id="someString" name="someString" value="" /><br />
<input type="button"
id="btnSend"
name="btnSend"
value="Send"
onclick="new Ajax.Updater('results', 'server.asp',
{asynchronous:true});"/>
<br />
<div id="results">It should appear here</div>
</body>
</html>
Note: I've never used prototype.js in my life, but the above is the
principle.
>
Oh for Gods sake yourself. Do you know the difference between code and a
working example ?
Jan 2 '07 #13
"meltedown" <as**@fake.comwrote in message
news:B2*********************@fe10.news.easynews.co m...
Oh for Gods sake yourself. Do you know the difference between code and a
working example ?
http://xwire.solutionpioneers.com/treeTableDemo.html

(IE or FireFox 1.5 only)
Jan 2 '07 #14
meltedown wrote:
>
Oh for Gods sake yourself. Do you know the difference between code and a
working [Ajax] example ?
For a working example please see

<URL: http://gmail.com/>

Peter

Jan 2 '07 #15
meltedown wrote:
Dag Sunde wrote:
<snipped/>
> </body>
</html>
Note: I've never used prototype.js in my life, but the above is the
principle.
>>
Oh for Gods sake yourself. Do you know the difference between code
and a working example ?
You're welcome.

Always nice to help!

:-D

--
Dag.

Listen to your brain - it has a lot of information.
(Chelsey, 7) -
Jan 2 '07 #16
David Gillen wrote:
meltedown said:
>Dag Sunde wrote:
>>meltedown wrote:
Randy Webb wrote:
<snipped/>
First, a "complete working example" would have to include the server
side code as well, or, use a static file.
Second, you didn't get a "snarky" response, you got an honest one.
Third, I doubt - very seriously - that you will find very many
"complete working examples" on the web of a complete ajax
application.
Why not ? As I said before, there's lots of complete working examples
of complete ajax applications where the results are put into an alert
box. Here's a bunch of assorted complete working examples of complete
ajax applications right here, but it doesn't include the most
obviously needed example, that of a simple display of text on the web
page.
http://wiki.script.aculo.us/scriptaculous/show/Demos

You are not making any sense to me.
The feeling is mutual... :-)

Oh, for God's sake... here you go:
(Completely untested, from the top of my head sample)

server.asp:
<%@ Language=VBScript %>
<%Response.Buffer = True%>
<%
Response.Buffer = True
Dim s

Response.ContentType ="text/html"
Response.CacheControl = "Private"
Response.AddHeader "Cache-Control", "no-cache"

If Not isempty(Request.Form("someString")) Then
s = "<h1>" & Request.Form("someString") & "</h1>"
Else
s = "<h1>you didn't say anything</h1>"
End If
Response.Write s
Response.End()
%>

test.html:
<html
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>TestSomeAjaxThingy</title>
<script src="/scripts/prototype.js" type="text/javascript"></script>
<script type="text/javascript">
function sendIt() {
}
</script>
</head>

<body>
<input type="text" id="someString" name="someString" value="" /><br />
<input type="button"
id="btnSend"
name="btnSend"
value="Send"
onclick="new Ajax.Updater('results', 'server.asp',
{asynchronous:true});"/>
<br />
<div id="results">It should appear here</div>
</body>
</html>
Note: I've never used prototype.js in my life, but the above is the
principle.
Oh for Gods sake yourself. Do you know the difference between code and a
working example ?
And that's what you get when you feed a troll.

D.
I didn't do anything trollish at all. I simply asked for a simple
working example of an Ajax script that would change text on a page and I
haven't seen one yet. I have seen a bunch of answers from people who
don't seem to understand the request, or are pretenting they don't
understand. I have really really hard time understanding something like
the code above. I can look at it for hours and hours and it makes no
sense. Its Greek. And I have really hard time getting it to work. But If
I can see it in a working, example, after about 5 minutes, it is much
more clear. So my question is not ridiculous. What is ridiculous is the
idea that I have written anything that is remotely wrong or confusing to
any honest person.

You guys are bunch of rude bullies.
Jan 2 '07 #17
meltedown said the following on 1/2/2007 4:08 PM:
David Gillen wrote:
>meltedown said:
<snip>
>>Oh for Gods sake yourself. Do you know the difference between code
and a working example ?
And that's what you get when you feed a troll.

D.
I didn't do anything trollish at all.
You come ask for an example, you get more of an example than most people
are willing to bother with, and then you complain about that?
I simply asked for a simple working example of an Ajax script that
would change text on a page and I haven't seen one yet. I have seen
a bunch of answers from people who don't seem to understand the
request, or are pretenting they don't understand.
I explained to you, in this thread, that if you look in this groups FAQ
(which is in my signature) and search for "DynWrite" that you would find
an entry that shows how to make it modify the page itself instead of
using an alert.

The steps for an "ajax request" go, in plain English, like this:

1) User says "Give me that data".
2) Browser requests that data from the server.
3) Server sends that data to the browser.
4) Browser displays that data.
5) User gets the data.

The only step in that list that you have wanted changed was step 4 which
is how the browser displays that data. The examples you have posted
URL's to use an alert to display it.

Yet, you want someone to write all 5 steps, from scratch, just for you
and you complain when they won't. This isn't a help desk, its a
discussion group.
You guys are bunch of rude bullies.
If not writing a full blown app just for you makes me a bully, then I
will remain a bully until I get paid for writing that app for you.

<URL: http://www.ajaxtoolbox.com/>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 2 '07 #18
meltedown wrote:
David Gillen wrote:
<snipped/>
>And that's what you get when you feed a troll.

D.
I didn't do anything trollish at all. I simply asked for a simple
working example of an Ajax script that would change text on a page
and I haven't seen one yet. I have seen a bunch of answers from
people who don't seem to understand the request, or are pretenting
they don't understand. I have really really hard time understanding
something like the code above. I can look at it for hours and hours
and it makes no sense. Its Greek. And I have really hard time getting
it to work. But If I can see it in a working, example, after about 5
minutes, it is much more clear. So my question is not ridiculous.
What is ridiculous is the idea that I have written anything that is
remotely wrong or confusing to any honest person.

You guys are bunch of rude bullies.
No, we're not!

The sample I actually took time to sit down and write specifically
for you is what I thought you need (and meant).

I had no idea that that you needed a ready-made web-site with
a button to click on.

I believed you needed the source-code for an working example
so you could set it up on your own machine to experiment with,
and that was *excactly* what I gave you:
The content of 2 files. server.asp and test.html to put somewhere
on your IIS server. Then you could point your browser to
http://yourserver/test.html, and tested/played with the *working
example*

If the code was greek to you, you could have posted further questions
here, to get specific points clarified.

If you don't even know how to set up those two files I posted on your
own webserver, you could have said: "Wow! Thanks! But how do I use them?
Can you please take the time to help me set it up, so it runs on my
computer?"

Believe me, everyone that have replied to you have really tried
to help you, despite your sometimes "snotty", whining remarks.

--
Dag.

Listen to your brain - it has a lot of information.
(Chelsey, 7) -
Jan 2 '07 #19
meltedown wrote:
>
I didn't do anything trollish at all. I simply asked for a simple
working example of an Ajax script that would change text on a page and I
haven't seen one yet.
This implies you *expect* someone here to give it to you. People here
are *extremely* helpful if you ask politely, you gloss over any
perceived abrasiveness that may simply be a result of quickly chosen
words and you are patient.

I have seen a bunch of answers from people who
don't seem to understand the request, or are pretenting they don't
understand.
The person taking the time to reply probably thought they were being
helpful by pointing you in the right direction and then you could take
the next step of investigation.

I have really really hard time understanding something like
the code above. I can look at it for hours and hours and it makes no
sense. Its Greek. And I have really hard time getting it to work. But If
I can see it in a working, example, after about 5 minutes, it is much
more clear.
In a working example you are probably going to see something clicked
and then text appear on the screen. Where will that get you? You will
then have to look at the code and for Ajax that requires a bit of
theory and probably a tutorial which is what you've bocked at reading.

I could make the example this terse

<script src="ajax.js"></script>
<div onclick="doAjax(this)">do ajax</div>

But when you look in the ajax.js file you will see it is relatively
complicated or maybe it isn't. It depends. You need to spend the time
to read the tutorials . . .

On the group faq look for books and get Flanagan's fifth edition and
read the chapter on Ajax. Then realize that there are bugs in that
chapter and look at the errata on the O'Reilly site. Then realize that
not all the bugs have been posted there yet and that there are issues
with IE memory leaks and IE/Firefox XHR abort() calls.

<URL: http://jibbering.com/faq/>

If you don't want to do any of the above then just use a pre-made
library like ajaxtoolbox or yahoo ui and follow the tutorials on those
sites. The Yahoo! UI lib might be a better fit for you because there is
a special Yahoo! group/email list for discussing the YUI libraries.

Peter

Jan 2 '07 #20
Peter Michaux wrote:
meltedown wrote:
>I didn't do anything trollish at all. I simply asked for a simple
working example of an Ajax script that would change text on a page and I
haven't seen one yet.

This implies you *expect* someone here to give it to you.
Yes you are right, that's not want I meant. I wan't asking anyone to
write anything, I really thought an example would already be close at
hand. I'd be happy with "sorry, we don't know of any working examples."
I'd say "thanks for answering my question. "

People here
are *extremely* helpful if you ask politely, you gloss over any
perceived abrasiveness that may simply be a result of quickly chosen
words and you are patient.

>I have seen a bunch of answers from people who
don't seem to understand the request, or are pretenting they don't
understand.

The person taking the time to reply probably thought they were being
helpful by pointing you in the right direction and then you could take
the next step of investigation.

>I have really really hard time understanding something like
the code above. I can look at it for hours and hours and it makes no
sense. Its Greek. And I have really hard time getting it to work. But If
I can see it in a working, example, after about 5 minutes, it is much
more clear.

In a working example you are probably going to see something clicked
and then text appear on the screen. Where will that get you?
That will then let me see the code in context, which is much less
confusing than trying to get pieces to work. I can never get the pieces
to fit together, and even if I do I still don't know if what I've built
will work in all browsers or if I've just done one step in a greater
application.I'm surprised you don't understand the difference.
You will
then have to look at the code and for Ajax that requires a bit of
theory and probably a tutorial which is what you've bocked at reading.
The tutorials make alot more sense when I can see the code as part of a
working example. Otherwise, its ten times harder to decipher. It seems
like anytime anyone writes a tutorial they skip over the most basic
working examples. They are like you, they don't understand the
importance of basic working examples, in context. They don't understand
what it "gets you".
>
I could make the example this terse

<script src="ajax.js"></script>
<div onclick="doAjax(this)">do ajax</div>
Yes I would love to see a working example of a simple text change even
if it is this terse. I could then look at the code and understand what
it is doing. Out of context, its all greek.
>
But when you look in the ajax.js file you will see it is relatively
complicated or maybe it isn't. It depends.
At least it would be in context, which means everything to me.

You need to spend the time
to read the tutorials . . .

On the group faq look for books and get Flanagan's fifth edition and
read the chapter on Ajax. Then realize that there are bugs in that
chapter and look at the errata on the O'Reilly site. Then realize that
not all the bugs have been posted there yet and that there are issues
with IE memory leaks and IE/Firefox XHR abort() calls.

<URL: http://jibbering.com/faq/>

If you don't want to do any of the above then just use a pre-made
library like ajaxtoolbox or yahoo ui and follow the tutorials on those
sites. The Yahoo! UI lib might be a better fit for you because there is
a special Yahoo! group/email list for discussing the YUI libraries.

Peter
Jan 2 '07 #21
meltedown wrote:
Peter Michaux wrote:
I could make the example this terse

<script src="ajax.js"></script>
<div onclick="doAjax(this)">do ajax</div>

Yes I would love to see a working example of a simple text change even
if it is this terse. I could then look at the code and understand what
it is doing. Out of context, its all greek.
<URL: http://ajaxtoolbox.com/request/examples.php>
<URL: http://forkjavascript.org/ajax/tests#simple>
<URL: http://developer.yahoo.com/yui/examples/connection/get.html>

Peter

Jan 2 '07 #22


Peter Michaux wrote:
meltedown wrote:
>Peter Michaux wrote:
>>I could make the example this terse

<script src="ajax.js"></script>
<div onclick="doAjax(this)">do ajax</div>
Yes I would love to see a working example of a simple text change even
if it is this terse. I could then look at the code and understand what
it is doing. Out of context, its all greek.

<URL: http://ajaxtoolbox.com/request/examples.php>
<URL: http://forkjavascript.org/ajax/tests#simple>
<URL: http://developer.yahoo.com/yui/examples/connection/get.html>

Peter
Thanks, The second one is much closer to what I'm looking for than
anything else I've seen.
Jan 3 '07 #23
meltedown wrote:
>
I can make a form, but I don't know how to use ajax to update text on a
page. There's lots of examples where the results are put into an alert
box, but I've never seen one where the result appears on the page
without reloading the page.

>>
It show you an example how to use that particular function
to update an element with the response of a given serverside script.

No it doesn't. It shows the code, but there is no working example.
I figured it out. Basically, all I had to do is replace
alert(request.responseText);

with

document.getElementById('result').innerHTML = request.responseText;

This is basically what I was looking for in my original request:
http://www.reenie.org/test/ajax.htm
This is the simplest working example of Ajax I can conceive of. I'd much
rather look at something like this than some disembodied code in a
tutorial.

Now that I've got a basic ajax application I can study, I'd love to hear
what's wrong with it, if anything, before I start using it and making
it more complicated.


Jan 3 '07 #24
meltedown said the following on 1/2/2007 8:29 PM:
meltedown wrote:
>>
I can make a form, but I don't know how to use ajax to update text on
a page. There's lots of examples where the results are put into an
alert box, but I've never seen one where the result appears on the
page without reloading the page.

>>>
It show you an example how to use that particular function
to update an element with the response of a given serverside script.

No it doesn't. It shows the code, but there is no working example.

I figured it out. Basically, all I had to do is replace
alert(request.responseText);

with

document.getElementById('result').innerHTML = request.responseText;
And I only told you that twice in order to be called a "rude bully". Go
figure.
Now that I've got a basic ajax application I can study, I'd love to hear
what's wrong with it, if anything, before I start using it and making
it more complicated.
Test it. You can get the 3 mainstream browsers for MS Windows for free
(IE, Opera, Mozilla based) and test. If it works in those three then
odds are it will work in most PC based browsers. Then you need a mac
tester and personal experience has taught me that if an ajax page works
in most PC browsers then it will work in most modern mac browsers
(Safari being a possible exception). But then you only need ask for help
with code you made the effort to try to make work instead of asking for
someone to come up with code for you.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 3 '07 #25
Hello,

Now I know who posted all the 'where is the example?' comments on my
blog... LOL.

There appears to be a misunderstanding of the term 'example' as used on
the site -The site which posted the code uses the term 'example' as in
'Code Example', and not as in 'Working Example', most programming
related sites tend to show Code Examples, and not user interface
examples... this is quite normal. Sorry for the confusion this is
causing you.

However, this is a post which includeds both code:
http://www.ajaxtutorial.net/index.ph...-php-using-res
ponsexml/
and a 'Working Example' of this:
http://www.ajaxtutorial.net/demo/one.php

This above example shows AJAX (with XML returned)... I'd say it would be
a little more complex than the original URL you mentioned though!

*** Sent via Developersdex http://www.developersdex.com ***
Jan 16 '07 #26

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

Similar topics

4
by: bobzimuta | last post by:
I'm creating a simple AJAX library. It's an object that will return an array containing the response text or xml. I'm trying to find a way to assign the response as a property of the object, but...
8
by: needin4mation | last post by:
I understand this is a asp.net group, but thought I would post this here for comments. I admit I have used this post in another group, but it has less traffic. Here's to hoping I'm just blind to...
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...
31
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...
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 -...
3
by: BG Mahesh | last post by:
hi We are looking for a good Ajax library which has very good support for iframe. The ones we have considered so far are, Backbase.com - not happy with the speed Zapatech.com - it is good but...
17
by: Arjen | last post by:
Hi, I want to reload 2 divs at one click. Ive tried: <a href = "javascript:void(0);"...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.