How cool... it sure does! I just tested the following code in IE7, FF 1.5.0.7 and Safari 1.3.2, and all I got was an alert box with the word Whatnot.
script type=text/x-jquery-jsonalert(Was run as JS.)/script
script type=text/x-jquery-json{accordion:false,stuff:Whatnot}/scriptdl
Klaus Hartl schrieb:
Paul, whenever you happen to be in Berlin I'll get you a beer (or two or
three...). And Jörn as well!
Heh. Just tell me if one of you gets to Cologne. Got plenty of beer
here, too!
:-)
--
Jörn Zaefferer
http://bassistance.de
But perhaps I'm misunderstanding you. Do you mean for there to just be a
JSON string inside the script tag? I've never used a script tag for
anything other than to tell an interpreter to parse and run the script
inside, be it javascript, php, VB or something like that. If you give it a
Ⓙⓐⓚⓔ wrote:
let's just use the informal type text/x-jquery-json that contains 1 js
object
or text/x-jquery-text for an unquoted string of chars
and others...
There is an official 'application/json' media type registered at IANA.
http://www.iana.org/assignments/media-types/application/ and an
Paul McLanahan schrieb:
Do you guys do that?
Yes! I actually didn't code any worth mentioning javascript before
knowing jQuery, and I hadn't the slightest idea of DOM manipulation.
Using CSS/XPath/Custom expressions is so much more natural.
I think the other great thing about jQuery is it's
Paul McLanahan schrieb:
title=accordion:true,showSpeed:'slow',hideSpeed:'fast'
I think the most natuaral way to describe that data is javascript
itself. That is less error-prone then any kind of custom parser or
whatever you and others here have already thought of. You may just want
to make it
Wow! we can be official!
On 11/1/06, Mark Gibson [EMAIL PROTECTED] wrote:
Ⓙⓐⓚⓔ wrote:
let's just use the informal type text/x-jquery-json that contains 1 js
object
or text/x-jquery-text for an unquoted string of chars
and others...
There is an official 'application/json' media type
Ⓙⓐⓚⓔ schrieb:
if you really have to validate, and don't want each spec stuffed into
the javascript (script tag or onclick), consider putting the spec
inside a code class=accordion_snippet tag (which would be hidden
in css)
and could be extracted as easily as the title attribute!
or a special
Brandon Aaron schrieb:
What is
more important than validation is to do whatever makes it easiest to
implement and maintain.
May I ask you that question again, once you want to start to deliver
your XHTML (as XML) to all kind of devices like mobiles other than the
typical web browsers? The
is it as bad as using li ul to create menus or using classes for
non-css purposes?
my $.002 cents!
On 10/30/06, Klaus Hartl [EMAIL PROTECTED] wrote:
Ⓙⓐⓚⓔ schrieb:
if you really have to validate, and don't want each spec stuffed into
the javascript (script tag or onclick), consider
Paul McLanahan schrieb:
@jake
I'm really liking the code tag idea. If I'm understanding you
correctly, it would work something like associating a label to an input
using the for attribute. I'd just be associating a code tag's
contents with a specific DL either by location in the markup or
the only other idea I had was
script type=text/x-accordion-parameters
but that was too long,
On 10/31/06, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
is it as bad as using li ul to create menus or using classes for
non-css purposes?
my $.002 cents!
On 10/30/06, Klaus Hartl [EMAIL PROTECTED] wrote:
is it as bad as using li ul to create menus
As a menu is semantically wise a list of links that somehow belong
together I don't see a problem there. In XHTML 2 there will even be a
navigation list (sic!) element nl.
or using classes for non-css purposes?
According to the HTML Specs, the
] Plugin method question Hi jQuerians,I'm a web developer with an internet banking provider. I've been preaching the joys of jQuery to them and they're sold.We have lots of people who
maintain the sites we host who aren't the most we'll say... skilled when it comes to _javascript_.So, a good deal
Paul McLanahan wrote:
@jake
I'm really liking the code tag idea. If I'm understanding you
correctly, it would work something like associating a label to an input
using the for attribute. I'd just be associating a code tag's
contents with a specific DL either by location in the markup or
Michael Geary schrieb:
The main reason I'm trying to avoid non-spec attributes is
for code longevity.
What you think over this:
dl
dt
a rel=accordion:false,showSpeed:'slow',hideAll:true /
click me
/dt
dd
to show me
/dd
/dl
You can supply atributes with initialization of
plugin. Code can be like this:
$(document).ready(
$("#accordion").accordion_plugin({
accordion: true,
show_speed:'slow'
});
$("#another_accordion").accordion_plugin({
accordion: true,
show_speed:'fast'
})
);
Or I'm
Olaf Bosch schrieb:
Michael Geary schrieb:
The main reason I'm trying to avoid non-spec attributes is
for code longevity.
What you think over this:
dl
dt
a rel=accordion:false,showSpeed:'slow',hideAll:true /
click me
/dt
dd
to
Blair McKenzie-2 wrote:
Is there any reason not to simply use a javascript snipit in a script tag?
There are good reasons to put code at the start of a page or in a separate
file, but in this case I would say that putting it at the top of the
relevant tag is perfectly reasonable:
ul
Personally, I'd rather use a div or span for that sort of thing, rather
than a code tag.
div
class=accordion_initaccordion:false,showSpeed:'slow',hideAll:true/div
Then, style div.accordion_init to be hidden, and you get the same effect
without misusing the code tag.
- Brian
Which would work
I would agree that usually a script tag would suit this just fine.
However, for me I don't always want that javascript executed. I only
want that javascript executed if it is a supported browser.
--
Brandon Aaron
On 10/31/06, Krzysztof FF [EMAIL PROTECTED] wrote:
Blair McKenzie-2 wrote:
I have been looking at the Form Validation plugin created by Jörn Zaefferer (which is excellent btw) and the way he used a special class syntax to indicate validation rules for various form elements. He use some specific stuff like class=$v(required,max:15) to indicate that the field is required
Brian Miller schrieb:
Personally, I'd rather use a div or span for that sort of thing, rather
than a code tag.
div
class=accordion_initaccordion:false,showSpeed:'slow',hideAll:true/div
Then, style div.accordion_init to be hidden, and you get the same effect
without misusing the code tag.
Brian Miller schrieb:
Hey listen,
I'd love to be able to pack all of the accordion parameters into classes.
But, there's just too much information there to make it make-sensical when
read by people who are a bit slow on the uptake, as Paul hints might be
the case.
Another good, but not
Then, style div.accordion_init to be hidden, and you get the same
effect without misusing the code tag.
Poor people that have to use a text browser, a screenreader,
or simply have switched of CSS...
...
Here's another solution that may be suitable for you: Do not put
all options into the
Hey listen,
I'd love to be able to pack all of the accordion parameters into classes.
But, there's just too much information there to make it make-sensical when
read by people who are a bit slow on the uptake, as Paul hints might be
the case.
Another good, but not very semantic solution, was to
Paul McLanahan schrieb:
I have been looking at the Form Validation plugin created by Jörn
Zaefferer (which is excellent btw) and the way he used a special class
syntax to indicate validation rules for various form elements. He use
some specific stuff like class=$v(required,max:15) to
@Klaus and DaveI do like that. Adding an even further layer of abstraction to the mix would be even cleaner for the non-technical to implement. We could have 3 or 4 sets of useful defaults which could be chosen via the second class, or even by an underscore separated single class name where
code, div full javascript each have problems
Everybody (well almost) likes the idea of putting scripting in script tags.
script tags don't have to be coded as type=text/javascriptm as we
know from vb and other abominations.
let's just use the informal type text/x-jquery-json that contains 1 js
Hi jQuerians,I'm a web developer with an internet banking provider. I've been preaching the joys of jQuery to them and they're sold. We have lots of people who maintain the sites we host who aren't the most we'll say... skilled when it comes to _javascript_. So, a good deal of my job is to
Oh yes, and if you really really want to, you could create a
custom DTD with your special attribute in it.
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul
McLanahan
Sent: Monday, October 30, 2006 9:38 PM
To: jQuery Discussion.
Subject: [jQuery] Plugin method
to parse out the settings yourself, but its
not entirely offensive to a semantic fascist like me.
-Kurt
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul McLanahan
Sent: Monday, October 30, 2006 9:38 PM
To: jQuery Discussion.
Subject: [jQuery] Plugin method question
Hi
9:38 PM
To: jQuery Discussion.
Subject: [jQuery] Plugin method question
Hi jQuerians,
I'm a web developer with an internet banking provider. I've been preaching
the joys of jQuery to them and they're sold. We have lots of people who
maintain the sites we host who aren't the most
On 10/30/06, Brandon Aaron [EMAIL PROTECTED] wrote:
I use custom attributes for our in-house stuff to make it easier on
not only myself but others on my team as well and never bother with a
custom DTD b/c the browsers/validators won't use it anyways. What is
more important than validation is
PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Brandon Aaron
Sent: Monday, October 30, 2006 9:59 PM
To: jQuery Discussion.
Subject: Re: [jQuery] Plugin method question
On 10/30/06, Brandon Aaron [EMAIL PROTECTED] wrote:
I use custom attributes for our in-house stuff to make it easier
On 10/30/06, Kurt Mackey [EMAIL PROTECTED] wrote:
That's strange, unless one of your custom attributes happens to be
runat='server'.
No we had issues with the form tag and custom attributes with a
namespace specifically. Nothing special just something like:
ch:validate=true and .net would blow
The main reason I'm trying to avoid non-spec attributes is for code longevity. We maintain around 1500 sites, many of which are getting old. So we've been bitten by past bad coding practices more than most. Our policy because of this is to do all new sites completely up to XHTML
1.0 Transitional
I would have put the code inside a div ... can it go inside a dl
without breaking the xhtml validatio tool?
and I would class the code, so as to not conflict with the normal
code tags that may wind up on the page.
You and I are on the same page!
On 10/30/06, Paul McLanahan [EMAIL PROTECTED]
I would bow to class when the class is a series of NMtokens, I've used it.
But for this case the class would be full of tokens that could easily
be picked up by css that may have nothing to do with the accordion.
On 10/30/06, Michael Geary [EMAIL PROTECTED] wrote:
The main reason I'm trying to
39 matches
Mail list logo