Re: [jQuery] Help Appending HTML

2006-09-19 Thread Mike Alsup
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 list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery selector to detect focus

2006-09-21 Thread Mike Alsup
> (a) How can we we bolt extra selector definitions to the JQuery library
> without modifying the JQuery.js file itself.

You can see an example of adding to jQuery's selection expressions here:
http://www.malsup.com/jquery/expr/

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Ajax numpty, stumbling around

2006-09-22 Thread Mike Alsup
I highly recommend using the form plugin to handle form submission.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Ajax numpty, stumbling around

2006-09-22 Thread Mike Alsup
> 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
http://jquery.com/discuss/


Re: [jQuery] Is the forms plugin documented anwhere

2006-09-23 Thread Mike Alsup
> 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/


[jQuery] Form plugin - move to core?

2006-09-24 Thread Mike Alsup
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 3 methods should just be added to core.  It's
been pointed out that core's serialize method is somewhat lacking.
The form plugin's serialize method handles every case that I've seen
questioned on this list.  Unfortunately, the two serialize methods
differ in their return types which probably adds more confusion.  But
rather than beef up core's serialize method why not converge the two
now and eliminate this confusion?

My personal preference would be to move the form plugin methods into
core, remove core's existing serialize method and introduce a
"serializeToString" (or something like that) that has a string return
type in the form of "name=value&name=value".  All this would increase
the size of core, but only by 2k before packing.

I'd love to hear opinions on this.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Global AJAX handlers

2006-09-24 Thread Mike Alsup
> 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

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin - move to core?

2006-09-24 Thread Mike Alsup
> 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. But in my thread I also point that param() method
> in jQuery core will only receive jQuery object or hash, but not a
> string at all. And I think param() method should also be changed.

Hi limodou,

The serialize method in forms.js handles multiple-select fields just
fine.  It does not return a hash, it returns an Array.  Each selected
option element is added to the array.  I have a test page that shows
this in action here: http://www.malsup.com/jquery/form/

Cheers.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Global AJAX handlers

2006-09-25 Thread Mike Alsup
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/


Re: [jQuery] Form plugin - move to core?

2006-09-25 Thread Mike Alsup
> 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 meeting my needs but rather just not
needing it (yet).

2. I knew it existed and had saved a local copy back in July.

3. I don't have any preference against using plugins.  I use several
on a regular basis.

To those following this discussion, the only reason I suggested moving
the form plugin into core was because there are so many questions
about form management and there seems to be an expectation that jquery
will solve these problems out of the box (which is not an unreasonable
expectation in my opinion).

Also, to clarify, the form plugin is not my plugin.  I was involved in
some of the discussion earlier this year but the form plugin was
really a collaborative effort by many, largely driven by Mark
Constable.

Cheers.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] find 2 different element types but keep dom order?

2006-09-25 Thread Mike Alsup
> 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
http://jquery.com/discuss/


Re: [jQuery] Form plugin's serialize(): performance issues

2006-09-27 Thread Mike Alsup
Seems to be faster rewriting it with a for loop instead of using each.
 Matt, can you confirm?

Mike



$.fn.serialize = function() {
var a = [];
var ok = {INPUT:true, TEXTAREA:true, OPTION:true};

var els = this[0].getElementsByTagName("*");
var l = els.length;
for (var i=0; i < l; i++) {
var el = els[i];
var par = el.parentNode;
var p = par.nodeName.toUpperCase();
var n = el.name || p == 'OPTGROUP' && par.parentNode.name || p 
==
'SELECT' && par.name || el.id;

if ( !n || el.disabled || el.type == 'reset' ||
(el.type == 'checkbox' || el.type == 'radio') && 
!el.checked ||
!ok[el.nodeName.toUpperCase()] ||
(el.type == 'submit' || el.type == 'image') && 
el.form.clicked != el ||
(p == 'SELECT' || p == 'OPTGROUP') && !el.selected ) 
continue;

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}
);

a.push({name: n, value: el.value});
};

return a;
};

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin's serialize(): performance issues

2006-09-27 Thread Mike Alsup
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(
{name: el.name+'_x', value: el.form.clicked_x},
{name: el.name+'_y', value: el.form.clicked_y}
);
continue;
}

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin's serialize(): performance issues

