Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #16259 > unrolled thread

How do we overcome deficiency of ajax?

Started byjustaguy <lichunshen84@gmail.com>
First post2012-09-29 18:43 -0700
Last post2012-09-30 12:25 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  How do we overcome deficiency of ajax? justaguy <lichunshen84@gmail.com> - 2012-09-29 18:43 -0700
    Re: How do we overcome deficiency of ajax? Denis McMahon <denismfmcmahon@gmail.com> - 2012-09-30 13:23 +0000
      Re: How do we overcome deficiency of ajax? justaguy <lichunshen84@gmail.com> - 2012-09-30 12:25 -0700

#16259 — How do we overcome deficiency of ajax?

Fromjustaguy <lichunshen84@gmail.com>
Date2012-09-29 18:43 -0700
SubjectHow do we overcome deficiency of ajax?
Message-ID<089d9dbc-a959-451d-9222-72b4fd93f080@h4g2000yqk.googlegroups.com>
Hi,

Here's my simple HTML.

<div id="John">
<p>
John Doe is embarking on an ambitious plan.  We don't know where he'll
be able to go from here.
</p>

<p>
And yet one thing is for sure, history is never a friend of cowards.
Not that John Doe is reckless...
</p>
</div>

Now, if we do an ajax call via GET method to pass the data to a web
server, the XML data would not retain the formatting attributes such
as the P tags.  Many may have asked this question before, is there an
elegant solution to this issue?  That is, to retain the formatting of
a block of text while passing data along.

Thanks.

[toc] | [next] | [standalone]


#16273

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2012-09-30 13:23 +0000
Message-ID<k49h51$3db$3@dont-email.me>
In reply to#16259
On Sat, 29 Sep 2012 18:43:39 -0700, justaguy wrote:

> <div id="John">
> <p>
> John Doe is embarking on an ambitious plan.  We don't know where he'll
> be able to go from here.
> </p>
> 
> <p>
> And yet one thing is for sure, history is never a friend of cowards. Not
> that John Doe is reckless...
> </p>
> </div>

> Now, if we do an ajax call via GET method to pass the data to a web
> server, the XML data would not retain the formatting attributes such as
> the P tags.  Many may have asked this question before, is there an
> elegant solution to this issue?  That is, to retain the formatting of a
> block of text while passing data along.

If you do an ajax call using the GET method, the server receives whatever 
data you put in the get request, formatted however you want to format it, 
within the constraint that you need to use certain substitutions for 
certain non alphanumeric characters.

However, your basic premise appears nonsensical to me - why on earth 
would you want to send back to the server in an ajax request the x/html 
markup that the server had sent to you in the first place? Normally when 
you send an ajax request to the server, it's because your javascript 
wants to change something on the page in response to some user input or 
action, in which case there's no point whatsoever sending back static 
content that came from the server in the first place.

If perhaps you're telling a story in blocks of text, and sending the next 
page each time, then you only need to send the next page number in the 
get request, not the content of the current page of the book.

Rgds

Denis McMahon

[toc] | [prev] | [next] | [standalone]


#16279

Fromjustaguy <lichunshen84@gmail.com>
Date2012-09-30 12:25 -0700
Message-ID<b63e4104-60e1-4563-8c95-683a0fb01e96@v15g2000yqi.googlegroups.com>
In reply to#16273
On Sep 30, 9:23 am, Denis McMahon <denismfmcma...@gmail.com> wrote:
> On Sat, 29 Sep 2012 18:43:39 -0700, justaguy wrote:
> > <div id="John">
> > <p>
> > John Doe is embarking on an ambitious plan.  We don't know where he'll
> > be able to go from here.
> > </p>
>
> > <p>
> > And yet one thing is for sure, history is never a friend of cowards. Not
> > that John Doe is reckless...
> > </p>
> > </div>
> > Now, if we do an ajax call via GET method to pass the data to a web
> > server, the XML data would not retain the formatting attributes such as
> > the P tags.  Many may have asked this question before, is there an
> > elegant solution to this issue?  That is, to retain the formatting of a
> > block of text while passing data along.
>
> If you do an ajax call using the GET method, the server receives whatever
> data you put in the get request, formatted however you want to format it,
> within the constraint that you need to use certain substitutions for
> certain non alphanumeric characters.
>
> However, your basic premise appears nonsensical to me - why on earth
> would you want to send back to the server in an ajax request the x/html
> markup that the server had sent to you in the first place? Normally when
> you send an ajax request to the server, it's because your javascript
> wants to change something on the page in response to some user input or
> action, in which case there's no point whatsoever sending back static
> content that came from the server in the first place.
>
> If perhaps you're telling a story in blocks of text, and sending the next
> page each time, then you only need to send the next page number in the
> get request, not the content of the current page of the book.
>
> Rgds
>
> Denis McMahon

I'm afraid you didn't understand the question or it wasn't well
formed. But it's been resolved.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web