/    Sign up×
Community /Pin to ProfileBookmark

XML – JSON to improve performance

I’m trying to help a client improve the performance of their website. We’re currently building their navigation menus using XML/Javascript as their CMS doesn’t provide a server side solution that will work. First, i’m considering switching the XML to JSON as i’ve heard it’s dramatically faster so i’m curious about any feedback those of you more experienced with the infamous JSON vs. XML debate might have. Also, is the following JSON format equivalent (and correct syntax) to the XML format below it?

JSON…

[code]var departments = {
‘data’:[
{
‘title’:’Backpacks’,
‘id’:’3032′,
‘brands’:[
{‘title’:’Jansport’,’id’:’3010′}
{‘title’:’Samsonite’,’id’:’11137′}
{‘title’:’Tumi’,’id’:’11275′}
{‘title’:’Victorinox’,’id’:’3164′}
]
},
{
‘title’:’Business Cases’,
‘id’:’3131′,
‘brands’:[
{‘title’:’Ameribag’,’id’:’3173′}
{‘title’:’Atlas’,’id’:’11247′}
{‘title’:’Curtis Street’,’id’:’11217′}
{‘title’:’Hartmann’,’id’:’3007′}
]
} …
]
};
[/code]

XML…

[code]<departments>
<dept id=”3032″>
<title>Backpacks</title>
<brands>
<brd id=”3010″>Jansport</brd>
<brd id=”11137″>Samsonite</brd>
<brd id=”11275″>Tumi</brd>
<brd id=”3164″>Victorinox</brd>
</brands>
</dept>
<dept id=”3131″>
<title>Business Cases</title>
<brands>
<brd id=”3173″>Ameribag</brd>
<brd id=”11247″>Atlas</brd>
<brd id=”11217″>Curtis Street</brd>
<brd id=”3007″>Hartmann</brd>
</brands>
</dept>…
</departments>
[/code]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzDec 12.2006 — I suggest you read this article.

http://apptools.com/rants/jsmenu.php

I have a much higher opinion of the Suckerfish Menu System than this author, however, he does explain the pitfalls of generating navigational menus with JavaScript well.

I suggest you read these as well:

[url=http://www.456bereastreet.com/archive/200612/you_cannot_rely_on_javascript_being_available_period/]You cannot rely on JavaScript being available. Period.[/url]

[url=http://developer.yahoo.com/yui/articles/gbs/gbs.html]Graded Browser Support[/url]

[url=http://www.webmonkey.com/03/21/index3a.html]Progressive Enhancement and the Future of Web Design[/url]

[url=http://www.robertnyman.com/2006/10/10/accessibility-is-seldom-just-up-to-the-interface-developer/]Accessibility is seldom just up to the interface developer[/url]

[url=http://www.baekdal.com/articles/Usability/XMLHttpRequest-guidelines/]XMLHttpRequest Usability Guidelines[/url]

[url=http://www.themaninblue.com/writing/perspective/2005/03/02/]"This is not another XMLHttpRequest article"[/url]
Copy linkTweet thisAlerts:
@bcamp1973authorDec 14.2006 — thanks for the links! ?
×

Success!

Help @bcamp1973 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...