2006-09-27 Thread Mike Alsup
> 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/


Re: [jQuery] Form plugin's serialize(): performance issues

2006-09-27 Thread Mike Alsup
> 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
some folks have server-side code with ordering dependencies.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Signals and slots

2006-09-28 Thread Mike Alsup
> 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/


Re: [jQuery] Signals and slots

2006-09-28 Thread Mike Alsup
> I've reported to the list regularly: http://jquery.com/discuss/2006-May/#4964

Me too:  http://jquery.com/discuss/2006-July/#7201

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin's serialize(): performance issues

2006-09-28 Thread Mike Alsup
> 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 one I posted on this thread.  The
current impl in the form plugin is noticeably slower.  Here's the
results:

Current form plugin - average over 10 calls: 850ms
For-loop impl - average over 10 calls: 337ms
input,textarea,select impl - average over 10 calls: 379ms

Granted this is just one benchmark (in FF on windows), but I think the
for-loop impl holds up pretty well.

Mike Geary, I haven't yet implemented your outline.  I like it
stylistically, but I not expecting performance improvements.  Would
you agree or would you expect it to be faster than Renato's impl?

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] New Plugin - JTicker (newsticker)

2006-09-28 Thread Mike Alsup
> http://www.jasons-toolbox.com/JTicker/

Love the RSS support.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Getting Selectbox selected value. Works in IE not FF.

2006-09-28 Thread Mike Alsup
Rey,

$("#mySelect [EMAIL PROTECTED]")

That syntax should definitely work.  And it used to.  If I go back in
time and run version 169 it works fine in FF.  Somewhere along the
line this broke.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin's serialize(): performance issues

2006-09-28 Thread Mike Alsup
> 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() {
$("#go").click(function() {
window.console.time("mike");
var x = $('#theform').serialize();
window.console.timeEnd("mike");
alert (x);
return false;
});
});

I'm alerting the response just to make sure each serialize method is
working correctly.  I don't know that this is a "fair" test either,
but it's one data point anyway.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.0.2 RC1

2006-10-02 Thread Mike Alsup
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 (it shouldn't): http://joern.jquery.com/dist/jquery.js
> The updated test suite is here: http://joern.jquery.com/test/
> According to my tests, FF1.5 and IE6 should fail in 1, Opera in 2 of 242
> tests. Test result for IE5.5 and Safari are appreciated.
>
> This release contains only one new feature, the ifelse method, see the
> updated docs for details: http://joern.jquery.com/docs/
>
> If you are interested in which bugs have been closed:
> http://jquery.com/dev/bugs/10/
>
> It shouldn't be long till the official 1.0.2 release :-)
>
> -- Jörn
>
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Fast form serializer function for review

2006-10-03 Thread Mike Alsup
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 got the following results:

muliple-select element w/500 options:
new 'each' impl (ave of 10 tests): 113ms
for-loop impl (ave of 10 tests): 104ms

single-select element w/500 options:
new 'each' impl (ave of 10 tests): 7ms
for-loop impl (ave of 10 tests): 103ms

So I think this new serialize method is pretty damn good!  Is there
*anyone* out there that cares about the semantic ordering of the
posted values?  Personally, I do not, and I definitely would like to
have only a single serialize method.  Maybe the semantic version could
be left as a separate plugin for anyone that needs that capability.  I
vote for updating the form plugin with this new version.

Mike



On 10/3/06, Matt Grimm <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I've put together a fast form serializer function that I'm hoping can
> get some review from the list for completeness, bugs, a better name,
> etc. A previous thread revealed quite a performance issue with the form
> plugin's existing serialize function when operating on a form with a
> large number of elements. My plugin sacrifices semantic order for wicked
> speed. I have a test form with a select menu containing 500 options --
> with the current serializer, it takes around 5 full seconds to do the
> job, and with mine, it takes about 50 ms. Any feedback would be much
> appreciated, including whether you think this should be included with
> the form plugin distribution.
>
> Since this isn't a plugin, I'm just going to include the source in this
> message -- please let me know if there's a better (i.e., more polite)
> way to do this.
>
> Thanks!
>
> m.
>
> ---
>
> $.fn.fastSerialize = function() {
> var a = [];
> var f = ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'];
>
> $(f.join(','), this).each(function() {
> var n = this.name || this.id;
> var t = this.type;
>
> if (!n || this.disabled || t == 'reset' ||
>(t == 'checkbox' || t == 'radio') && !this.checked ||
>(t == 'submit' || t == 'image' || t == 'button') &&
> this.form.clicked != this ||
>this.tagName == 'SELECT' && this.selectedIndex == -1)
> return;
>
> if (t == 'image' && this.form.clicked_x)
> return a.push(
> {name: n+'_x', value: this.form.clicked_x},
> {name: n+'_y', value: this.form.clicked_y}
> );
>
> if (t == 'select-multiple') {
> $('option', this).each( function() {
> if (this.selected)
> a.push({name: n, value: this.value ||
> $(this).text()});
> });
> return;
> }
>
> a.push({name: n, value: this.value});
> });
>
> return a;
> };
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Fast form serializer function for review

2006-10-03 Thread Mike Alsup
Or better yet:

$('option:selected')...

Also, I think I'd get rid of this:

var n = this.name || this.id;

because the id should not be used for the name.  I think that's always
been wrong and it would result in a different behavior when javascript
is disabled.

Mike

On 10/3/06, Webunity | Gilles van den Hoven <[EMAIL PROTECTED]> wrote:
> Mat,
>
> This code:
>
> > if (t == 'select-multiple') {
> > $('option', this).each( function() {
> > if (this.selected)
> > a.push({name: n, value: this.value ||
> > $(this).text()});
> > });
> > return;
> > }
>
> Can be changed to this, if i am right ;)
>
> > if (t == 'select-multiple') {
> > $('[EMAIL PROTECTED]"selected"]', this).each( function() {
> > a.push({name: n, value: this.value || $(this).text()});
> > });
> > return;
> > }
>
> Other then that,
>
> Great code!
>
> -- Gilles
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Fast form serializer function for review

