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] contextsare 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 aboutthis anytime soon (because of other pressing priorities).. but sinceJSON is just a format (such as XML) any one of us could write a functionlib 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 begood 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 withXML 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 hasa 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 workwith AJAX snippets that make use of the 'responseXML' component.I brought this up with Chris.. and we discovered that this willwork with the up coming fastCGI app.. but Chris will have to decideif he wants to address it for the module version.I am guessing the problem resides in the open source WebDNA apachemodule, 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 snippetsis to look for the "responseText" object and don't use snippetsthat 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... hereis some more info about all of this:http://www.developer.com/xml/article.php/3596836/Speeding-Up-AJAX-with-JSONCheers,Donovan-- Donovan BrookeEuca Design Center[Practical-Ethical-Efficient]www.euca.usegg.bzartglass-forum.com
Associated Messages, from the most recent to the oldest:
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] contextsare 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 aboutthis anytime soon (because of other pressing priorities).. but sinceJSON is just a format (such as XML) any one of us could write a functionlib 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 begood 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 withXML 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 hasa 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 workwith AJAX snippets that make use of the 'responseXML' component.I brought this up with Chris.. and we discovered that this willwork with the up coming fastCGI app.. but Chris will have to decideif he wants to address it for the module version.I am guessing the problem resides in the open source WebDNA apachemodule, 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 snippetsis to look for the "responseText" object and don't use snippetsthat 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... hereis some more info about all of this:http://www.developer.com/xml/article.php/3596836/Speeding-Up-AJAX-with-JSONCheers,Donovan-- Donovan BrookeEuca Design Center[Practical-Ethical-Efficient]www.euca.usegg.bzartglass-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)