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


Groups > comp.lang.javascript > #26960

Re: Can I test ajax if I don't have any database or any server. I just run local

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Can I test ajax if I don't have any database or any server. I just run local
Date 2015-03-02 10:14 +0000
Organization A noiseless patient Spider
Message-ID <md1d5g$68q$1@dont-email.me> (permalink)
References <mctifg$q5r$1@dont-email.me> <mcv7a9$dos$2@dont-email.me> <010320151726104654%timstreater@greenbee.net>

Show all headers | View raw


On Sun, 01 Mar 2015 17:26:10 +0000, Tim Streater wrote:

> In article <mcv7a9$dos$2@dont-email.me>, Denis McMahon
> <denismfmcmahon@gmail.com> wrote:
> 
>>On Sun, 01 Mar 2015 00:20:00 +0100, Tony Johansson wrote:
>>
>>> I just wat to text how it works from javascript or jQuery.
>>> Is this possible or impossible?
>>
>>You can create json or xml documents and request them with ajax
>>requests.
> 
> No you don't. What you are requesting is *data*, which can be in any
> format as long as the two sides agree on what the format is.

Yes he can. OP can do other things as well, but OP _CAN_ do as I 
suggested for the purposes of testing javascript / jquery ajax.

I didn't say that was the only thing he could do.

Technically you're just requesting a response, which may or may not 
include a body, but unless you want to write your own parser to convert 
the body you're sending from your server into data for your javascript to 
use on the client, json and xml tend to be the two formats that javascript 
can process natively.

Having said that, you can eg send a b64 encoded jpg image and:

document.getElementById(img_id).attr("src", "data:image/jpg;base64," + 
data);

This may well work for other media types such as music files, but richard 
should note well that I have no intention of helping him with any such 
project!

-- 
Denis McMahon, denismfmcmahon@gmail.com

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


Thread

Can I test ajax if I don't have any database or any server. I just run local "Tony Johansson" <johansson.andersson@telia.com> - 2015-03-01 00:20 +0100
  Re: Can I test ajax if I don't have any database or any server. I just run local Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-01 02:52 +0100
  Re: Can I test ajax if I don't have any database or any server. I just run local "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-02-28 20:05 -0800
  Re: Can I test ajax if I don't have any database or any server. I just run local Tim Streater <timstreater@greenbee.net> - 2015-03-01 09:15 +0000
  Re: Can I test ajax if I don't have any database or any server. I just run local JJ <jj4public@vfemail.net> - 2015-03-01 18:36 +0700
  Re: Can I test ajax if I don't have any database or any server. I just run local Denis McMahon <denismfmcmahon@gmail.com> - 2015-03-01 14:22 +0000
    Re: Can I test ajax if I don't have any database or any server. I just run local "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-03-01 16:04 +0100
    Re: Can I test ajax if I don't have any database or any server. I just run local Tim Streater <timstreater@greenbee.net> - 2015-03-01 17:26 +0000
      Re: Can I test ajax if I don't have any database or any server. I just run local Denis McMahon <denismfmcmahon@gmail.com> - 2015-03-02 10:14 +0000

csiph-web