2006-10-03 Thread Mike Alsup
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
> entered.  That would be perfect.
>
> The documentation should then make clear that the "retainOrder" option
> will be slower for large forms.
>
> - Brian
>
>
> > I wonder if we could reduce the overall code
> > by merging both seriliaze methods.
> >
> > -- Jörn
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Fast form serializer function for review

2006-10-03 Thread Mike Alsup
This would still work.  Semantic ordering will be retained within
element type, just not cross-type.  In Matt's method you'd get all the
inputs (in order), then all the textareas, etc.

Mike

> Yes, I care.
>
> Case:
> An unchecked checkbox doesn't post. However, you usually want to work
> with an on/off value. I use this construct (stolen from Rails I
> think):
>
> 
> 
>
> This way, when the checkbox is not checked, "offValue" is posted for
> foo. When checked, "onValue" is posted.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] FastSerialize plugin posted in wiki

2006-10-03 Thread Mike Alsup
> 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 that to each of the form plugin's methods... what do you think?

It's certainly not up to me but I'm all for it.  Nice work pulling it
all together, Matt.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Prototype

2006-10-06 Thread Mike Alsup
I agree completely.  I'll update my plugins today.

Mike

>
> I think 'jQuery(...)' should still be used internally and by plugin
> authors for the foreseeable future. If file size is an issue, the code
> could always be compressed/packed.
>
> I would say keep $ as the alias. If there are conflicts, you could
> always set up an alias for your own site. i.e.
> $jq = jQuery

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] 'fast' serialize and 'semantic' serialize method

2006-10-06 Thread Mike Alsup
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 right in with minor changes.

I've re-written the form plugin to use this and changed the invoking
methods.  Unfortunately I can't post it from inside my firewall at the
moment.  In a nutshell, the changes boil down to adding a 'semantic'
arg to each method and passing that arg along to 'serialize'.

Mike



