If you need data for multiple fields, then a 3rd option is to create a
single hash/data object for the page and writing all your data into
that. This makes your data easy to read and debug, and is highly
efficient because you don't have to 'parse' anything...
var Record = {
foo: db-value-1
On Thu, Sep 24, 2009 at 12:10 PM, Kevin Dalman kevin.dal...@gmail.com wrote:
If you need data for multiple fields, then a 3rd option is to create a
single hash/data object for the page and writing all your data into
that. This makes your data easy to read and debug, and is highly
efficient
On Tue, Sep 22, 2009 at 4:41 PM, WalterGR walte...@gmail.com wrote:
On Sep 22, 4:35 pm, Ricardo ricardob...@gmail.com wrote:
This doesn't make any sense. If you're already using jQuery why keep
your handler in the HTML?
Because I need to pass additional information to the event handler
Do you really need to output this data embedded in the HTML? Does it
have any meaning/purpose without Javascript? There are two simple non-
hackish ways you can do it:
1:
load data later via XHR, use an element identifier to bind it
2:
output metadata in the class attribute - it's valid, and
or this
a href=# rel=foobarbazshow details/a
$(a).click(function(){
var rel = $(this).attr('rel');
}
now you have passed foobarbaz to jquery.
WalterGR wrote:
I want to take advantage of jQuery's cross-browser Event object, but
via an onclick event handler. For example:
a href=#
On Sep 22, 6:38 am, Liam Potter radioactiv...@gmail.com wrote:
or this
a href=# rel=foobarbazshow details/a
$(a).click(function(){
var rel = $(this).attr('rel');
}
now you have passed foobarbaz to jquery.
This works only if I don't already need to use rel.
I feel like there
What about using the metadata plugin and storing data in the class
attribute? A little hackish (in HTML5 can use the data attribute, which is
more proper...):
http://plugins.jquery.com/project/metadata
In addition to rel, you could also use the title attribute on the anchor,
no?
Scott
On Tue,
This doesn't make any sense. If you're already using jQuery why keep
your handler in the HTML? I'll try to help anyway.
a ... onclick=showTextNearThisLink(e, 'foobarbaz');.../a
function showTextNearThisLink(e, sheez){
e = jQuery.event.fix(window.event || e);
// e is your new jQueryized
On Sep 22, 4:35 pm, Ricardo ricardob...@gmail.com wrote:
This doesn't make any sense. If you're already using jQuery why keep
your handler in the HTML?
Because I need to pass additional information to the event handler in
a clean way. (i.e. rather than hacks using various attributes on the
FYI, when I need to attach metadata to a non-empty element, I do it
with an invisible child element. This results in some extra HTML, but
I think that's as elegant as it can get until HTML5 becomes
mainstream.
style type=text/css
.metadata { display: none; }
/style
a href=#show detailsspan
10 matches
Mail list logo