Re: [WebDNA] WebDNA jQuery JSON javascript stuff

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 105071
interpreted = N
texte = Diane Blackmore (Cohesion) wrote: > Hi [snip] > Basically, can anyone tell me how I can get the data back in the JSON > format it needs, without the extra WebDNA stuff that it doesn’t need. > > > Thanks heaps if you can help, Using WebDNA's [function] and [return] contexts are a good way to return only what you want returned. Also, the can reside within [!][/!] tags... which can also prevent them from being displayed. so:----------- [!][/!][!] [/!][function name=someFname] [search..blah][return][founditems][blah][/founditems][/return][/search] [/function][someFname] -------------- May work for you. Regarding JSON.. I don't think Chris is planning on worrying about this anytime soon (because of other pressing priorities).. but since JSON is just a format (such as XML) any one of us could write a function lib to encode/decode for JSON.. perhaps from encoding from founditems, or an array etc?? http://www.json.org/ There are 3 very important data exchange formats that standard AJAX snippets will use.. text(string), XML, and JSON... so it would be good for us to have a JSON encode/decode util. to work with. Right now, 6.x (at least on the apache builds).. doesn't work with XML ajax snippets because you can't over-ride the content-type to a value of text/html... try it yourself: in a template have the code: [setmimeheader name=content-type&value=text/XML] then hit the page with a mime header viewer of some kind (firefox has a mimeheaders plug-in for example). Anyway, the AJAX object 'responseXML' requires the XML content-type.. so WebDNA (at least the apache 2.x builds) do not currently work with AJAX snippets that make use of the 'responseXML' component. I brought this up with Chris.. and we discovered that this will work with the up coming fastCGI app.. but Chris will have to decide if he wants to address it for the module version. I am guessing the problem resides in the open source WebDNA apache module, and I'm also guessing it is a simple fix. Anyway.. that's what I know about WebDNA and AJAX right now. My suggestion for anyone that is looking around for AJAX snippets is to look for the "responseText" object and don't use snippets that contain the 'responseXML' object for now. With 'responseText', you should be able to easily integrate with WebDNA.. however, there are sure reasons to use XML... here is some more info about all of this: http://www.developer.com/xml/article.php/3596836/Speeding-Up-AJAX-with-JSON Cheers, Donovan -- Donovan Brooke Euca Design Center [Practical-Ethical-Efficient] www.euca.us egg.bz artglass-forum.com Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] WebDNA jQuery JSON javascript stuff ("Diane Blackmore (Cohesion)" 2010)
  2. Re: [WebDNA] WebDNA jQuery JSON javascript stuff (Donovan Brooke 2010)
  3. Re: [WebDNA] WebDNA jQuery JSON javascript stuff (christophe.billiottet@webdna.us 2010)
  4. Re: [WebDNA] WebDNA jQuery JSON javascript stuff (Tom Duke 2010)
  5. Re: [WebDNA] WebDNA jQuery JSON javascript stuff ("Terry Wilson" 2010)
  6. Re: [WebDNA] WebDNA jQuery JSON javascript stuff (Donovan Brooke 2010)
  7. [WebDNA] WebDNA jQuery JSON javascript stuff ("Diane Blackmore (Cohesion)" 2010)
Diane Blackmore (Cohesion) wrote: > Hi [snip] > Basically, can anyone tell me how I can get the data back in the JSON > format it needs, without the extra WebDNA stuff that it doesn’t need. > > > Thanks heaps if you can help, Using WebDNA's [function] and [return] contexts are a good way to return only what you want returned. Also, the can reside within [!][/!] tags... which can also prevent them from being displayed. so:----------- [!][/!][!] [/!][function name=someFname] [search..blah][return][founditems][blah][/founditems][/return][/search] [/function][someFname] -------------- May work for you. Regarding JSON.. I don't think Chris is planning on worrying about this anytime soon (because of other pressing priorities).. but since JSON is just a format (such as XML) any one of us could write a function lib to encode/decode for JSON.. perhaps from encoding from founditems, or an array etc?? http://www.json.org/ There are 3 very important data exchange formats that standard AJAX snippets will use.. text(string), XML, and JSON... so it would be good for us to have a JSON encode/decode util. to work with. Right now, 6.x (at least on the apache builds).. doesn't work with XML ajax snippets because you can't over-ride the content-type to a value of text/html... try it yourself: in a template have the code: [setmimeheader name=content-type&value=text/XML] then hit the page with a mime header viewer of some kind (firefox has a mimeheaders plug-in for example). Anyway, the AJAX object 'responseXML' requires the XML content-type.. so WebDNA (at least the apache 2.x builds) do not currently work with AJAX snippets that make use of the 'responseXML' component. I brought this up with Chris.. and we discovered that this will work with the up coming fastCGI app.. but Chris will have to decide if he wants to address it for the module version. I am guessing the problem resides in the open source WebDNA apache module, and I'm also guessing it is a simple fix. Anyway.. that's what I know about WebDNA and AJAX right now. My suggestion for anyone that is looking around for AJAX snippets is to look for the "responseText" object and don't use snippets that contain the 'responseXML' object for now. With 'responseText', you should be able to easily integrate with WebDNA.. however, there are sure reasons to use XML... here is some more info about all of this: http://www.developer.com/xml/article.php/3596836/Speeding-Up-AJAX-with-JSON Cheers, Donovan -- Donovan Brooke Euca Design Center [Practical-Ethical-Efficient] www.euca.us egg.bz artglass-forum.com Donovan Brooke

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

TaxTotal Problem (1997) NT vs Mac (1997) Email (1998) A little help on e-mail (HELP!!! :-) ) (1998) A question on sub-categories (1997) Text data with spaces in them... (1997) Snake Bites (1997) Exclamation point (1997) Simple way to create unique SKU (1997) Deleting Orders (1997) HELP WITH DATES (1997) Misunderstanding?? (1997) Calendar (1997) Serial Number Question (1997) Page Breaks in Word (2003) Initiating NewCart (1997) More on the email templates (1997) How to Sort Summ data ? (1997) UPDATE PROBLEM (1997) WebMerchant Only reads 1.4 order files error (1997)