jQuery.fn.serialize = function(semantic) {
var a = [];

if (semantic) {
var ok = {input:true, textarea:true, select:true, button:true};
var jq = jQuery('*', this).not('option');
}
else {
var jq = jQuery('input,textarea,select,button', this);
}

jq.each(function() {
if (semantic && !ok[this.nodeName.toLowerCase()])
return;

var n = this.name;
var t = this.type;

if ( !n || this.disabled || t == 'reset' ||
(t == 'checkbox' || t == 'radio') && !this.checked ||
(t == 'submit' || t == 'image' || t == 'button') &&
this.form.clicked != this ||
this.tagName.toLowerCase() == 'select' && this.selectedIndex == -1)
return;

if (t == 'image' && this.form.clicked_x)
return a.push(
{name: n+'_x', value: this.form.clicked_x},
{name: n+'_y', value: this.form.clicked_y}
);

if (t == 'select-multiple') {
jQuery('option:selected', this).each( function() {
a.push({name: n, value: this.value});
});
return;
}

a.push({name: n, value: this.value});
});

return a;
};

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] 'fast' serialize and 'semantic' serialize method

2006-10-06 Thread Mike Alsup
> $('*: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 mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] 'fast' serialize and 'semantic' serialize method

2006-10-06 Thread Mike Alsup
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 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 mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] downloading plugins?

2006-10-07 Thread Mike Alsup
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/


Re: [jQuery] jQuery 1.0.2 RC2

2006-10-08 Thread Mike Alsup
Test #38 fails in Opera 8.54.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.0.2 RC2

2006-10-08 Thread Mike Alsup
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.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.0.2 RC2

2006-10-08 Thread Mike Alsup
> From , follow the "show other versions" link.

Thanks, Choan.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin: default method

2006-10-10 Thread Mike Alsup
> 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/


Re: [jQuery] Form plugin: default method

2006-10-10 Thread Mike Alsup
Another form thing...  this line in ajaxSubmit:

vars.push({name: 'evaljs', value: 1});

seems to be left over from an older version.  I don't believe we need
this anymore.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] IE7 and document.ready

2006-10-10 Thread Mike Alsup
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
http://jquery.com/discuss/


[jQuery] form plugin updates

2006-10-10 Thread Mike Alsup
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).  So I reworked ajaxForm() to use the
dimensions plugin (if it is installed).  If your page doesn't include
the dimensions plugin then the cross-browser support for image submit
elements is unreliable.

I've posted an updated form.js along with an updated test form here:
http://www.malsup.com/jquery/form/

It seems to work correctly in Opera, FF and IE (6 & 7).  I'd
appreciate it if anyone with access to other browsers could test it
out.

The plugin is now 1.70KB when packed. At some point it would be nice
to role the changes from the past few weeks back into SVN and
determine if it might be a core candidate at that point.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] form plugin updates

2006-10-10 Thread Mike Alsup
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 input value and not the form attributes.
> Some fixes are proposed in bug report.
>
> Renato

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Error in latest svn jquery.js (427)

2006-10-11 Thread Mike Alsup
In the attr method the following barfs:

var fix = {
...
cssFloat: fix["float"],
...
};

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] form plugin updates

2006-10-11 Thread Mike Alsup
> > 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 plugin are not compatible. The first
> serializes the current elements to a query string, the second starts
> with a form and serializes all descendent form elements to an array.

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 another 2K to core.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] form plugin updates

2006-10-11 Thread Mike Alsup
> 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 another 2K to core.

Also, the serialize method in core is really not useful for forms, yet
it returns a string in the format: name1=value1&name2=value2...  When
would you do this other than when processing a form?  And if you're
processing a form, why wouldn't you want to handle it correctly (like
supporting option elements, etc)?

I'm starting to think it makes more sense to have a serialize and a
serializeToArray method which both use the logic currently found in
the form plugin.  The form's ajaxSubmit and ajaxForm methods would use
serializeToArray.  I don't even think this would break code that
currently uses serialize from core.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] form plugin updates

2006-10-11 Thread Mike Alsup
> I don't even think this would break code that currently uses serialize from 
> core.

That's probably not true.  Current usage would probably need to be updated from:

var s = $('input,textarea').serialize();

to:

var s = $('#myForm').serialize();

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] form plugin for dummies

