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


Groups > comp.lang.javascript > #16273

Re: How do we overcome deficiency of ajax?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: How do we overcome deficiency of ajax?
Date Sun, 30 Sep 2012 13:23:46 +0000 (UTC)
Organization A noiseless patient Spider
Lines 40
Message-ID <k49h51$3db$3@dont-email.me> (permalink)
References <089d9dbc-a959-451d-9222-72b4fd93f080@h4g2000yqk.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Sun, 30 Sep 2012 13:23:46 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="986f797cbd3b8f473a4775d73e9098bc"; logging-data="3499"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uA5B3Ei7Tcj2jJfp8QBuzlY8hRuf6mLE="
User-Agent Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2)
Cancel-Lock sha1:Uszu7PE5atJZxh4ZFJ5T+zE3lOc=
Xref csiph.com comp.lang.javascript:16273

Show key headers only | View raw


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

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web