It was originally written the way you suggested but John rearranged
them in svn v97. You'll have to ask him why. But I agree that
pre/post is a more natural ordering.
Wouldn't it make more sense if it was preCallback then postCallback -
___
jQuery
Here's a quick hack in case anyone needs something right away.
project name=jQuery default=jquery basedir=.
property name=SRC_DIR value=src /
property name=BUILD_DIR value=build /
property name=JAR value=${BUILD_DIR}/js.jar /
property name=PREFIX value=. /
property
:-) Well, it's just a quick port of John's makefile. I'm sure it can
be improved.
Mike
On 8/14/06, Christian Bach [EMAIL PROTECTED] wrote:
Damn it Mike, i guess you won the race :)
Great work.
/christian
___
jQuery mailing list
A simple (for the ant experts here) question: How'd I call the jQuery
targets from another build file?
You can see examples here: http://ant.apache.org/manual/CoreTasks/ant.html
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Have you try emptying your cache and restarting IE. Sometimes IE cache gets
corrupted and It stop responding in a predictable manner.
That's a good idea. Also, try to ween down the page as much as
possible to pin-point the problem; strip out everything you can.
value is the dom property that
Make the textfield read-only (optional). Whats the point in having a
date picker, when the user still can put unwanted date in the textfield :-)
The point is that the user can choose how they enter dates. I know I
can type a date value much faster than I can use a date widget and it
would
That would be a nice addition. Has there been any discussion of having
jQuery automatically use:
X-Requested-With: XMLHttpRequest
It already does.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Can you show me a little example using AJAX Activity Indicators? (with
jQuery of course).
This page uses the ajaxStart/ajaxStop functions:
http://www.malsup.com/jquery/taconite/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Not sure if this is the problem or not but be aware that for
'getIfModified' to work the server must set the 'Last-Modified'
header.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
I don't have any problem running Dave's plugin with 1.0.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
on lines 1 and 3 I put alerts - I'm confused as where the res variable
in the function comes from - since res does not exist before the
function in the code how can it be a variable in the function?
You're giving jQuery.ajax() a callback function as the 4th arg. When
that function is called
This always return to me null, if checkbox is checked or not.
Try this:
$('#mycheck')[0].checked
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Strangely, the xmlHttpRequest object holds the responded XML in
responseText, instead of responseXML.
Are you saying that responseXML is null? Are you sure?
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
This is what Firebug shows me when I do
console.log(xmlHttpRequest.responseXML):
Well that makes sense. responseXML should be a doc and that's what
you've got. If you were to alert responseXML you'd see something like
[object XMLDocument]. responseText holds the actual text returned
from
Klaus,
Both success and complete are passed a 2nd arg which indicates the
status of the request: 'success', 'error', or 'notmodified'.
Mike
Question: The complete handler is also fired after error. How can I
prevent to render a 404 message from the server into the page and
instead use some
Why should the courts get involved in this matter?
Because few would make the effort otherwise. Sad but true. Section
508 was written to call out the fact that software companies CAN NOT
ignore our disabled citizens. Even so, most do anyway. Believe me,
it's MUCH easier going into a project
That's an excellent point Yehuda. It's very easy to under estimate
the work involved in making an entire application accessible. I've
suffered through this pain for a huge Swing application. But at the
same time, people often over estimate what is involved (especially for
a small web-app or
This is what the form plugin is for.
http://jquery.com/dev/svn/plugins/form/
On 9/18/06, Rey Bango [EMAIL PROTECTED] wrote:
If I have 4 form fields like below and I wanted to serialize them in one
big swoop instead of 1 by 1, how might I go about doing it?
I know I can do this for the text
jQuery knows how to handle table/tbody issues.
That maybe true. The tbody element is implicit, even if you don't have
it in the html source, it is part of the DOM tree. In IE you must use
the tbody element to append rows to...
___
jQuery mailing
I highly recommend using the form plugin to handle form submission.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Any chance of a link to it?
The form plugin is available here:
http://jquery.com/dev/svn/plugins/form/form.js?format=txt
Sample usage can be found here:
http://malsup.com/jquery/form/
___
jQuery mailing list
discuss@jquery.com
Is there any documentation on the forms plugin?
The documentation is right in the form.js source file. Same link as before.
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
The recent increase in questions about form serialization and form
submission makes me wonder the following about why the form plugin is
not used more:
1. Is it not meeting your needs?
2. Did you not know it exists?
3. Do you prefer not to use plugins?
4. Something else?
I also wonder if its
the global responders for individual requests -- as Klaus points out, there
are often XHR requests that don't merit the user's attention.
You can't really override the global responders. If you declare
local handlers they are called in addition to the global methods, not
instead of them.
Mike
I don't see there is something deal with multiple-select situation in
forms.js. And serialize( ) in form.js, you return a hash value, and
this will only hold one value if the input element has the same name.
So I'd like your below idea introduce a serializeToString, and I
think it's better.
Andre, Zörn,
Those are both good ideas for overriding the global callbacks. I'd
like that capability.
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
BTW, curious to know answers to Mike's questions about the deserialize
plugin
Hi Ashutosh,
Regarding your question,
1. I think your deserializer is a great plugin and I expect to use it
in the future but I haven't had an actual use case for it yet. So it
hasn't been a matter of it not
I want to selecting all input and select elements that are not hidden, while
remaining there original dom order..
You can do that with expressions. I think this will work:
$('#myForm :visible')
Mike
___
jQuery mailing list
discuss@jquery.com
Oops, I missed a 'return'. This:
if (el.type == 'image' el.form.clicked_x)
return a.push(
{name: el.name+'_x', value: el.form.clicked_x},
{name: el.name+'_y', value: el.form.clicked_y}
);
Should be:
if (el.type == 'image' el.form.clicked_x) {
a.push(
Believe it or not, make it a reverse for loop, it is even faster:
Except that we want to process them in semantic order! :-)
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Can you explain why processing elements in semantic order is important?
Hi Renato,
The reasoning behind keeping the elements in semantic order is to have
the form submit data to the server in EXACTLY the same order as it
would if javascript were disabled. For many, this is unimportant, but
Good work Franck.
Indeed. And it looks like he's added quite a bit to it since the
original. Cool.
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
I agree with Brian about the need of a FastSerialize method.
Renato,
I've been benchmarking these serialize methods on a form with one
select element that has 2000 options. Using the Firebug timer to
capture elapsed time for the serialize call I see negligible
difference in your impl and the
Where are you finding the Firebug timer? I'm not seeing much of a
performance boost using the for loop, but without a true timer, it's not
a fair test...
Look at the measurement section here:
http://www.joehewitt.com/software/firebug/docs.php
My test func looks like this:
$(function() {
6 failures in Opera 8.5, including 2 in the ifelse test.
On 10/2/06, Jörn Zaefferer [EMAIL PROTECTED] wrote:
Hi folks,
I just uploaded what I like to call jQuery version 1.0.2 Release
Candiate 1. Sounds great, eh?
It would be great if you could give it a try and report if anything
breaks
Very nice, Matt. This serialize method is way faster if the select
element is not a multiple select which I assume is how you
benchmarked it. When the select is a multiple-select then I see
basically the same performance with the for-loop impl posted on the
other thread. I did a quick test and
That would actually have to ripple through all three methods in the
form plugin, not just the serialize method.
On 10/3/06, Brian [EMAIL PROTECTED] wrote:
I'd say that .serialize() should take a boolean argument, retainOrder,
which will retain semantic order if true, and not if false/null/not
Thought it would be more useful on the website until it was decided
whether it might be included with the form plugin. Mike (Alsup), is it
ultimately your call how this gets incorporated? I liked Brian's idea to
use a boolean argument for semantic order, and it should be trivial to
add
Below is a consolidated serialize method to accommodate the optimized
vs. semantic issue we've been pursuing recently. Essentially, this is
Matt Grimm's fastSerialize method with conditional behavior to drive
the semantic logic. I like how Matt wrote that method and the
semantic stuff drops
$('*:not(option)', this)
Thanks, Matt. That's even better!
As a side question, what advantage is there to calling the jQuery
function by name instead of by the $ alias?
See other thread on this topic (jQuery and Prototype).
Mike
___
jQuery
I uploaded forms.js to my test page. The test page now has the
side-by-side forms with one using the 'fast' method and one using the
'semantic' method.
http://www.malsup.com/jquery/form/
Mike
On 10/6/06, Mike Alsup [EMAIL PROTECTED] wrote:
$('*:not(option)', this)
Thanks, Matt. That's
Todd,
Just tack ?format=txt on to the end of the url. For example,
http://jquery.com/dev/svn/plugins/form/form.js?format=txt
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Test #38 fails in Opera 8.54.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Nope. I've just been hanging onto it so I can test stuff with it. I
jarred up my installation if you want to try using that. I posted it
here: http://malsup.com/jquery/op854.jar
Mike
Any idea where to download that version? I can't find any download prior
to Opera 9.
From http://www.opera.com/download/, follow the show other versions link.
Thanks, Choan.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Therefore I propose the default method should be 'GET' as it is the case
for a form in HTML:
Good catch, Klaus.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Can you post a test page because that sure doesn't happen for me.
Mike
Ok then jQuery is broken ;)
$(document).ready() fires each time i load new ajax content in both FF
and IE (lower than 7)
___
jQuery mailing list
discuss@jquery.com
Based on recent discussions I've made some updates to the form plugin.
Today's discussion prompted some mods to the ajaxSubmit method. I
also updated many of the comments and then discovered that the
coordinates for image submit elements are not posted correctly in all
browsers (FF in my case).
Thanks for the heads-up, Renato. I put your fix in there and posted
the updated js. It worked fine with all the browsers I have.
Mike
In short, if you have an input named action or method, this code
var url = url || f.action || '';
var mth = mth || f.method || 'GET';
will retrieve the
The plugin is now 1.70KB when packed. At some point it would be nice
to roll the changes from the past few weeks back into SVN and
determine if it might be a core candidate at that point.
The big problem with merging into core: The currente serialize method
and the one from the form
I don't think this is a big problem, we can just rename the form's
serialize method to formSerialize or something like that. It's
unfortunate that two methods of the same name exist and it's better to
fix it now than to perpetuate it. I think the real question is
whether or not to add
I've updated the form plugin once again to fix a bug in ajaxSubmit
which I found while unit testing. I thought I'd take this opportunity
to summarize the changes made recently:
1. Incorporated Matt Grimm's optimized serialization code.
2. Defaulted the form method to 'GET' per Klaus's
I've actually already created the drop-down menu for
the blog post:
http://test.learningjquery.com/dropdown.htm
Nice job, Karl. It looks great.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
An alternative to the above extended array/objects would be to just pass the
jQuery object
that contains all form elements as a second parameter to the pre-callback.
The validation
could then access all form elements and use the validation rules within the
elements to
check the entries
For IE you need to make sure that elements that you corner have
layout. divs do not have layout by default. You can give them an
explicit hieght or width or use something more subtle like zoom. For
details see: http://www.satzansatz.de/cssd/onhavinglayout.html
Mike
On 10/13/06, Mike DeFreitas
Klaus,
Thanks for catching that! I totally missed that the 'get's weren't
working and that the 'get' was not augmenting the url. I'll have to
improve my unit tests!
I'll be committing the form plugin to svn within the next day or two.
Thanks again.
Mike
jQuery.fn.ajaxSubmit =
Thanks for catching that! I totally missed that the 'get's weren't
working and that the 'get' was not augmenting the url. I'll have to
improve my unit tests!
I'll be committing the form plugin to svn within the next day or two.
All,
The form plugin has been updated in svn. It now
I see one thing that may cause the problem: your variable link is a
jQuery object. This is passed as context a few lines later on, but you
have to pass a DOM node as context to the $ function.
The context arg can be a jQuery object. From the source:
jQuery = function(a,c) {
snip
Hi Klaus,
Intertesting. If I change your alert to
alert(e.target.tagName);
then I see STRONG.
Mike
On 10/19/06, Klaus Hartl [EMAIL PROTECTED] wrote:
Hi all,
I wanted to add the normalization for e.target as discussed earlier. But
I came across a strange bug in Firefox. Have a look at the
Klaus,
$('a.hijax').history();
jQuery.fn.history = function() {
return this.each(function() {
$(this).click(function(e) {
jQuery.history.setHash('#' + this.href.split('#')[1]);
});
});
};
This is looking very nice. I like this usage pattern.
Jack Slocum's site is a great source for plugin ideas. The
YUI guys are lucky to have him building off their framework. I say we put a
burlap sack over him, give him a whack on the head, and abduct him over to
jQuery. :-)
I'm with you on the sack-n-whack, Dave. Jack's got a great site, both
I use the latter to keep tabs compatible with jQuery 1.03.
What I meant was, as an official plugin are you required to play by
the same rules as jQuery itself where API changes are reserved for
major releases?
Mike
___
jQuery mailing list
Is there an example of the correct implentation of preCallback with the
forms plugin??
Sam,
If the form is getting submitted in a non-ajax fashion it is likely
due to a javascript error. If you're running Firebug, try stepping
through your callback to see where the error occurs. One thing
I just checked in some more changes to the form plugin. The methods
were reworked to use the standard plugin style for specifying options.
The signatures for ajaxSubmit and ajaxForm now take just a single
argument which is an object literal. Here are the details from the
docs:
Could you add some documentation about the parameters for those callbacks?
Hi Jörn,
The inline docs have more details about the callback args. I only
posted the bit that itemized the available options.
Thanks.
Mike
___
jQuery mailing list
It is allready pretty big in filesize, but i wanted as much flexibility as
possible, meaning you can set: isDraggable, isResizable, hasTitlebar,
hasStatusbar etc.etc.
I think i can have a demo ready tomorrow late in the evening.
Cool. Thanks Gilles!
Just a quick FYI... I made one last minor update to form.js today to
ensure compatibility with jQuery 1.0 and 1.0.1.
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
On 10/27/06, Yehuda Katz [EMAIL PROTECTED] wrote:
All of the very dark button use white text. The light buttons (light grey
and blue) use black text. Maybe your screen is very dark?
That's not true. Selected items are extremely difficult to read.
:hover elements are challenging as well.
While we are at it, how to go about params that can be be a string or a
number (like speed)? Just stating the argument is an object is ambiguous
to me.
What about: @param Integer|String ?
Since there is no Integer data type I'd stick with Number and doc the
supported/expected values.
You get only one chance at this - you can't change it once the tag is written.
You can do this in FF and IE:
document.title = 'my new title';
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Hi Klaus,
Isn't it a bit dangerous to alter jQuery's core in a plugin?
I hear what you're saying. I ended up using serialize partially
based on this note from John:
I think form.js's .serialize() should supercede the serialize() in
ajax.js. It's all around a better plugin. If we're serious
mrkris, Steven,
Wow, believe it or not I never noticed that. I guess I don't use fixed
height divs too often. I'm working on a fix for that but am having a
hard time with IE6 (surprise, surprise). I may need to call in the
big guns (aka, Dave Methvin).
Mike
The corners appear 1/2 way down
i'm trying to append a quicktime movie using jquery.
Use $().html().
I have a plugin for this if you're interested.
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
$(#qtDiv).html($(#qtDiv).html() . $newHTML)
Yes, except with Javascript syntax instead of php. :-)
var qtHtml = object.;
var $qtDiv = $('#qtDiv');
$qtDiv.html($qtDiv.html() + qtHtml);
___
jQuery mailing list
discuss@jquery.com
pretty much the same syntax but with different behavior.
Look closer and you'll see that the 1st arg points to a js file that
performs the magic.
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
If you decorate the control like it's disabled, and leave it with an ID
(so jquery can find it) but no name, it will be an unsuccessful control,
and won't send. If someone enters something in the field, you can use
$('myinput').attr('name', 'myinput') to add the name attribute.
Nice idea,
http://sandbox.wilstuckey.com/jquery-ratings/
Great stuff, Will.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Aaaah, I was thinking that there was some magic within js.jar. I get it
now. Thanks Mike.
No problem. I believe js.jar is just the Rhino engine.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
I just updated the form plugin to fix a bug found by Zach Tirrell.
There was an error in handling pre-selected options for
'select-multiple' elements. Details about the bug can be found here:
http://nosheep.net/story/jquery-form-plugin-sweet-almost/
Thanks, Zach!
Mike
I've just posted some convenience plugins for dealing with Quicktime,
Flash, and mp3 media.
Source and demos can be found here: http://malsup.com/jquery/media/
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Excuse me, Kurt, would you please elaborate more on for content
that's going to be delivered in RSS feeds?
I am not sure that I fully understand your point.
I think he means that since the actual markup is just an anchor tag it
will appear that way in a feed. Likewise if you have javascript
Can it be modified to work with FLAM and WIMPY?
Hi Sam,
I've never used either of those but if they just use flash then I
would think the flash plugin would work with them with little or no
modifications.
Mike
___
jQuery mailing list
i've now updated to jQuery 1.0.3 and get a new error (same code):
Can you post a link?
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
I'm curious to know what you think :-)
That's excellent, Luke! Very flexible and very powerful; nice work!
Mike
PS: Love the Beatles!
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
I added it to the top of my custom.js file (which is included after
jQuery) and I tried $.debug(variableName) and all it did was say
$.debug is not a function.
His script adds debug and log to the jQuery object so you can use it like:
$('a').debug(anchors);
What is param and what is formdata
formdata() is an old function that used to exist in the form plugin
long ago. $.param is a core method which converts an object or an
array into a query string.
How can I submit a form then via ajax?
Use the form plugin:
I wonder if there is any case where one would use $.ajax without calling
$.param for any data first. If not, it would be nice to simply integrate
that call into $.ajax.
That's a good point, Jörn.
___
jQuery mailing list
discuss@jquery.com
Of couse it would be an ugly API change. If that stuff is integrated
into $.ajax, we could savely deprecate $.get and $.post.
Perhaps interrogating the type would work?
if (typeof data != 'string')
data = jQuery.param(data)
___
jQuery mailing
While we are at it: A get request can send it's data only by appending
the query string to the URL, right? Can this be handled by $.ajax, too?
Sure, it could. I think it makes sense to move all that logic into
$.ajax but I would keep $.get and $.post because they are nice
convenience methods.
So don't see the need for $.get and $.post anymore.
It's not a need, it's a convenience. Just like getJSON and getScript.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
I'd like to present you a first draft for a new stylesheet for the
This is looking good, Jörn. Much easier to use than the old layout.
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
On 11/11/06, Klaus Hartl [EMAIL PROTECTED] wrote:
I also have never seen something like: $(#editarticle/form :input)
before. Can this be extended like:
$(#editarticle/form :[EMAIL PROTECTED]'text']) ?
I don't think so. :input is a shortcut for all kind of form elements.
If you need all
I'm all for the custom build feature - in fact it was one of the first
things included on the jQuery home page when it first launched back in
Jan. (I removed it at the 1.0 launch, because it was broken).
John,
If you're intent on moving stuff out of core, I'd rather it be the fx
functions
What about select-multiple?
This, of course, does not work. val() will return the value of the
first selected option in this case.
Also note that simply adding a value attribute to something like a div
won't work cross-browser.
Mike
___
jQuery
attr is not an alternative to val. It flat out won't work in FF for
textareas, selects or anything w/o a true value attribute.
Oops. My apologies. I was using a 1.0 version of jQuery for my test.
Ignore the above.
___
jQuery mailing list
That sounds like a good solution to me. It puts the form code with other
form code.
I just started using the form plugin today and noticed that it doesn't pass
along the error callback in ajaxSubmit. I've changed my local copy but I
suspect others might want that as well.
That's a great
That sounds like a good solution to me. It puts the form code with other
form code.
I just started using the form plugin today and noticed that it doesn't pass
along the error callback in ajaxSubmit. I've changed my local copy but I
suspect others might want that as well.
That's a
The value for the Hidden field is hiddenValue and not secret. :)
Fixed. :-)
In the case of the checkboxes, if you check two boxes and use [EMAIL
PROTECTED]
fieldValue will only show the first value. That would need to go into the
array case like the select-multiple. But, if there is only
On 11/16/06, Dave Methvin [EMAIL PROTECTED] wrote:
If you specify json output in the $.ajax call and the resulting output isn't
well-formed json for any reason, it causes a javascript error on the eval in
$.ajaxData. Has anyone else encountered this? My quick fix was to wrap the
eval in a
The console output shows the altered array which contains a couple more
objects. But this data does not get put in the POST variables. Only the
unmodified data. Is that because formArray is a Pointer or something. Am at
a loss.
Yeah, you're creating a new array there. If you want to add
1 - 100 of 460 matches
Mail list logo