2006-10-11 Thread Mike Alsup
> I have been trying to figure out how I could use the form plugin
> (http://jquery.com/dev/svn/plugins/form/form.js).  I'm aware of the examples
> embedded in the code but I guess this is to advanced for me.  Is there
> documention for dummies somewhere on this plugin ? or a demo ?

Pierre,

You can see a demo here:  http://malsup.com/jquery/form/

Be aware that this demo is not using the "official" plugin.  It
includes a few improvements brought on by discussion on this list over
the last few weeks which have not yet been migrated back into the main
code base.  The usage, however, is the same.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Form plugin revisited ;-)

2006-10-12 Thread Mike Alsup
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 suggestion.
3. Fixed ticket #160 using suggestions from Renato and Jörn.
4. Fixed bug in ajaxSubmit which caused inconsistent callback args in
post-callback method.
5. Fixed bug in image submit element coordinates (requires dimensions plugin)
6. Updated documentation in the source file.

I think (hope) everyone is on-board with the changes listed above.
I'm also suggesting two other changes:

1. Rename form plugin's current "serialize" method to "formToArray"
2. Create a new "serialize" method in the plugin which returns the '&'
delimited string.

These last two items may cause issues for some but to me they are far
more intuitive than what we currently have and I think the discussions
earlier this week were leading in this direction.  Currently, the form
plugin's "serialize" method returns an array of objects and core's
"serialize" method returns a '&' delimited string.

On a final note, I've updated the demo page to include a link to run
the unit tests.  If some of you Safari users could run the unit tests
I would appreciate it.

Demo page: http://malsup.com/jquery/form/
Unit test: http://malsup.com/jquery/form/test.html

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] More jQuery Tutorials (was "unsuscribe")

2006-10-12 Thread Mike Alsup
> 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/


Re: [jQuery] Form plugin revisited ;-)

2006-10-13 Thread Mike Alsup
> 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 in the array.

That's a great idea, Jörn.  I prefer that to adding to the array since
the jQuery object will be able to provide everything anyone could
need.

> Great to see the testrunner in action for something else then jQuery itself. 
> The code looks
> like you just wrote that directly into the html page, instead of generating 
> it, right?

Yes, it's all just hard-coded into the test page.

> selecting $(':input', context) should be the same as $('*', 
> context).filter(':input'), but faster.

Thanks for the tip.  I'll take a look at that.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Weird IE issue with two .corner()'d divs butted up against each other vertically.

2006-10-13 Thread Mike Alsup
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 <[EMAIL PROTECTED]> wrote:
> An example can be found at http://1wordreviews.com/ when you click on the
> "login" or "register" links. I have two classes of divs, .legend & .fieldset
> (legacy naming from when I was actually using fieldsets). When I set the
> .legend to have rounded top corners and the .fieldset div to have rounded
> bottom corners, a little floating portion of the .fieldset div shows up
> below the entire section. The problem goes away if I insert a space in
> between the divs.
>
> All of the related display code is there if you view source.
>
> Any ideas would be both helpful and appreciated. Thanks in advance. :)
>
> Mike DeFreitas
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin revisited ;-)

2006-10-13 Thread Mike Alsup
Jörn,

I see negligible performance gains using $(:input, ctx) vs the current
$('*:not(option)', ctx), however it does make the code cleaner because
I can get rid of the 'ok' array.

formToArray now looks like this:

jQuery.fn.formToArray = function(semantic) {
var a = [];
var q = semantic ? ':input' : 'input,textarea,select,button';

jQuery(q, this).each(function() {
var n = this.name;
var t = this.type;

if ( !n || this.disabled || t == 'reset' ||
(t == 'checkbox' || t == 'radio') && !this.checked ||
(t == 'submit' || t == 'image' || t == 'button') &&
this.form && this.form.clk != this ||
this.tagName.toLowerCase() == 'select' && this.selectedIndex == -1)
return;
if (t == 'image' && this.form.clk_x != undefined)
return a.push(
{name: n+'_x', value: this.form.clk_x},
{name: n+'_y', value: this.form.clk_y}
);
if (t == 'select-multiple') {
jQuery('option:selected', this).each( function() {
a.push({name: n, value: this.value});
});
return;
}
a.push({name: n, value: this.value});
});
return a;
};

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin revisited ;-)

2006-10-13 Thread Mike Alsup
> That looks pretty nice. But you would still need some way to return the
> jQuery object for use in a pre-callback. I need that to integrate my
> validation stuff with the form plugin :-)

Yes, the pre-submit callback is invoked from the ajaxSubmit() method
and it will be passed the array and the jQuery object.  I've coded and
tested that already and will upload it tonight.  Thanks for your ideas
on that.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin revisited ;-)

2006-10-13 Thread Mike Alsup
> How does jQuery(':input', this) differ from
> jQuery('input,textarea,select,button', this) ?

Great question, Aaron,
The ":input" selector will grab all elements and then filter them
using a regex match of the nodeName against
"input|select|textarea|button".  On the other hand, the
"input,textarea,select,button" selector will grab only those elements
(using getElementsByTagName I believe) and it will grab them *in that
order*.  So the first expression guarantees us semantic ordering of
the selected elements but is slower due to the regex matching.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin Authoring

2006-10-15 Thread Mike Alsup
> I'd like to point to a small change I made recently to the jQuery
> Plugins Authoring article, for all those who take others code as
> reference. The "reference code" to define defaults and parse options now
> looks like this:

I like this push for consistency.  Does it make sense to do this now
for the 1.0.3 release or wait for 1.1?  Specifically, I'm thinking of
the form plugin.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin revisited ;-)

2006-10-15 Thread Mike Alsup
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 = function(target, post_cb, pre_cb, url, mth,
> semantic) {
>  var a = this.formToArray(semantic);
>  var m = this.attr('method') || 'GET';
>
>  // give pre-callback opportunity to abort the submit
>  if (pre_cb && pre_cb.constructor == Function && pre_cb(a, this) ===
> false) return;
>
>  url = url || this.attr('action') || '';
>
>  // if no target or 'post' callback was provided then default to a
> callback
>  // that evals the response
>  var t = target || post_cb || function(r) {
>  if (r.responseText) eval.call(window, r.responseText)
>  };
>
>  if (t && t.constructor == String)
>  if (m == 'GET')
>  jQuery(t).load(url + '?' + jQuery.param(a), post_cb);
>  else
>  jQuery(t).load(url, a, post_cb);
>  else
>  jQuery.ajax({ url: url, success: t, data: jQuery.param(a),
> type: mth || m});
>  return this;
> };

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Form plugin revisited ;-)

2006-10-17 Thread Mike Alsup
> 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 includes the changes
discussed earlier on this thread along with the 'GET' bug fix that
Klaus pointed out.

The big change to be aware of is that the "serialize" method now
returns a '&' delimited string suitable for posting/getting.  The
"formToArray" method returns an array of objects which represent the
form data (full documentation inline).

Also worth noting is that the "target" argument to "ajaxSubmit" and
"ajaxForm" can now be a jQuery selector string, a jQuery object, or a
DOM element.

As always, sample usage can be found at:

http://malsup.com/jquery/form/

Thanks to everyone for all the good discussion and good ideas.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Unable to bind click function in a dynamically created object?

2006-10-18 Thread Mike Alsup
> 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) {



// Watch for when a jQuery object is passed at the context
if ( c && c.jquery )
return jQuery( c ).find(a);

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Bug in Firefox with e.target?

2006-10-19 Thread Mike Alsup
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 following page:
>
> http://stilbuero.de/demo/jquery/etarget.html
>
> If you click on the link the target of the click event (attached to )
> is alerted. In that case it is an  element, but Firefox reports
> an HTMLSpanElement. Safari is ok.
>
> Does anyone know what is going on?
>
> -- Klaus
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery history plugin - from making the back button work to a more elaborate Hijax solution

2006-10-19 Thread Mike Alsup
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.


> Why not implement a better solution for being able to implement Hijax
> the easy way
> ... snip ...
> That concept would of course involve the back-end as well. There it must
> be decided upon the "X-Requested-With" request header what to send back
> (whole page or only the part of the page that needs to be updated.

I think this is the way to go.  The original markup must have the
correct urls so that the page degrades.  I would consider that a
requirement.

I think it is also a requirement to make sure it is easy to change the
href that gets loaded (which you've done).  That way I could achieve
the desired results without X-Requested-With logic on the server.
Using templates or SSI I could structure my docs so that a call to
"mydoc.html" returns the full page and a call to "mydoc-p1.html"
returns paragraph one only.  Using the plugin on your demo page I
could then rewire the anchor click events like:

...
$('#chapter').load('mydoc-p' + i '.html');
...

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] nice plugin idea - Splitter

2006-10-19 Thread Mike Alsup
> 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
technically and visually.

Armand, I'd love to see a jQuery splitter widget too.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Tabs plugin 2.0

2006-10-20 Thread Mike Alsup
Hi Klaus,

Great stuff with the tabs plugin.

I was wondering about these 2.0 changes.  Are you going to check this
in to svn?  I've reworked the form plugin to use the preferred
"options" model too but I don't know what to do with it now since
we're still in a 1.0.3 release cycle .  Do we hold off checking API
changes in?  Make it available elsewhere?  Anyone have thoughts on how
to best manage this?

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Tabs plugin 2.0

2006-10-20 Thread Mike Alsup
> 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
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] forms plugin how to implement a preCallBack function to validate inputs

2006-10-21 Thread Mike Alsup
> 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 that
looks suspicious is your use of ".value" on the jQuery object.  I
think you want ".val()" there instead.

You can see an example of the callbacks in action here:

http://malsup.com/jquery/form

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Another update for form.js

2006-10-23 Thread Mike Alsup
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:

-

The following options are supported:

target:   Identifies the element(s) in the page to be updated with the
server response.
  This value may be specified as a jQuery selection string, a
jQuery object,
  or a DOM element.
  default value: null

url:  URL to which the form data will be submitted.
  default value: value of form's 'action' attribute

method:   The method in which the form data should be submitted, 'GET'
or 'POST'.
  default value: value of form's 'method' attribute (or 'GET'
if none found)

before:   Callback method to be invoked before the form is submitted.
  default value: null

after:Callback method to be invoked after the form has been
successfully submitted.
  default value: null

dataType: Expected dataType of the response.  One of: null, 'xml',
'script', or 'json'
  default value: null

semantic: Boolean flag indicating whether data must be submitted in
semantic order
  default value: false

...

The dataType option provides a means for specifying how the server
response should be handled.  This maps directly to the jQuery.httpData
method so the following values are supported:

  'xml':if dataType == 'xml' the server response is treated as XML
and the 'after'
  callback method will be passed the responseXML value
  'json':   if dataType == 'json' the server response will be
evaluated and passed to
  the 'after' callback
  'script': if dataType == 'script' the server response is evaluated
in the global context

-

I've updated the example page and unit tests to reflect these updates:

http://malsup.com/jquery/form/

Note: Like the previous update, this version of form.js requires
jQuery 1.02 or later.

Cheers.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Another update for form.js

2006-10-24 Thread Mike Alsup
> 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
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Window Dialogues

2006-10-24 Thread Mike Alsup
> 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!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Another update for form.js

2006-10-25 Thread Mike Alsup
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/


Re: [jQuery] Visual jQuery Announcement

2006-10-27 Thread Mike Alsup
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.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery API and docs

2006-10-30 Thread Mike Alsup
> > 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.  For example:

@param Number|String integer value in the range [0-1000]

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] moddify the title tag

2006-10-30 Thread Mike Alsup
> 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/


Re: [jQuery] Form plugin: overload serialize no no

2006-10-30 Thread Mike Alsup
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 about
> merging jQuery and the form plugin, then the better one should go
> first.

and also because I thought that was the group consensus.  One question
I posed back then was, "Why would you want to serialize form elements
in a way that does not correctly utilize the element state?"  In other
words, why submit controls that are not "successful"[1]?  I guess your
on-the-fly validation falls into that category.

> jQuerys serialize is a more general tool for serialization, I think.

I guess.  It's either a "more general" tool or a "broken" tool.  :-)
It's one of those methods that requires a "buyer beware" sign.  I have
no problem changing the form plugin's serialize method to
formSerialize.  Anyone disagree with doing so?

Mike

[1] http://www.w3.org/TR/html4/interact/forms.html#successful-controls

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery Corner Problem

2006-10-31 Thread Mike Alsup
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 the element, it doesn't scale at all.
> > Hope this makes sense. Anyone run into this or know how to fix this?
> >
> > Thanks.
> >
>
> I had the same yesterday, the examples on the demo page are using a
> padding of 20px ... that with the height is not working properly
> (ignoring the height ?). I now also just use the padding to make the
> rounded box bigger/smaller not the best way i think but it works...

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] append quicktime plugin

2006-11-06 Thread Mike Alsup
> 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/


Re: [jQuery] append quicktime plugin

2006-11-06 Thread Mike Alsup
>   $("#qtDiv").html($("#qtDiv).html() . $newHTML)

Yes, except with Javascript syntax instead of php.  :-)

var qtHtml = "http://jquery.com/discuss/


Re: [jQuery] jQuery's build.xml. Question on ?

2006-11-08 Thread Mike Alsup
> 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/


Re: [jQuery] Allow onclick (etc) on disabled input

2006-11-08 Thread Mike Alsup
> 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, Brian!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] New jQuery Plugin - Star Rating

2006-11-08 Thread Mike Alsup
> http://sandbox.wilstuckey.com/jquery-ratings/

Great stuff, Will.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery's build.xml. Question on ?

2006-11-08 Thread Mike Alsup
> 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/


[jQuery] Update notice: form plugin bug fixed

2006-11-08 Thread Mike Alsup
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

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Media plugins

2006-11-08 Thread Mike Alsup
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/


Re: [jQuery] Media plugins

2006-11-09 Thread Mike Alsup
> 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
disabled.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Media plugins

2006-11-09 Thread Mike Alsup
> 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
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.getJSON ?

2006-11-09 Thread Mike Alsup
> at the moment i'm just using jQuery 1.0.1.

getJSON wasn't added to jQuery until ver 1.0.2.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.getJSON ?

2006-11-09 Thread Mike Alsup
> 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/


Re: [jQuery] Media plugins

2006-11-09 Thread Mike Alsup
> 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/


Re: [jQuery] does jQuery has support for parameter handling ?

2006-11-09 Thread Mike Alsup
> var newtest = decodeURIComponent(test);
>
> I get the error "malformed URI sequence".

Try this:

var newtest = decodeURI(encodeURI(test));

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.get - Retrieving XML Docs

2006-11-09 Thread Mike Alsup
> 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");

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
> 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:
http://jquery.com/dev/svn/trunk/plugins/form/form.js?format=txt

It works with all of the released versions of jQuery (1.0 and later).

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
> 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
http://jquery.com/discuss/


Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
> 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 list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
> 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.  $.ajax supports a lot of options and having some
of them defaulted properly via $.get and $.post makes sense.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
> 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/


Re: [jQuery] new jQuery API draft

2006-11-11 Thread Mike Alsup
> 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/


Re: [jQuery] How I use jQuery

2006-11-11 Thread Mike Alsup
> http://www.incomesolutions.com.au/

That's a good looking site, Joel.  Well done.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Loop through all elements of a form

2006-11-11 Thread Mike Alsup
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 inputs with a text type, just use this:

Be careful with :input.  It selects button elements too and resetting
the button element's value to "" is probably not what you want to do.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-14 Thread Mike Alsup
> 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 than the ajax functions.  I use the ajax functions on every
project but only occasionally dabble in the fx stuff.  I see that more
as fluff.

Regarding core's serialization functionality, the form plugin actually
calls the core method (jQuery.param) for serialization once it has
figured out what to serialize.  In addition, its usage is pattern is
slightly different because it's context is always the containing
object.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] .empty() not emptying...

2006-11-15 Thread Mike Alsup
For cross-browser success, use this:

$('#id')[0].value = "";

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
>  I have to admit, I didn't understand that $.val() was limited to only input
> elements, and I expected it to get the value of any element.

val() is confusing because of its hybrid nature.  Only a few elements
support the "value" attribute (input, option, button and param), but
any object *could* have a value property, and some, most notably the
select element, always do.

And there are cross browser issues of course.  For example, IE
promotes a button's text to be its "value" but FF does not.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
>  So this function *could* retrieve the value of the selected option in a
> select box?

Better than *could* - it *does*.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
> 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 mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
> only a few of us who were confused), then maybe you're right about
> abandoning .val(). It doesn't have to leave the code base, but knowing that
> the .attr() is seemingly a better alternative is helpful.

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.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  1   2   3   4   5   6   >