Re: [jQuery] Remove from JSON

2006-12-14 Thread Michael Geary
> I suppose this touches on off topic, but ... is it possible 
> to remove an entry completely from a JSON hash?
> 
> say I have
> {
> firstString: 'first',
> secondString: 'second'
> }
> 
> and evaluate this into a json object, and I want to remove 
> firstString, could I do something like 
> json.remove(json.firstString); ?

Well, JSON is just a notation. Once you evaluate it, it's not JSON any more.
It's a JavaScript object. It doesn't matter whether the object started out
as JSON notation, or was built up using other JavaScript code, it works the
same either way.

Those entries in the object are called properties. So that means the
question is really, "How do I delete a property from a JavaScript object."
That leads to a useful search:

http://www.google.com/search?q=remove+property+from+javascript+object

-Mike


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


Re: [jQuery] Finished: jQuery code assist in Aptana

2006-12-14 Thread SDisk SDisk

Wow! thanks a lot! this is that I want :)

2006/12/14, Edwin Martin <[EMAIL PROTECTED]>:


Hi,

I like jQuery and I like Aptana and was very frustrated jQuery didn't
had code assist (auto-completion) in Aptana.

And I think I'm not the only one :-)

I created the scriptdoc-file needed for code assist in Aptana.

You can download it here:

http://www.bitstorm.org/edwin/jquery/

It's all quite new, so it might not work 100%.

Please share your experiences.

Edwin Martin

--
http://www.bitstorm.org/edwin/en/


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

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


[jQuery] Remove from JSON

2006-12-14 Thread Andreas Wahlin
I suppose this touches on off topic, but ... is it possible to remove  
an entry completely from a JSON hash?

say I have
{
firstString: 'first',
secondString: 'second'
}

and evaluate this into a json object, and I want to remove  
firstString, could I do something like
json.remove(json.firstString);
?

Andreas

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


Re: [jQuery] a jquery button

2006-12-14 Thread Karl Swedberg

On Dec 14, 2006, at 11:14 PM, bmsterling wrote:


hey all, is there a "built with jquery" button, something like what  
you get

for valid css or html?

gotta give jquery is props :)


Hi Benjamin,

Check out the jQuery blog entry:

http://jquery.com/blog/2006/11/07/jquery-button-contest-winners/


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com




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


[jQuery] a jquery button

2006-12-14 Thread bmsterling

hey all, is there a "built with jquery" button, something like what you get
for valid css or html?

gotta give jquery is props :)
-- 
View this message in context: 
http://www.nabble.com/a-jquery-button-tf2825088.html#a7886017
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Fix: ExternalInterface breaks jQuery in firefox 2

2006-12-14 Thread Karl Swedberg

On Dec 14, 2006, at 6:30 PM, nrwsteff wrote:

FF 2.0 & firebug  1.0beta cause a lot of problems - even on sites  
without

jQuery :)



I've noticed that, too. Firebug 1.0beta does not like the FCKEditor  
at all. Good thing that it's easy to disable Firebug on a per-site basis



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com


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


Re: [jQuery] find cause of uncaught exception

2006-12-14 Thread Bruce McKenzie
well, whatever it was, it was cured by installing jquery v. 1.4. Whew.


bmckenzie said the following on 12/10/2006 4:15 PM:
> Hi.
> 
> Can someone point me to the likely cause of this error:
> 
> uncaught exception: [Exception... "Component returned failure code:
> 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.setRequestHeader]"
> nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
> http://localhost/public_html/js/jquery/jquery.js :: anonymous :: line 1"
> data: no]
> 
> It's triggered by a script (which I've pared down for debugging) that runs
> in a thickbox iframe:
> 
> $( '#newProjectSubmit').click(function(){
>   $.ajax({
> url:  'projects.pl' ,
> type: "POST",
> data:  {Fred:'1'}, 
> dataType:'html',
> complete: function(){alert('done')}
>   });
> });
> 
> This is with FF 2.0. All my other Ajax scripts  are working -- and this one
> used to ... maybe it's something to do with  FF version?
> 
> Thx,
> 
> Bruce

-- 
Bruce McKenzie
Business Information Graphics, Inc.
242 W. 36th Street
10th Floor
New York, NY 10018

v. 212-477-4288
http://www.2MinuteExplainer.com

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


Re: [jQuery] Function: $(...).ancestorsTo(match)

2006-12-14 Thread Dave Methvin
> Has anyone undertaken this plugin? I wasn't able
> to find it in SVN under plugins. 
 
It's hiding in a bug report. :)
 
http://jquery.com/dev/bugs/bug/249/
 
 
 
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Off-Topic: Rounded Corners

2006-12-14 Thread Rey Bango
I know they're easy. There's plenty of CSS-based implementations to 
choose from and even a plugin for it on the plugins page. The site is a 
something else to add to your arsenal. :)

Rey...

Erik Beeson wrote:
> Rounded corners are easy:
> 
> border-radius: 10px;
> -moz-border-radius: 10px;
> 
> And a link to http://www.getfirefox.com/
> 
> --Erik
> 
> On 12/14/06, *Rey Bango* <[EMAIL PROTECTED] > 
> wrote:
> 
> Just a very quick note about a site that I found that will generate
> rounded corners on the fly. The site is:
> 
> http://wigflip.com/cornershop/
> 
> While this isn't about jQuery, I know that rounded corners are the rage
> and some people might find this useful.
> 
> Rey...
> 
> ___
> jQuery mailing list
> discuss@jquery.com 
> http://jquery.com/discuss/
> 
> 
> 
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/

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


Re: [jQuery] Off-Topic: Rounded Corners

2006-12-14 Thread Chris Domigan

On 15/12/06, Erik Beeson <[EMAIL PROTECTED]> wrote:


Rounded corners are easy:

border-radius: 10px;
-moz-border-radius: 10px;

And a link to http://www.getfirefox.com/

--Erik




And in the latest Firefox 3 Alpha and nightlies, they're now anti-aliased!
Very purdy.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Off-Topic: Rounded Corners

2006-12-14 Thread Erik Beeson

Rounded corners are easy:

border-radius: 10px;
-moz-border-radius: 10px;

And a link to http://www.getfirefox.com/

--Erik

On 12/14/06, Rey Bango <[EMAIL PROTECTED]> wrote:


Just a very quick note about a site that I found that will generate
rounded corners on the fly. The site is:

http://wigflip.com/cornershop/

While this isn't about jQuery, I know that rounded corners are the rage
and some people might find this useful.

Rey...

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

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


Re: [jQuery] Jquery Flash Plugin & the FlashBlock Extension

2006-12-14 Thread Luke Lutman
Hi Sam,

I had a look, and FlashBlock blocked UFO and SWFObject movies, and sIFR 
showed the alternate content, so I'm guessing that by 'works with 
flashblock', you mean that the alternate content is show when flashblock 
is on, correct?

 From what I can tell, Flashblock looks for two things specific to sIFR:
- ..., which it hides with 
inline styles (can be any element).
- ..., and it shows with inline 
styles (has to be a span).

To get the same behavior with the jQuery Flash Plugin, you can change 
the default replace function, like so:

jQuery.fn.flash.replace = function(htmlOptions) {
this.innerHTML = ''+this.innerHTML+'';
jQuery(this)
.addClass('flash-replaced')
.addClass('sIFR-replaced')
.prepend($$.transform(htmlOptions));
};

Here's an example:
http://jquery.lukelutman.com/plugins/flash/example-flashblock.html

Luke

Sam Sherlock wrote:
> I have noticed that the flash plugin does not work with the flashBlock 
> firefox extension
> whereas the both swfObject, UFO & sIFR do work with the extension.
> 
> In firefox with flashBlock installed and blocking flash content the 
> flash is not displayed
> nor is the content that it replaces.
> 
> I have looked at the source but its a bit beyond me.  Would this be 
> complicated to
> build into the plugin?
> 
> 
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/


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


[jQuery] Off-Topic: Rounded Corners

2006-12-14 Thread Rey Bango
Just a very quick note about a site that I found that will generate 
rounded corners on the fly. The site is:

http://wigflip.com/cornershop/

While this isn't about jQuery, I know that rounded corners are the rage 
and some people might find this useful.

Rey...

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


Re: [jQuery] Empty each text field

2006-12-14 Thread Chris Domigan

Mungbeans - remember "this" in the context you are using it is a normal DOM
node, so you can't use jQuery methods like .val on it. You can do
$(this).val() instead.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] How to make radio button selected?

2006-12-14 Thread Alex Cook
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Sean O
Subject: [jQuery] How to make radio button selected?

Based on what is typed, I want one of two radio buttons with the same
name,
but distinct IDs, to be selected.  I have the RegEx working fine to pick
out
unique strings in the text box, but can't get the rest.

Tips?

-

Sure, take a glance at this:

http://pastie.caboo.se/27710

You can plug in your RegEx where I'm simply checking for 'red' or 'blue'
to extend the flexibility a bit, but this should get you pointed in the
right direction.  For example you'll probably want to add some check to
see if the text is changed after a radio button is selected and if the
value still passes the  check, and if not clears all selected radio
buttons.

-ALEX

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


Re: [jQuery] Empty each text field

2006-12-14 Thread Blair McKenzie

$('[EMAIL PROTECTED]"text"]').val("")

On 12/15/06, Mungbeans <[EMAIL PROTECTED]> wrote:



I want to empty every text field in a given form.  So far this isn't
working:

$('[EMAIL PROTECTED]"text"]').each(function(){ this.val = ""; });


--
View this message in context:
http://www.nabble.com/Empty-each-text-field-tf2824412.html#a7884125
Sent from the JQuery mailing list archive at Nabble.com.


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

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


Re: [jQuery] Empty each text field

2006-12-14 Thread spinnach
Mungbeans wrote:
> I want to empty every text field in a given form.  So far this isn't working:
>
>   $('[EMAIL PROTECTED]"text"]').each(function(){ this.val = ""; });
>
>
>   
try $('[EMAIL PROTECTED]"text"]').val("");


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


[jQuery] Empty each text field

2006-12-14 Thread Mungbeans

I want to empty every text field in a given form.  So far this isn't working:

$('[EMAIL PROTECTED]"text"]').each(function(){ this.val = ""; });


-- 
View this message in context: 
http://www.nabble.com/Empty-each-text-field-tf2824412.html#a7884125
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Fix: ExternalInterface breaks jQuery in firefox 2

2006-12-14 Thread Klaus Hartl
nrwsteff schrieb:
> offtopic question:
> unfortunately it's not possible to have two or more versions of firefox on
> the same machine - 
> the new windows installer uninstalls all older versions prior to FF2.0 :(( -
> or did you
> know a possibility to have both versions (FF1.5 & 2.0) installed on one
> machine? 
> older mozilla/ff versions are also available as a ZIP archives wich can be
> copied to any 
> programs folder without any installation.
> 
> stefan

Stefan, just install different Firefox versions in different directories 
(you have to check custom installation I guess). To be able to run them 
side by side (Windows) with different profiles I created batch files 
like in this instruction:
http://the-edmeister.home.comcast.net//advice-html/simultaneous-profiles_versions.html


-- Klaus


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


Re: [jQuery] jQuery and Rails

2006-12-14 Thread Yehuda Katz

Let me know. I strongly believe in extraction over abstraction. If you have
any specific questions as you start to use Rails, let me know.

-- Yehuda

On 12/14/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:


Yehuda Katz schrieb:
> I hate to say this again, but I'm working on a major Rails/jQuery
> project that's shipping this week. When that's done, I'm going to
> extract out the goodies from the project and make it jQuery on Rails. I
> know it's been a while, but this project has taken precedence over my
> jQuery work for a month or so. Hopefully I will have time for jQuery
> stuff starting next week.
>
> -- Yehuda

Yehuda, didn't meant to put additional pressure onto you :-) good luck!

We will start to create a few goodies as we need them in the meantime...


-- Klaus


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





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2006-12-14 Thread Klaus Hartl
Yehuda Katz schrieb:
> I hate to say this again, but I'm working on a major Rails/jQuery 
> project that's shipping this week. When that's done, I'm going to 
> extract out the goodies from the project and make it jQuery on Rails. I 
> know it's been a while, but this project has taken precedence over my 
> jQuery work for a month or so. Hopefully I will have time for jQuery 
> stuff starting next week.
> 
> -- Yehuda

Yehuda, didn't meant to put additional pressure onto you :-) good luck!

We will start to create a few goodies as we need them in the meantime...


-- Klaus


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


Re: [jQuery] Fix: ExternalInterface breaks jQuery in firefox 2

2006-12-14 Thread nrwsteff
my 2ct contribution to this discussion. 

FF 2.0 & firebug  1.0beta cause a lot of problems - even on sites without
jQuery :)
so often the debugger pops up and interrupts some scripts (didn't
investigate why). 
sometimes you can resume - but mostly the script is broken. switch back to
firebug 0.4
everthing is fine. at least i can say that my jq-scripts (mostly ajax stuff)
run great on
IE6.0, IE7.0, Mzille1.8, FF1.5 and also FF2.0 (without firebug 1.0
installed) - but with 
firebug beta it crashes. so we'll wait for the release...

offtopic question:
unfortunately it's not possible to have two or more versions of firefox on
the same machine - 
the new windows installer uninstalls all older versions prior to FF2.0 :(( -
or did you
know a possibility to have both versions (FF1.5 & 2.0) installed on one
machine? 
older mozilla/ff versions are also available as a ZIP archives wich can be
copied to any 
programs folder without any installation.

stefan

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Kelvin Luck
> Sent: Thursday, December 14, 2006 10:48 PM
> To: Jörn Zaefferer
> Cc: jQuery Discussion.
> Subject: Re: [jQuery] Fix: ExternalInterface breaks jQuery in 
> firefox 2
> 
> Jörn Zaefferer wrote:
> > Kelvin Luck schrieb:
> >> * Calling an ExternalInterface function which passes arguments 
> >> between Flash and JS in Firefox 2 breaks the a.constructor==String 
> >> comparison ( see http://dev.noiseusse.org/testflash ).
> >>
> >> * This then totally breaks jQuery which relies on this 
> comparison (in 
> >> the find function for one).
> >>   
> > That site works great for me with FF 2.0. And yes, there 
> are no more 
> > a.constructor == String comparions in jQuery core. Only Array and 
> > Boolean, are they an issue, too?
> > 
> 
> Have you got firebug installed? The alerts make it seem that 
> it's working but the console.log statements make the problem clear...
> 
> And while there may not be any constructor == String 
> comparisons in the jQuery core it looks like there are still 
> a few constructor != String comparisons which suffer from the 
> same problem.
> 
> Afaik there is no issue with Array and Boolean comparisons...
> 
> Thanks for the feedback,
> 
> Kelvin :)
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 


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


Re: [jQuery] jQuery and Rails

2006-12-14 Thread Yehuda Katz

I hate to say this again, but I'm working on a major Rails/jQuery project
that's shipping this week. When that's done, I'm going to extract out the
goodies from the project and make it jQuery on Rails. I know it's been a
while, but this project has taken precedence over my jQuery work for a month
or so. Hopefully I will have time for jQuery stuff starting next week.

-- Yehuda

On 12/14/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:


Abdur-Rahman Advany schrieb:
> HI,
>
> Currently I am using Rails and JQuery combined with Minus_r (a plugin by
> Dann Web).
>
> But rails requires that you send the correct accept header to make
> respond_to work. So you need to adjust your ajax method (inside of
> jquery) with a few lines extra:
>
> // Set Accept header based on dataType
> if ( s.dataType == 'script' || s.dataType == 'json' )
>   xml.setRequestHeader("Accept", "text/javascript, text/html,
> application/xml, text/xml, */*");
>
> if ( s.dataType == 'xml' )
>   xml.setRequestHeader("Accept", "application/xml, text/xml, text/html,
> text/javascript */*");
>
> and when you are using one of the methods or plugins that allow you to
> set dataType just specify 'script' and rails wil respond_to :js(thus
> making RJS work with minus_r).
>
> You will need minus_r as rails default way of handling .rjs is to
> evaluate it as ruby and not ERB.
>
> Greets,
>
> Abdul
>
> Klaus Hartl wrote:
>> Hi all,
>>
>> can someone share his experience of using jQuery with Rails? We are
>> switching to Rails at Plazes but I'd like to stay in the jQuery camp
:-)
>>
>>
>> Thanks,
>>
>> Klaus


Thanks Abdul for the information. I was thinking of using the Minus_r
plugin. Good to have some tips to start with!

Yehuda, what about jQuery on Rails?


-- Klaus

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





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2006-12-14 Thread Klaus Hartl
Abdur-Rahman Advany schrieb:
> HI,
> 
> Currently I am using Rails and JQuery combined with Minus_r (a plugin by 
> Dann Web).
> 
> But rails requires that you send the correct accept header to make 
> respond_to work. So you need to adjust your ajax method (inside of 
> jquery) with a few lines extra:
> 
> // Set Accept header based on dataType
> if ( s.dataType == 'script' || s.dataType == 'json' )
>   xml.setRequestHeader("Accept", "text/javascript, text/html, 
> application/xml, text/xml, */*");
> 
> if ( s.dataType == 'xml' )
>   xml.setRequestHeader("Accept", "application/xml, text/xml, text/html, 
> text/javascript */*");
> 
> and when you are using one of the methods or plugins that allow you to 
> set dataType just specify 'script' and rails wil respond_to :js(thus 
> making RJS work with minus_r).
> 
> You will need minus_r as rails default way of handling .rjs is to 
> evaluate it as ruby and not ERB.
> 
> Greets,
> 
> Abdul
> 
> Klaus Hartl wrote:
>> Hi all,
>>
>> can someone share his experience of using jQuery with Rails? We are 
>> switching to Rails at Plazes but I'd like to stay in the jQuery camp :-)
>>
>>
>> Thanks,
>>
>> Klaus


Thanks Abdul for the information. I was thinking of using the Minus_r 
plugin. Good to have some tips to start with!

Yehuda, what about jQuery on Rails?


-- Klaus

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


[jQuery] Jquery Flash Plugin & the FlashBlock Extension

2006-12-14 Thread Sam Sherlock

I have noticed that the flash plugin does not work with the flashBlock
firefox extension
whereas the both swfObject, UFO & sIFR do work with the extension.

In firefox with flashBlock installed and blocking flash content the flash is
not displayed
nor is the content that it replaces.

I have looked at the source but its a bit beyond me.  Would this be
complicated to
build into the plugin?
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Change href of external links

2006-12-14 Thread Dave Methvin
Uh oh, I know what it is. It's a bug in pushStack. 
 
If the last arg to pushStack is a function, it does .each(fn) with the
filtered set but returns the original set. If there are two trailing
function args, the first is treated as above. However, if the filtered set
returned nothing (and thus fn was never called) it does .each(fn2) with the
original set. Kind of like an if-then-else. It's never been documented but I
think it will be eventually.
 
I think this should fix it:
 
 pushStack: function(a,args) {
  var fn = args && args.length > 1 && args[args.length-1];
  var fn2 = args && args.length > 2 && args[args.length-2];

 
  _  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Jonathan Sharp
Sent: Thursday, December 14, 2006 2:31 PM
To: jQuery Discussion.
Subject: Re: [jQuery] Change href of external links


On 12/14/06, Yehuda Katz <[EMAIL PROTECTED]> wrote:
> If that was the case, jQuery("#main a").filter(function() { return false;
}) would return nothing. But it doesn't. It returns the original group of
elements. At least for me.

Hm... I also tested this and filter didn't prune the list with my function
returning false. 

Here's the filter function out of 1.0.3 which checks if t is a function and
pushes the result of jQuery.grep(this, t) onto the stack.

filter: function(t) {
return this.pushStack(
*SNIP*

typeof t == "function" &&
jQuery.grep( this, t ) || 

jQuery.filter(t,this).r, arguments );
},

Now in the grep function it operates on the list of elements in elms. It
calls the function we defined (fn) and if fn returns false it shouldn't add
them to the result array. 

grep: function(elems, fn, inv) {
*SNIP*
var result = [];

// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0; i < elems.length; i++ )
if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
result.push( elems[i] );

return result;
},

Am I missing something here? 

Cheers,
-js


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


Re: [jQuery] quick question for Felix re: cakePHP

2006-12-14 Thread bmsterling

wow, this is why I stuck with jquery in the first place, because of the great
responses by the community.  I really do appreciate your input and will def
look at the links provided (although I looked at most already and they are
def not newbie friendly)  But I will def chug away at it.

thanks again.
-- 
View this message in context: 
http://www.nabble.com/quick-question-for-Felix-re%3A-cakePHP-tf2817293.html#a7882492
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Function: $(...).ancestorsTo(match)

2006-12-14 Thread Klaus Hartl
Klaus Hartl schrieb:
> Dave Methvin schrieb:
>>> Would this be a candidate for addition to the core possibly?
>>  
>> The ancestorsTo looks like it's an up-the-tree analog of the nextUntil
>> method for siblings that was discussed here a while back. I think the
>> general consensus on that was that there would be an extended navigation
>> plugin rather than add all these to the core. Maybe they should be named
>> ancestorsUntil and siblingsUntil for better consistency?
>>  
>> Also, since this is a modifying plugin it should use pushStack() to allow
>> the use of .end() to get back to the previous selected nodes.  I think the
>> end result would be something like this, untested:
>>  
>> jQuery.fn.ancestorsUntil = function(match) {
>>  var a = [];
>>  jQuery(this[0]).ancestors().each(function() {
>> a.push(this);
>> return !jQuery(this).is(match);
>>  });
>> return this.pushStack(a, arguments);
>> };
> 
> What is the difference between this plugin and $('li').parents('.myClass') ?


After reading the first post again I know...


-- Klaus


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


Re: [jQuery] Fix: ExternalInterface breaks jQuery in firefox 2

2006-12-14 Thread Kelvin Luck
Jörn Zaefferer wrote:
> Kelvin Luck schrieb:
>> * Calling an ExternalInterface function which passes arguments between
>> Flash and JS in Firefox 2 breaks the a.constructor==String comparison (
>> see http://dev.noiseusse.org/testflash ).
>>
>> * This then totally breaks jQuery which relies on this comparison (in
>> the find function for one).
>>   
> That site works great for me with FF 2.0. And yes, there are no more 
> a.constructor == String comparions in jQuery core. Only Array and 
> Boolean, are they an issue, too?
> 

Have you got firebug installed? The alerts make it seem that it's 
working but the console.log statements make the problem clear...

And while there may not be any constructor == String comparisons in the 
jQuery core it looks like there are still a few constructor != String 
comparisons which suffer from the same problem.

Afaik there is no issue with Array and Boolean comparisons...

Thanks for the feedback,

Kelvin :)

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


Re: [jQuery] Function: $(...).ancestorsTo(match)

2006-12-14 Thread Klaus Hartl
Dave Methvin schrieb:
>> Would this be a candidate for addition to the core possibly?
>  
> The ancestorsTo looks like it's an up-the-tree analog of the nextUntil
> method for siblings that was discussed here a while back. I think the
> general consensus on that was that there would be an extended navigation
> plugin rather than add all these to the core. Maybe they should be named
> ancestorsUntil and siblingsUntil for better consistency?
>  
> Also, since this is a modifying plugin it should use pushStack() to allow
> the use of .end() to get back to the previous selected nodes.  I think the
> end result would be something like this, untested:
>  
> jQuery.fn.ancestorsUntil = function(match) {
>  var a = [];
>  jQuery(this[0]).ancestors().each(function() {
> a.push(this);
> return !jQuery(this).is(match);
>  });
> return this.pushStack(a, arguments);
> };

What is the difference between this plugin and $('li').parents('.myClass') ?


-- Klaus


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


Re: [jQuery] Fix: ExternalInterface breaks jQuery in firefox 2

2006-12-14 Thread Jörn Zaefferer
Kelvin Luck schrieb:
> * Calling an ExternalInterface function which passes arguments between
> Flash and JS in Firefox 2 breaks the a.constructor==String comparison (
> see http://dev.noiseusse.org/testflash ).
>
> * This then totally breaks jQuery which relies on this comparison (in
> the find function for one).
>   
That site works great for me with FF 2.0. And yes, there are no more 
a.constructor == String comparions in jQuery core. Only Array and 
Boolean, are they an issue, too?

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread Harlley Roberto

If you wanna simplicity and documentation, you should use Code Igniter [
www.*code**igniter*.com  ]

As CMS use Textpattern [ www.textpattern.com ]

Harlley

On 12/14/06, Will Jessup <[EMAIL PROTECTED]> wrote:


Does anybody care about Symfony-project and jQuery?

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





--
[]'s

Harlley R. Oliveira
www.syssolution.com.br
---
~ U never try U'll never learn ~
---
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread digital spaghetti
Personally, I didn't like its structure set up and YML language.
CakePHP is very much like PHP and is really just a set of classes that
provide functionality, and the structure is true MVC to me.

But certainly I think it's important that with whatever framework you
use, that jQuery is the JS library of choice for simplicity and
lightweight functionality.

Tane

On 12/14/06, Will Jessup <[EMAIL PROTECTED]> wrote:
> Does anybody care about Symfony-project and jQuery?
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

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


Re: [jQuery] How to make radio button selected?

2006-12-14 Thread Sean O

Thanks, Mike.  Knew it was something simple.

It was the [0] that did it, I had tried simply .checked = true;



SEAN O



malsup wrote:
> 
> $('#check_red')[0].checked = true;
> 
> 
> On 12/14/06, Sean O <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>>
>> I'm trying to select a radio button based on user input in a text box.
>>
>> Based on what is typed, I want one of two radio buttons with the same
>> name,
>> but distinct IDs, to be selected.  I have the RegEx working fine to pick
>> out
>> unique strings in the text box, but can't get the rest.
>>
>> e.g.
>> O red (id=check_red)  O blue  (id=check_blue)
>> (id=textbox) [red] -> select red radio button on blur
>>
>> Tips?
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-make-radio-button-selected--tf2821791.html#a7880858
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Function: $(...).ancestorsTo(match)

2006-12-14 Thread Sam Collett
On 14/12/06, Dave Methvin <[EMAIL PROTECTED]> wrote:
> > Would this be a candidate for addition to the core possibly?
>
> The ancestorsTo looks like it's an up-the-tree analog of the nextUntil
> method for siblings that was discussed here a while back. I think the
> general consensus on that was that there would be an extended navigation
> plugin rather than add all these to the core. Maybe they should be named
> ancestorsUntil and siblingsUntil for better consistency?

The only problem with that is that it also includes the element
matching the expression. nextUntil does not. There may be cases when
you want that, but other times you may not. Perhaps an additional
parameter?

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


Re: [jQuery] Help with drop down menus

2006-12-14 Thread blemming

I put an example of what I am trying to do here:

http://www.brilliantretail.com/cases/colors/ Example 

basically, I the box to appear when the image with the down arrow is clicked
and disappear if the user clicks anywhere else on the screen.

Thanks, David




blemming wrote:
> 
> Marc Thanks for your input Unfortunately, I can get it to function as
> I would like.
> 
> I have:
> 
> $('*').not(".box_color").click(function(){
>   $(".div_color").hide();
> });
> 
> $(".box_color").click(function (){
>   $(".div_color").hide();
>   $(this).next().show();
> })
> 
> Where .box_color is the class assigned to the image that displays the
> drop-down menu div with class .div_color. When I add your snippet of code
> the click function that is supposed to show the clicked menu is not
> working. (i.e. no menu is shown) 
> 
> Thank you for your help.  I'm trying to learn jQuery after spending a
> month working with prototype! 
> 
> 
> 
> Marc Jansen-2 wrote:
>> 
>> Sorry, should have been something like this:
>> 
>> $('body *').not(".div_color").click(function(){
>>  $(".div_color").hide();
>> });
>> 
>> or
>> 
>> $('*').not(".div_color").click(function(){
>>  $(".div_color").hide();
>> });
>> 
>> 
>> both untested, as always ;-)
>> 
>> -- Marc
>> 
>> Marc Jansen schrieb:
>>> Hi David,
>>>
>>> maybe this works:
>>>
>>> $('body').not(".div_color").click(function(){
>>> $(".div_color").hide();
>>> })
>>>
>>>
>>> untested.
>>>
>>> -- Marc
>>>
>>>
>>> blemming schrieb:
>>>   
 I'm trying to create a few drop down option menus that are contained in
 divs
 which are initially not displayed.  There each have a image dropdown
 image
 with class = div_color. Here is how I am opening the boxes and closing
 any
 others that were left open.  

 $(".box_color").click(function ()
{
$(".div_color").hide();
$(this).next().show();
}   
 )

 My question is how do I create an event that will hide() the divs if
 the
 user clicks anywhere else on the screen?  I'm new to jQuery so I'm
 thinking
 something along these lines might work but I don't know how to properly
 write the css selector. 

 // DOESN"T WORK 
 $('body:not(".div_color")').click(function(){
$(".div_color").hide();
}
 )

 Thanks for your help! David
   
 
>>>
>>>
>>>   
>> 
>> 
>> -- 
>> 
>> 
>>  Marc Jansen
>> 
>>   Reuterstraße 112
>>   53129 Bonn
>>   0228 / 2438694
>> 
>>   Schwalbenweg 2
>>   53947 Nett./Engelgau
>>   02486 / 7644
>> 
>>   [EMAIL PROTECTED]
>> 
>> 
>> 
>> 
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Help-with-drop-down-menus-tf2821960.html#a7880721
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Help with drop down menus

2006-12-14 Thread blemming

I put an example of what I am trying to do here:

http://www.brilliantretail.com/cases/colors/ Example 

basically, I the box to appear when the image with the down arrow is clicked
and disappear if the user clicks anywhere else on the screen.

Thanks, David



blemming wrote:
> 
> I'm trying to create a few drop down option menus that are contained in
> divs which are initially not displayed.  There each have a image dropdown
> image with class = div_color. Here is how I am opening the boxes and
> closing any others that were left open.  
> 
> $(".box_color").click(function ()
>   {
>   $(".div_color").hide();
>   $(this).next().show();
>   }   
> )
> 
> My question is how do I create an event that will hide() the divs if the
> user clicks anywhere else on the screen?  I'm new to jQuery so I'm
> thinking something along these lines might work but I don't know how to
> properly write the css selector. 
> 
> // DOESN"T WORK 
> $('body:not(".div_color")').click(function(){
>   $(".div_color").hide();
>   }
> )
> 
> Thanks for your help! David
> 

-- 
View this message in context: 
http://www.nabble.com/Help-with-drop-down-menus-tf2821960.html#a7880611
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Fix: ExternalInterface breaks jQuery in firefox 2

2006-12-14 Thread Kelvin Luck
Hi,

I've just discovered this thread and can confirm that the problem is
still existing for me in 1.0.4.

To summarise the thread (which can be read in full here:
http://www.nabble.com/Fix%3A-ExternalInterface-breaks-jQuery-in-firefox-2-tf2677747.html#a7468229
 

):

* Calling an ExternalInterface function which passes arguments between
Flash and JS in Firefox 2 breaks the a.constructor==String comparison (
see http://dev.noiseusse.org/testflash ).

* This then totally breaks jQuery which relies on this comparison (in
the find function for one).

* A bug report has been raised on bugzilla (since it would seem to be
their fault - it works fine in FF 1.5):
https://bugzilla.mozilla.org/show_bug.cgi?id=361370

* Jörn gave the impression below that a workaround had been added to the
core but it doesn't seem to be there - was it reverted for a reason?

I've implemented the workaround on my copy of jQuery and it seems to 
work fine but I'm worried that it will break another browser or that 
there was another good reason why it's not in the core - I'd be really 
grateful for any feedback on this issue,

Cheers,

Kelvin :)

Jörn Zaefferer wrote:
>> The fix
>> Go through jquery-latest and change all "string".constructor ==  String 
>> to typeof-comparisons. I did it yesterday and everything works as 
>> expected. How would I go about if I wanted the fix to make it into the 
>> main distro?
> 
> Could you please check out the latest revision from SVN and test it? Thanks.
> 
> --
> Jörn Zaefferer
> 
> http://bassistance.de


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


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread Will Jessup
Does anybody care about Symfony-project and jQuery?

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


Re: [jQuery] file uploads with jQuery?

2006-12-14 Thread Andy Matthews
I'll be REALLY excited if someone gets this working. I'm going to be
building a new app coming up soon and this is precisely what I need.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Jörn Zaefferer
Sent: Thursday, December 14, 2006 1:35 PM
To: jQuery Discussion.
Subject: [jQuery] file uploads with jQuery?


Hi folks,

the file upload issue was discussed several times on this list,
therefore I'd like to point you at some interesting stuff:
http://progphp.com/upload.phps

The example relies on YUI, but it should be easy to rewrite it with
jQuery, anyone up to it?

The interessting part: It uses APC from CVS, which should be available
with PHP 5.2, but needs this apc.rfc1867=1 in php.ini. This maybe good
enough for anyone who wants to do AJAX file uploads and has enough
control over his server.

I just got the info from #jquery, maybe someone else knows a bit more
about the necessary PHP stuff.

--
Jörn Zaefferer

http://bassistance.de


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


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


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread Felix Geisendörfer

http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/
--
http://www.thinkingphp.org
http://www.fg-webdesign.de


Jörn Zaefferer wrote:

Olivier Percebois-Garve schrieb:
  

So there is a lot to come, but for now I'd advice you the Head helper.
  


Where can that neat helper be found?

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


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread digital spaghetti
Be wary of that page, it's actually out of date!

Rather than:
$head->register_js("jquery.js");

You now just use
$head->js("jquery.js");

Basicly, knock register_ off any calls and your fine.  However after
all your calls, you need to do:

$head->registered();

This will "render" all the scripts and css files you add.

Tane


On 12/14/06, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
> http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/
> --
> http://www.thinkingphp.org
> http://www.fg-webdesign.de
>
>
> Jörn Zaefferer wrote:
> > Olivier Percebois-Garve schrieb:
> >
> >> So there is a lot to come, but for now I'd advice you the Head helper.
> >>
> >>
> > Where can that neat helper be found?
> >
> >
>
>
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Change href of external links

2006-12-14 Thread Ⓙⓐⓚⓔ
upon testing filter with a function returns lots of items that aren't
nodes! But among them are the nodes in question.

$("[EMAIL PROTECTED]:not(.thickbox)")
.filter(function(el){
//alert(el.href);
var m =  
$.map(notthese,function(notthis){
if (!el.nodeName) return false;
alert(el.nodeName)
if (el.href && 
el.href.indexOf(notthis)>-1) return true
})
//alert(m);
return m;
})
.bind("click", function(){ return 
!window.open(this.href); });


On 12/14/06, Jonathan Sharp <[EMAIL PROTECTED]> wrote:
> On 12/14/06, Yehuda Katz <[EMAIL PROTECTED]> wrote:
> > If that was the case, jQuery("#main a").filter(function() { return false;
> }) would return nothing. But it doesn't. It returns the original group of
> elements. At least for me.
>
> Hm... I also tested this and filter didn't prune the list with my function
> returning false.
>
> Here's the filter function out of 1.0.3 which checks if t is a function and
> pushes the result of jQuery.grep(this, t) onto the stack.
>
> filter: function(t) {
> return this.pushStack(
> *SNIP*
>
> typeof t == "function" &&
> jQuery.grep( this, t ) ||
>
> jQuery.filter(t,this).r, arguments );
> },
>
> Now in the grep function it operates on the list of elements in elms. It
> calls the function we defined (fn) and if fn returns false it shouldn't add
> them to the result array.
>
> grep: function(elems, fn, inv) {
> *SNIP*
> var result = [];
>
> // Go through the array, only saving the items
> // that pass the validator function
> for ( var i = 0; i < elems.length; i++ )
> if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
> result.push( elems[i] );
>
> return result;
> },
>
> Am I missing something here?
>
> Cheers,
> -js
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
>


-- 
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] file uploads with jQuery?

2006-12-14 Thread Jörn Zaefferer
Hi folks,

the file upload issue was discussed several times on this list, 
therefore I'd like to point you at some interesting stuff:
http://progphp.com/upload.phps

The example relies on YUI, but it should be easy to rewrite it with 
jQuery, anyone up to it?

The interessting part: It uses APC from CVS, which should be available 
with PHP 5.2, but needs this apc.rfc1867=1 in php.ini. This maybe good 
enough for anyone who wants to do AJAX file uploads and has enough 
control over his server.

I just got the info from #jquery, maybe someone else knows a bit more 
about the necessary PHP stuff.

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread Jörn Zaefferer
Felix Geisendörfer schrieb:
>> It's community seems friendly, but at the moment the documentation
>> seems to be a little bit of a muddle
> Hm? We got an official manual , an API 
> , the Bakery (user contributed articles) 
> , and lot's of blogs 
>  keeping you up to date. The 
> information in the wiki however tends to be outdated and you shouldn't 
> rely on it.
I guess he refers to the manual. Maybe adding some links to the API 
would help.

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] Change href of external links

2006-12-14 Thread Jonathan Sharp

On 12/14/06, Yehuda Katz <[EMAIL PROTECTED]> wrote:

If that was the case, jQuery("#main a").filter(function() { return false;

}) would return nothing. But it doesn't. It returns the original group of
elements. At least for me.

Hm... I also tested this and filter didn't prune the list with my function
returning false.

Here's the filter function out of 1.0.3 which checks if t is a function and
pushes the result of jQuery.grep(this, t) onto the stack.

filter: function(t) {
   return this.pushStack(
   *SNIP*

   typeof t == "function" &&
   jQuery.grep( this, t ) ||

   jQuery.filter(t,this).r, arguments );
   },

Now in the grep function it operates on the list of elements in elms. It
calls the function we defined (fn) and if fn returns false it shouldn't add
them to the result array.

grep: function(elems, fn, inv) {
   *SNIP*
   var result = [];

   // Go through the array, only saving the items
   // that pass the validator function
   for ( var i = 0; i < elems.length; i++ )
   if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
   result.push( elems[i] );

   return result;
   },

Am I missing something here?

Cheers,
-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread digital spaghetti
Its on the cakeforge jorn, go to the project tree and search for
"head'.  It also needs the util helper (which is handly next in the
list :)

Tane

On 12/14/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Olivier Percebois-Garve schrieb:
> > So there is a lot to come, but for now I'd advice you the Head helper.
> >
> Where can that neat helper be found?
>
> --
> Jörn Zaefferer
>
> http://bassistance.de
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread Jörn Zaefferer
Olivier Percebois-Garve schrieb:
> So there is a lot to come, but for now I'd advice you the Head helper.
>   
Where can that neat helper be found?

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] Change href of external links

2006-12-14 Thread Dave Methvin
> Am I mistaken, or does the string have to match
> exactly in this case? 

Yep, but you could implement a left-case-insensitive match or even a
regexp-based pattern match. The jQuery part wouldn't change at all.


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


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread digital spaghetti
I am already using it :)

It's the first 3rd party helper I am using, and it's very handy for
inserting my JS into the head, although there seems to be an issue
with loading JS files in specific views (they appear before the
jQuery.js file is loaded in my default.thtml)

Tane


On 12/14/06, Olivier Percebois-Garve <[EMAIL PROTECTED]> wrote:
> I can advice you to use the "Head helper" made by rossoft.
> It allows you to throw your js between  and  from any view
> file.
> It is simple and powerful.
> Felix Geisendorfer has made a tutorial on how to throw it on a
> controller basis and he said
> he's developing a MVC framework for jquery, I guess it will be made
> withe cake in mind.
> Also, Nate, a Team member is developing something, I guess it's for the
> upcoming cake 1.2.
>
> So there is a lot to come, but for now I'd advice you the Head helper.
>
> olivvv
>
>
>
> digital spaghetti wrote:
> > Hey,
> >
> > I've noticed a few people on here talk about CakePHP and I've decided
> > to investigate it as a possible way of developing a CMS for my work.
> > As much as I love drupal, it has it's drawbacks for what I am doing
> > and I'm investigating using a framwork as a way to develop a CMS from
> > scratch that is customised for my line of work in the music industry.
> >
> > It's community seems friendly, but at the moment the documentation
> > seems to be a little bit of a muddle and I can only find faint
> > whispers of CakePHP supporting jQuery easily.  To be honest I've
> > discovered the forms helper which isn't well documented at the moment,
> > and tried to use the jQuery forms plugin to do AJAX request but with
> > no luck.  Also, so far I have only really used jQuery for Dom/CSS and
> > not really done much with AJAX yet.
> >
> > I'm wondering if anyone on here with CakePHP knowledge could either
> > point me to some reasonbly clear documentation on using jQuery with
> > CakePHP to do AJAX, or if they might be willing to provide a little
> > assistance or code samples or helpers/componants that they have used.
> > One I get it the first time, I should be ok after that.  I want to try
> > get a basic system up-and-running by mid january so I'm really looking
> > to get moving on this.
> >
> > Any help would be appreciated and feel free to contact me off-list.
> >
> > Thanks,
> > Tane
> >
> > ___
> > jQuery mailing list
> > discuss@jquery.com
> > http://jquery.com/discuss/
> >
> >
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

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


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread Felix Geisendörfer

Hey digital spaghetti,

CakePHP is using prototype as it's default library right now. All 
CakePHP helper functions regarding AJAX / events are done with prototype 
in mind. Now this doesn't mean the CakePHP developers don't like jQuery, 
but the helpers were done before jQuery came out (or at least before it 
got popular) and lot's of people depend on them. So changing that would 
be difficult for us and require lot's of time.


However, you should be able to use the normal CakePHP Html/FormHelper 
functions and then enhance the results using jQuery code in an external 
file. Even if CakePHP helpers would support jQuery, I would prefer this 
way in order to keep my code organized.


The other parts of CakePHP are JS library agnostic. The RequestHandler 
component for example will recognize AJAX requests from jQuery and 
allows to use a different layout in those cases easily.


Let me know if you need more information. I'm also on AIM as theundefined87


It's community seems friendly, but at the moment the documentation
seems to be a little bit of a muddle
Hm? We got an official manual , an API 
, the Bakery (user contributed articles) 
, and lot's of blogs 
 keeping you up to date. The 
information in the wiki however tends to be outdated and you shouldn't 
rely on it.


-- Felix Geisendörfer aka the_undefined
--
http://www.thinkingphp.org
http://www.fg-webdesign.de


digital spaghetti wrote:

Hey,

I've noticed a few people on here talk about CakePHP and I've decided
to investigate it as a possible way of developing a CMS for my work.
As much as I love drupal, it has it's drawbacks for what I am doing
and I'm investigating using a framwork as a way to develop a CMS from
scratch that is customised for my line of work in the music industry.

It's community seems friendly, but at the moment the documentation
seems to be a little bit of a muddle and I can only find faint
whispers of CakePHP supporting jQuery easily.  To be honest I've
discovered the forms helper which isn't well documented at the moment,
and tried to use the jQuery forms plugin to do AJAX request but with
no luck.  Also, so far I have only really used jQuery for Dom/CSS and
not really done much with AJAX yet.

I'm wondering if anyone on here with CakePHP knowledge could either
point me to some reasonbly clear documentation on using jQuery with
CakePHP to do AJAX, or if they might be willing to provide a little
assistance or code samples or helpers/componants that they have used.
One I get it the first time, I should be ok after that.  I want to try
get a basic system up-and-running by mid january so I'm really looking
to get moving on this.

Any help would be appreciated and feel free to contact me off-list.

Thanks,
Tane

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

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


Re: [jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread Olivier Percebois-Garve
I can advice you to use the "Head helper" made by rossoft.
It allows you to throw your js between  and  from any view 
file.
It is simple and powerful.
Felix Geisendorfer has made a tutorial on how to throw it on a 
controller basis and he said
he's developing a MVC framework for jquery, I guess it will be made 
withe cake in mind.
Also, Nate, a Team member is developing something, I guess it's for the 
upcoming cake 1.2.

So there is a lot to come, but for now I'd advice you the Head helper.

olivvv



digital spaghetti wrote:
> Hey,
>
> I've noticed a few people on here talk about CakePHP and I've decided
> to investigate it as a possible way of developing a CMS for my work.
> As much as I love drupal, it has it's drawbacks for what I am doing
> and I'm investigating using a framwork as a way to develop a CMS from
> scratch that is customised for my line of work in the music industry.
>
> It's community seems friendly, but at the moment the documentation
> seems to be a little bit of a muddle and I can only find faint
> whispers of CakePHP supporting jQuery easily.  To be honest I've
> discovered the forms helper which isn't well documented at the moment,
> and tried to use the jQuery forms plugin to do AJAX request but with
> no luck.  Also, so far I have only really used jQuery for Dom/CSS and
> not really done much with AJAX yet.
>
> I'm wondering if anyone on here with CakePHP knowledge could either
> point me to some reasonbly clear documentation on using jQuery with
> CakePHP to do AJAX, or if they might be willing to provide a little
> assistance or code samples or helpers/componants that they have used.
> One I get it the first time, I should be ok after that.  I want to try
> get a basic system up-and-running by mid january so I'm really looking
> to get moving on this.
>
> Any help would be appreciated and feel free to contact me off-list.
>
> Thanks,
> Tane
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>   


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


Re: [jQuery] Simple code, but not working with IE 6 / 7

2006-12-14 Thread Jörn Zaefferer
Jörn Zaefferer schrieb:
> Karl Swedberg schrieb:
>   
>> $().ready(function(){
>> 
> It would produce an interesting pattern if $() implied a jQuery object 
> containing only the document object. Then $().ready(function() {}) would 
> work and be a little more logical then $(function() {}).
>   
Forget that, it works, just tested on the wrong page.

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] Simple code, but not working with IE 6 / 7

2006-12-14 Thread Karl Swedberg

On Dec 14, 2006, at 1:50 PM, Mike Alsup wrote:

fyi, these all work the same:

$(document).ready(function() {});
$().ready(function() {});
$(function() {});


Very interesting. I knew about the first and third being the same,  
but didn't know about the second. Thanks, Mike!



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com





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


Re: [jQuery] Change href of external links

2006-12-14 Thread agent2026

Am I mistaken, or does the string have to match exactly in this case?  In
other words href="http://www.notthis.com"; will return false, while
href="http://notthis.com/directory/file"; will return true.

Adam



Jonathan Sharp wrote:
> 
> On 12/14/06, Dave Methvin <[EMAIL PROTECTED]> wrote:
>>
>> *SNIP*
>> It would be nice if there was a $().grep() to filter the elements:
>>
>> $("[EMAIL PROTECTED]:not(.thickbox)").grep(function(){
>> for ( var i=0; i < notthese.length; i++ )
>> if ( this.href == notthese[i] ) return false;
>> return true;
>>   }).bind("click", function(){ return !window.open(this.href); });
>>
>> But that doesn't exist. There's a jQuery.grep but it can't be used in a
>> chain.
> 
> 
> I looked at 1.0.3 source and filter() accepts a function and it appears
> that
> if that function returns true the element is included otherwise it returns
> false. The function you define takes two args: element, and i with i being
> the position in the current list or stack.
> 
> (Untested)
> $("[EMAIL PROTECTED]:not(.thickbox)").filter(function(el){
> for ( var i=0; i < notthese.length; i++ )
> if (el.href == notthese[i] ) return false;
> return true;
> }).bind("click", function(){ return !window.open(this.href); });
> 
> Cheers,
> -js
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Change-href-of-external-links-tf2718387.html#a7878878
Sent from the JQuery mailing list archive at Nabble.com.


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


[jQuery] JQuery and CakePHP (slightly OT)

2006-12-14 Thread digital spaghetti
Hey,

I've noticed a few people on here talk about CakePHP and I've decided
to investigate it as a possible way of developing a CMS for my work.
As much as I love drupal, it has it's drawbacks for what I am doing
and I'm investigating using a framwork as a way to develop a CMS from
scratch that is customised for my line of work in the music industry.

It's community seems friendly, but at the moment the documentation
seems to be a little bit of a muddle and I can only find faint
whispers of CakePHP supporting jQuery easily.  To be honest I've
discovered the forms helper which isn't well documented at the moment,
and tried to use the jQuery forms plugin to do AJAX request but with
no luck.  Also, so far I have only really used jQuery for Dom/CSS and
not really done much with AJAX yet.

I'm wondering if anyone on here with CakePHP knowledge could either
point me to some reasonbly clear documentation on using jQuery with
CakePHP to do AJAX, or if they might be willing to provide a little
assistance or code samples or helpers/componants that they have used.
One I get it the first time, I should be ok after that.  I want to try
get a basic system up-and-running by mid january so I'm really looking
to get moving on this.

Any help would be appreciated and feel free to contact me off-list.

Thanks,
Tane

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


Re: [jQuery] Change href of external links

2006-12-14 Thread Yehuda Katz

If that was the case, jQuery("#main a").filter(function() { return false; })
would return nothing. But it doesn't. It returns the original group of
elements. At least for me.

-- Yehuda

On 12/14/06, Dave Methvin <[EMAIL PROTECTED]> wrote:


 > I looked at 1.0.3 source and filter() accepts a function and it
> appears that if that function returns true the element is included
> otherwise it returns false.

Thanks for pointing that out Jonathan, I was almost certain there was one
but I thought it was .grep() and the docs don't mention that variant of
.filter().

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






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Change href of external links

2006-12-14 Thread Jonathan Sharp

On 12/14/06, Dave Methvin <[EMAIL PROTECTED]> wrote:


 > I looked at 1.0.3 source and filter() accepts a function and it
> appears that if that function returns true the element is included
> otherwise it returns false.

Thanks for pointing that out Jonathan, I was almost certain there was one
but I thought it was .grep() and the docs don't mention that variant of
.filter().



Ultimately filter utilizes .grep() but like you said grep was destructive.
And you're right that the docs don't mention the acceptance of a function...
here here for open source!

Cheers,
-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Simple code, but not working with IE 6 / 7

2006-12-14 Thread Jörn Zaefferer
Karl Swedberg schrieb:
> $().ready(function(){
It would produce an interesting pattern if $() implied a jQuery object 
containing only the document object. Then $().ready(function() {}) would 
work and be a little more logical then $(function() {}).

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] Change href of external links

2006-12-14 Thread Jörn Zaefferer
Dave Methvin schrieb:
> > I looked at 1.0.3 source and filter() accepts a function and it
> > appears that if that function returns true the element is included
> > otherwise it returns false.
>  
> Thanks for pointing that out Jonathan, I was almost certain there was 
> one but I thought it was .grep() and the docs don't mention that 
> variant of .filter().
It seems to be a quite powerful variant. As always, jQuery is good for 
suprises.

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] Simple code, but not working with IE 6 / 7

2006-12-14 Thread Mike Alsup
> I see a couple things that I would change if it were my code.
>
> 1. change
> $().ready(function(){
> to
> $(document).ready(function(){

fyi, these all work the same:

$(document).ready(function() {});
$().ready(function() {});
$(function() {});

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


Re: [jQuery] Change href of external links

2006-12-14 Thread Dave Methvin
> I looked at 1.0.3 source and filter() accepts a function and it 
> appears that if that function returns true the element is included
> otherwise it returns false.
 
Thanks for pointing that out Jonathan, I was almost certain there was one
but I thought it was .grep() and the docs don't mention that variant of
.filter(). 
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Simple code, but not working with IE 6 / 7

2006-12-14 Thread Karl Swedberg

On Dec 14, 2006, at 8:49 AM, Vincent Majer wrote:



$().ready(function(){

$("a.ShowMap").click(
function()
{

$("div.dynamic_zone").find("div#description").css({display:"none"});
$("div.dynamic_zone").find("div#map").show("slow");

});

$("a.ShowImage").click(
function(){
$("div.dynamic_zone").find("div#map").css({display:"none"});
$("div.dynamic_zone").find("div#description").show("slow");
});


});


Is there a problem here ???


Hi Vincent,

I see a couple things that I would change if it were my code.

1. change
$().ready(function(){
to
$(document).ready(function(){

2. change the way you hide the DIVs. For example, change
$("div.dynamic_zone").find("div#description").css 
({display:"none"});

to
$("div.dynamic_zone").find("#description").hide();

I'd have to see the HTML markup to offer any further suggestions.

Cheers,

--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com

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


Re: [jQuery] Duplicate Events

2006-12-14 Thread Jonathan Sharp

Are you loading in your function via AJAX? Does it get loaded multiple
times?

If so you might need to do something like this (untested):

var prevMyFunc;
var myFunc;

// ajax returns "myFunc = function(){ ... }"

$('#mainWindow').unclick(prevMyFunc).click(myFunc);
prevMyFunc = myFunc;

Cheers,
-js


On 12/14/06, floepi <[EMAIL PROTECTED]> wrote:




A

Please try for yourselves on any page.

var hello = function() {
alert('funzt nicht');
};
$('#mainWindow').unclick(hello).click(hello);
$('#mainWindow').unclick(hello).click(hello);

If i understand correctly we should only get one alert popping up since we
registered the function globally and unclicked it. But it doesn't work :((

Well i hope we can solve this mystery - thanks very much for your time
guys.

Cheers

Phil



floepi wrote:
>
> I guess i am doing something wrong. If i try this
>
> $('#mainWindow').click(function() { alert("Hello"); });
> $("#mainWindow").unbind( "click", function() { alert("Hello"); });
>
> where the functions are identical, it still does not work. It will
invoke
> the alert function when i click in the mainWindow.
>
> I must be missing something.
>
> Cheers
>
> Phil
>
>
>
> Sam Collett wrote:
>>
>> On 14/12/06, floepi <[EMAIL PROTECTED]> wrote:
>>>
>>> Hi,
>>>
>>> i have the following problem using the events in jQuery:
>>>
>>> $('#mainWindow').click(function(){
>>>  alert('test');
>>> });
>>>
>>> and load this function at the end of a php script:
>>> >> bla bla bla
>>> ?>
>>> 
>>> my function
>>> 
>>>
>>> The problem is that i load this data into the mainWindow which means,
>>> that
>>> the event gets attached each time i load content into the mainWindow.
So
>>> when i click in the mainWindow i get multiple alert messages.
>>>
>>> Is there a way to tell jQuery to overwrite the event if the function
is
>>> the
>>> same. Otherwise i have to use the specific unbind each time i load
data
>>> into
>>> the window, which feels hacky and unnecessary.
>>>
>>> Thanks for your time. Maybe you know how to solve my problem.
>>>
>>> Cheers
>>>
>>> Phil
>>
>> Have you tried 'unclick'?
>>
>> $('#mainWindow').unclick().click(...
>>
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/Duplicate-Events-tf2820382.html#a7873813
Sent from the JQuery mailing list archive at Nabble.com.


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

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


Re: [jQuery] Hide div only if no child checkbox is selected

2006-12-14 Thread Jörn Zaefferer
GreyCells schrieb:
> Wow! Many thanks Chris, it worked a treat. There was me messing around with
> wildcards an' all :)
>
>
> Chris Domigan wrote:
>   
>> I think you can do:
>>
>> if (!$("#testDiv input:checkbox").is(":checked")) $("#testDiv").hide();
>>
>> (Notice the "!"). Not tested though.
>> 
Remember that is checks if at least one element matches. It may be not 
what you are expecting in other cases.

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] Had to change ifx.js when switching to version 1.0.4 - check me?

2006-12-14 Thread Jörn Zaefferer
leftend schrieb:
> I just want to do a sanity check, because I've never delved into any of the
> interface code (ifx.js)
>
> I'm using Thickbox, and added some custom code to use the "BlindDown"
> function on one of the animations (from the Interface plugin).  Everything
> comes up fine, however when I tried to close the Thickbox the box went away,
> but the opaque overlay didn't, and I got this error:
>
> jQuery.setAuto is not a function (ifx.js - line 147)
>
> I went into the ifx.js file and commented out the following lines:
>
> // set its height and/or width to auto
> //if ( p == 'height' || p == 'width' )
> //jQuery.setAuto( z.el, p );
>
> Re-ran and everthing worked great.  I don't know enough about the changes in
> 1.0.4 to know *why* I had to do this - but I just wanted to see if it made
> sense to anyone.
>   
setAuto was removed as it wasn't needed anymore. Therefore it should be 
save to remove it from interface, too. There is already a bug report for 
this, Gilles or Stefan or Paul should decide how to fix that: 
http://jquery.com/dev/bugs/bug/497/

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] MetaData plugin - help needed FIXED

2006-12-14 Thread Jörn Zaefferer
Erik Beeson schrieb:
> The functionality of the "get" method that the metadata plugin 
> overloads is split out into a "set" method in 1.0.4. Just change the 
> matadata plugin to overload "set" instead of "get", so it looks like 
> this:
>
> jQuery.fn._set = jQuery.fn.set;
> jQuery.fn.set = function(arr){
>   var result = this._set.apply( this, arguments );
> ...
>
> Should this be filed as a bug report, or is the matadata plugin not 
> "official"?
Oh, didn't see this at first. It's now fixed, no need to submit a report.

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] Function: $(...).ancestorsTo(match)

2006-12-14 Thread Jonathan Sharp

On 12/14/06, Dave Methvin <[EMAIL PROTECTED]> wrote:


> Would this be a candidate for addition to the core possibly?

The ancestorsTo looks like it's an up-the-tree analog of the nextUntil
method for siblings that was discussed here a while back. I think the
general consensus on that was that there would be an extended navigation
plugin rather than add all these to the core. Maybe they should be named
ancestorsUntil and siblingsUntil for better consistency?



That makes quite a bit of sense. Has anyone undertaken this plugin? I wasn't
able to find it in SVN under plugins.


Also, since this is a modifying plugin it should use pushStack() to allow

the use of .end() to get back to the previous selected nodes.  I think the
end result would be something like this, untested:

jQuery.fn.ancestorsUntil = function(match) {
 var a = [];
 jQuery(this[0]).ancestors().each(function() {
a.push(this);
return !jQuery(this).is(match);
 });
return this.pushStack(a, arguments);
};



Ah, that's beautiful! (tested it locally and it works as intenteded)

Cheers,
-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Help with drop down menus

2006-12-14 Thread blemming

Marc Thanks for your input Unfortunately, I can get it to function as I
would like.

I have:

$('*').not(".box_color").click(function(){
$(".div_color").hide();
});

$(".box_color").click(function (){
$(".div_color").hide();
$(this).next().show();
})

Where .box_color is the class assigned to the image that displays the
drop-down menu div with class .div_color. When I add your snippet of code
the click function that is supposed to show the clicked menu is not working.
(i.e. no menu is shown) 

Thank you for your help.  I'm trying to learn jQuery after spending a month
working with prototype! 



Marc Jansen-2 wrote:
> 
> Sorry, should have been something like this:
> 
> $('body *').not(".div_color").click(function(){
>   $(".div_color").hide();
> });
> 
> or
> 
> $('*').not(".div_color").click(function(){
>   $(".div_color").hide();
> });
> 
> 
> both untested, as always ;-)
> 
> -- Marc
> 
> Marc Jansen schrieb:
>> Hi David,
>>
>> maybe this works:
>>
>> $('body').not(".div_color").click(function(){
>>  $(".div_color").hide();
>> })
>>
>>
>> untested.
>>
>> -- Marc
>>
>>
>> blemming schrieb:
>>   
>>> I'm trying to create a few drop down option menus that are contained in
>>> divs
>>> which are initially not displayed.  There each have a image dropdown
>>> image
>>> with class = div_color. Here is how I am opening the boxes and closing
>>> any
>>> others that were left open.  
>>>
>>> $(".box_color").click(function ()
>>> {
>>> $(".div_color").hide();
>>> $(this).next().show();
>>> }   
>>> )
>>>
>>> My question is how do I create an event that will hide() the divs if the
>>> user clicks anywhere else on the screen?  I'm new to jQuery so I'm
>>> thinking
>>> something along these lines might work but I don't know how to properly
>>> write the css selector. 
>>>
>>> // DOESN"T WORK 
>>> $('body:not(".div_color")').click(function(){
>>> $(".div_color").hide();
>>> }
>>> )
>>>
>>> Thanks for your help! David
>>>   
>>> 
>>
>>
>>   
> 
> 
> -- 
> 
> 
>  Marc Jansen
> 
>   Reuterstraße 112
>   53129 Bonn
>   0228 / 2438694
> 
>   Schwalbenweg 2
>   53947 Nett./Engelgau
>   02486 / 7644
> 
>   [EMAIL PROTECTED]
> 
> 
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Help-with-drop-down-menus-tf2821960.html#a7878314
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Change href of external links

2006-12-14 Thread Jonathan Sharp

On 12/14/06, Dave Methvin <[EMAIL PROTECTED]> wrote:


*SNIP*
It would be nice if there was a $().grep() to filter the elements:

$("[EMAIL PROTECTED]:not(.thickbox)").grep(function(){
for ( var i=0; i < notthese.length; i++ )
if ( this.href == notthese[i] ) return false;
return true;
  }).bind("click", function(){ return !window.open(this.href); });

But that doesn't exist. There's a jQuery.grep but it can't be used in a
chain.



I looked at 1.0.3 source and filter() accepts a function and it appears that
if that function returns true the element is included otherwise it returns
false. The function you define takes two args: element, and i with i being
the position in the current list or stack.

(Untested)
$("[EMAIL PROTECTED]:not(.thickbox)").filter(function(el){
   for ( var i=0; i < notthese.length; i++ )
   if (el.href == notthese[i] ) return false;
   return true;
   }).bind("click", function(){ return !window.open(this.href); });

Cheers,
-js
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] MetaData plugin - help needed

2006-12-14 Thread Jörn Zaefferer
Jörn Zaefferer schrieb:
> nks for mentioning this. The metadata relies on some jQuery internals 
> that have changed lately. I'll update the metadata and post here again 
> when done.
>   
Done! Please update from SVN! It's uses even less code now :-)

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] MetaData plugin - help needed

2006-12-14 Thread Jörn Zaefferer
Hi Chris!
> Hi all,
>
> I'm having a problem with John's metadata plugin.
>
> The value of the parameter arr in the jQuery.fn.get function in 
> metadata.js is always undefined, so at this point:
>
>   return arr && arr.constructor == Array ?
>
> it never branches towards the metadata logic, hence I can never access 
> metadata properties.
>
> To ascertain this I slapped a $.log(arr) immediately after the 
> beginning of the function, but every single jquery query is spitting 
> out undefined at this point.
>
> What is the arr parameter, and why would mine always be undefined?
Thanks for mentioning this. The metadata relies on some jQuery internals 
that have changed lately. I'll update the metadata and post here again 
when done.

-- 
Jörn Zaefferer

http://bassistance.de


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


Re: [jQuery] Help with drop down menus

2006-12-14 Thread Marc Jansen
Sorry, should have been something like this:

$('body *').not(".div_color").click(function(){
$(".div_color").hide();
});

or

$('*').not(".div_color").click(function(){
$(".div_color").hide();
});


both untested, as always ;-)

-- Marc

Marc Jansen schrieb:
> Hi David,
>
> maybe this works:
>
> $('body').not(".div_color").click(function(){
>   $(".div_color").hide();
> })
>
>
> untested.
>
> -- Marc
>
>
> blemming schrieb:
>   
>> I'm trying to create a few drop down option menus that are contained in divs
>> which are initially not displayed.  There each have a image dropdown image
>> with class = div_color. Here is how I am opening the boxes and closing any
>> others that were left open.  
>>
>> $(".box_color").click(function ()
>>  {
>>  $(".div_color").hide();
>>  $(this).next().show();
>>  }   
>> )
>>
>> My question is how do I create an event that will hide() the divs if the
>> user clicks anywhere else on the screen?  I'm new to jQuery so I'm thinking
>> something along these lines might work but I don't know how to properly
>> write the css selector. 
>>
>> // DOESN"T WORK 
>> $('body:not(".div_color")').click(function(){
>>  $(".div_color").hide();
>>  }
>> )
>>
>> Thanks for your help! David
>>   
>> 
>
>
>   


-- 


 Marc Jansen

  Reuterstraße 112
  53129 Bonn
  0228 / 2438694

  Schwalbenweg 2
  53947 Nett./Engelgau
  02486 / 7644

  [EMAIL PROTECTED]




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


Re: [jQuery] Function: $(...).ancestorsTo(match)

2006-12-14 Thread Dave Methvin
> Would this be a candidate for addition to the core possibly?
 
The ancestorsTo looks like it's an up-the-tree analog of the nextUntil
method for siblings that was discussed here a while back. I think the
general consensus on that was that there would be an extended navigation
plugin rather than add all these to the core. Maybe they should be named
ancestorsUntil and siblingsUntil for better consistency?
 
Also, since this is a modifying plugin it should use pushStack() to allow
the use of .end() to get back to the previous selected nodes.  I think the
end result would be something like this, untested:
 
jQuery.fn.ancestorsUntil = function(match) {
 var a = [];
 jQuery(this[0]).ancestors().each(function() {
a.push(this);
return !jQuery(this).is(match);
 });
return this.pushStack(a, arguments);
};


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


Re: [jQuery] Change href of external links

2006-12-14 Thread Dave Methvin
> I was just looking at this again, and wondered how I could
> make it work with a string of links to not be external.  For
> example using a for loop to go through var intLink = link1,
> link2, link3, etc. 
>
>  $("[EMAIL PROTECTED]:not([EMAIL PROTECTED]'"+intLink+"']):not(.thickbox)")
>.bind("click", function(){ return !window.open(this.href); });

You could do it by creating a custom selector that joined a bunch of :not()
clauses:

 var notthese = ["http://test.com";, "http://toast.com";];
 var sel = "[EMAIL PROTECTED]:not(.thickbox)";
 for ( var i=0; i < notthese.length; i++ )
 sel += ":not(@href*="+notthese[i]+")";
 $(sel).bind("click", function(){ return !window.open(this.href); });

Or you could filter them manually:

 $("[EMAIL PROTECTED]:not(.thickbox)").each(function(){
for ( var i=0; i < notthese.length; i++ )
if ( this.href == notthese[i] ) return;
$(this).bind("click", function(){ return !window.open(this.href); });
 });

It would be nice if there was a $().grep() to filter the elements:

 $("[EMAIL PROTECTED]:not(.thickbox)").grep(function(){
for ( var i=0; i < notthese.length; i++ )
if ( this.href == notthese[i] ) return false;
return true;
  }).bind("click", function(){ return !window.open(this.href); });

But that doesn't exist. There's a jQuery.grep but it can't be used in a
chain.


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


Re: [jQuery] Function: $(...).ancestorsTo(match)

2006-12-14 Thread Jonathan Sharp

Thanks for the tip! Here's the updated code... (This is also available at
http://jdsharp.us/code/jQuery/)

jQuery.fn.ancestorsTo = function(match) {
   var j = jQuery();
   var b = false;
   jQuery(this[0]).ancestors().each(function() {
   if (b == false) {
   j.add(this);
   b = jQuery(this).is(match);
   }
   });
   return j;
};

Would this be a candidate for addition to the core possibly?

Cheers,
-js


On 12/13/06, Matt Stith <[EMAIL PROTECTED]> wrote:


plugin devs should remember: Never use $ inside your plugins. Always use
'jQuery'. The reason is that '$' can be changed by the user for support with
other libraries.

On 12/13/06, Jonathan Sharp <[EMAIL PROTECTED]> wrote:

>  I wrote a method that will provide a list of ancestors for any number
> of generations until an ancestor matches the expression. Example:
>
> BODY
>   DIV
> UL.myClass
>   LI
> UL
>   LI #myId
>
> $('#myId').ancestors()
> returns [UL, LI, UL.myClass, DIV, BODY]
>
> $('#myId').ancestors("UL.myClass")
> returns [UL.myClass]
>
> Returns all elements up to and including the match expression
> $('#myId').ancestorsTo("UL.myClass")
> returns [UL, LI, UL.myClass]
>
> Code:
> jQuery.fn.ancestorsTo = function(match) {
> var j = $();
>
> var b = false;
> $(this[0]).ancestors().each(function() {
> if (b == false) {
> j.add(this);
>
> if ($(this).is(match)) {
> b = true;
> }
> }
> });
>
> return j;
> };
>
>
> Cheers,
> -js
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
>

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



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


Re: [jQuery] firefox2 and flash external interface

2006-12-14 Thread Kelvin Luck
play wrote:
> I'm new to this list. Lovin' jQuery. Not sure if this should be posted 
> to ff bugzilla or not but I'm having problems with some strange 
> behaviour with flash ExternalInterface and jQuery in firefox2. 
> Basically, any jQuery function call that occurs after a call to 
> javascript from flash doesn't work. I checked and it's not just jQuery 
> calls in the chain from the ExternalInterface.call, it's any jQuery 
> call. Everything works fine in IE6 and firefox 1.5. Has anyone else 
> experienced this? Any insights into jQuery that could clue me in to a 
> possible workaround? Thanks.
> 

Did you figure out what was going on with this? I've just run into the 
same problem and was wondering if you found a solution... I'll start 
putting together a test case and will check around more but any insight 
would be very gratefully received...

Cheers,

Kelvin :)

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


Re: [jQuery] Small jQuery 1.0.4 problems

2006-12-14 Thread Andy Matthews
Make sure to submit a bug report for any issues you find:
http://jquery.com/dev/bugs/



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Markus Peter
Sent: Thursday, December 14, 2006 11:22 AM
To: jQuery Discussion.
Subject: [jQuery] Small jQuery 1.0.4 problems


Hello

I today upgraded the internal development version of our site from  
jQuery 1.0.3 to jQuery 1.0.4. The upgrade caused some minor troubles  
which I'd like to report:

We use following simple snippet to get a certain :hover effect for  
our tables:

$("table.ruler tbody tr,table.ruler > tr").hover(
 function(e) { $(this).addClass("ruled"); return true; },
 function(e) { $(this).removeClass("ruled"); return true; }
);

This continues to function but spams the Safari JavaScript error  
console with following error message if the mouse pointer hovers  
above a text link within the table.
Type error
jquery.js Line: 1036

(line number in reference to jQuery 1.0.4 in the uncompressed  
version). This maybe is some problem with the event-object fixer for  
Safari.

The effect continues to work, by the way.

Another think I noticed: It seems support for having a string as  
second argument to bind vanished since 1.0.3 - it now seems to always  
expect a function. This should maybe be added to the changelogs - it  
might save others some time in locating problems caused by this  
change or the function should complain during the bind about the  
incompatible datatype. Right now, jQuery 1.0.4 will happily bind an  
event which it cannot handle later on and will die in the  
jQuery.event.handle function.

-- 
Markus Peter - SPiN AG   
[EMAIL PROTECTED]


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


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


Re: [jQuery] Finished: jQuery code assist in Aptana

2006-12-14 Thread Solid Source

Edwin,

Many many thanks!



Edwin Martin wrote:
> 
> Klaus Hartl schreef:
>> Edwin Martin schrieb:
>>   
>>> I created the scriptdoc-file needed for code assist in Aptana.
>>>
>>> You can download it here:
>>>
>>> http://www.bitstorm.org/edwin/jquery/
>>> 
>> Thanks Edwin! Great job!
>>
>> I have sometimes problems with Aptana and large JS files (for example 
>> when opening the complete, uncompressed jQuery file) - it's getting 
>> reeeal slow then -, but I'm using it nevertheless.
>>   
> I'm using the normal, uncompressed JS-file (not the annotated version). 
> So I don't think you will have performance issues.
> 
> The API for Aptana is in a seperate scriptdoc-file.
> 
> On my 1.7GHz notebook I don't notice any performance issues. Well, 
> actually I do: I work much faster now ;-)
> 
> Edwin Martin
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Finished%3A-jQuery-code-assist-in-Aptana-tf2817641.html#a7877076
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Toggling div based on radio buttons

2006-12-14 Thread Alex Cook
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Calamity
Subject: [jQuery] Toggling div based on radio buttons

Basically I have a form with several fieldsets (I can wrap them in divs
if
absolutely necessary) that need to be displayed/hidden based on radio
button
selection. For example:

There are 4 radio buttons: Software, Hardware, Telecom and Field Device

If a user clicks Software, it should display the fieldset that contains
pertinent information for software. If a user misclicked, or has an
additional request for say, hardware, I would like any section that is
shown
to be hidden prior to showing the hardware section.

-

That should be simple enough... Here is some code to get your started:

http://pastie.caboo.se/27620 - HTML

http://pastie.caboo.se/27621 - JavaScript

I tried to keep it pretty basic so it should work with whatever you're
HTML set up is.  Make the fieldset and the radio have the same className
and you should be kosher.

-ALEX

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


[jQuery] Small jQuery 1.0.4 problems

2006-12-14 Thread Markus Peter
Hello

I today upgraded the internal development version of our site from  
jQuery 1.0.3 to jQuery 1.0.4. The upgrade caused some minor troubles  
which I'd like to report:

We use following simple snippet to get a certain :hover effect for  
our tables:

$("table.ruler tbody tr,table.ruler > tr").hover(
 function(e) { $(this).addClass("ruled"); return true; },
 function(e) { $(this).removeClass("ruled"); return true; }
);

This continues to function but spams the Safari JavaScript error  
console with following error message if the mouse pointer hovers  
above a text link within the table.
Type error
jquery.js Line: 1036

(line number in reference to jQuery 1.0.4 in the uncompressed  
version). This maybe is some problem with the event-object fixer for  
Safari.

The effect continues to work, by the way.

Another think I noticed: It seems support for having a string as  
second argument to bind vanished since 1.0.3 - it now seems to always  
expect a function. This should maybe be added to the changelogs - it  
might save others some time in locating problems caused by this  
change or the function should complain during the bind about the  
incompatible datatype. Right now, jQuery 1.0.4 will happily bind an  
event which it cannot handle later on and will die in the  
jQuery.event.handle function.

-- 
Markus Peter - SPiN AG   
[EMAIL PROTECTED]


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


Re: [jQuery] Toggling div based on radio buttons

2006-12-14 Thread Dave Methvin

In the markup, have the fieldsets use class="RequestDetail" id="InfoTYPE"
where TYPE is Software, Hardware, etc. and all initially display:none. The
radio group is name="RequestType" value="TYPE". Untested code, but here's
the idea:

$("#myform [EMAIL PROTECTED]").bind("click", function(){
   $("#myform .RequestDetail:visible).hide();
   $("#Info"+this.value).show();
});

Complicate as needed. :-)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Calamity
Sent: Thursday, December 14, 2006 10:39 AM
To: discuss@jquery.com
Subject: [jQuery] Toggling div based on radio buttons

hi, been playing with jQuery for all of about 3 days, and I need some
assistance on something simple.

Basically I have a form with several fieldsets (I can wrap them in divs if
absolutely necessary) that need to be displayed/hidden based on radio button
selection. For example:

There are 4 radio buttons: Software, Hardware, Telecom and Field Device

If a user clicks Software, it should display the fieldset that contains
pertinent information for software. If a user misclicked, or has an
additional request for say, hardware, I would like any section that is shown
to be hidden prior to showing the hardware section.

I am, unfortunately, struggling with this, any ideas out there?


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


Re: [jQuery] Help with drop down menus

2006-12-14 Thread Marc Jansen
Hi David,

maybe this works:

$('body').not(".div_color").click(function(){
$(".div_color").hide();
})


untested.

-- Marc


blemming schrieb:
> I'm trying to create a few drop down option menus that are contained in divs
> which are initially not displayed.  There each have a image dropdown image
> with class = div_color. Here is how I am opening the boxes and closing any
> others that were left open.  
>
> $(".box_color").click(function ()
>   {
>   $(".div_color").hide();
>   $(this).next().show();
>   }   
> )
>
> My question is how do I create an event that will hide() the divs if the
> user clicks anywhere else on the screen?  I'm new to jQuery so I'm thinking
> something along these lines might work but I don't know how to properly
> write the css selector. 
>
> // DOESN"T WORK 
> $('body:not(".div_color")').click(function(){
>   $(".div_color").hide();
>   }
> )
>
> Thanks for your help! David
>   


-- 


 Marc Jansen

  Reuterstraße 112
  53129 Bonn
  0228 / 2438694

  Schwalbenweg 2
  53947 Nett./Engelgau
  02486 / 7644

  [EMAIL PROTECTED]




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


[jQuery] Help with drop down menus

2006-12-14 Thread blemming

I'm trying to create a few drop down option menus that are contained in divs
which are initially not displayed.  There each have a image dropdown image
with class = div_color. Here is how I am opening the boxes and closing any
others that were left open.  

$(".box_color").click(function ()
{
$(".div_color").hide();
$(this).next().show();
}   
)

My question is how do I create an event that will hide() the divs if the
user clicks anywhere else on the screen?  I'm new to jQuery so I'm thinking
something along these lines might work but I don't know how to properly
write the css selector. 

// DOESN"T WORK 
$('body:not(".div_color")').click(function(){
$(".div_color").hide();
}
)

Thanks for your help! David
-- 
View this message in context: 
http://www.nabble.com/Help-with-drop-down-menus-tf2821960.html#a7876400
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Finished: jQuery code assist in Aptana

2006-12-14 Thread Wil Stuckey

ahh thank you! i've been wanting this.

On 12/14/06, Edwin Martin <[EMAIL PROTECTED]> wrote:


Klaus Hartl schreef:
> Edwin Martin schrieb:
>
>> I created the scriptdoc-file needed for code assist in Aptana.
>>
>> You can download it here:
>>
>> http://www.bitstorm.org/edwin/jquery/
>>
> Thanks Edwin! Great job!
>
> I have sometimes problems with Aptana and large JS files (for example
> when opening the complete, uncompressed jQuery file) - it's getting
> reeeal slow then -, but I'm using it nevertheless.
>
I'm using the normal, uncompressed JS-file (not the annotated version).
So I don't think you will have performance issues.

The API for Aptana is in a seperate scriptdoc-file.

On my 1.7GHz notebook I don't notice any performance issues. Well,
actually I do: I work much faster now ;-)

Edwin Martin

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

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


Re: [jQuery] How to make radio button selected?

2006-12-14 Thread Mike Alsup
$('#check_red')[0].checked = true;


On 12/14/06, Sean O <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
>
> I'm trying to select a radio button based on user input in a text box.
>
> Based on what is typed, I want one of two radio buttons with the same name,
> but distinct IDs, to be selected.  I have the RegEx working fine to pick out
> unique strings in the text box, but can't get the rest.
>
> e.g.
> O red (id=check_red)  O blue  (id=check_blue)
> (id=textbox) [red] -> select red radio button on blur
>
> Tips?

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


Re: [jQuery] jquery autocomplete and mysql

2006-12-14 Thread eugene33

Thanks Matt

I'm trying to build this PHP backend, again my skills are not so good so if
anyone could point me in the right direction ;)


Here is what I come with, expecting to extract the data from my db and then
sort them under a xml skeleton 
So now it's working but I have only one country (the first one). The foreach
function must be the problem, but I really can't figure why

Unable to locate the ' .
$database . ' database at this time.'); }
   
// retrieve customer data
$query="SELECT iso_alpha2, name, population, continent FROM
countryinfo ORDER BY iso_alpha2 DESC";
$result=mysql_query($query);
if (!$result) { exit('Error performing query: ' . mysql_error() .
''); }
   
// close db
mysql_close();
   
while ($row = mysql_fetch_array($result)) {
$iso2 = $row['iso_alpha2'];
$name = $row['name'];
$population = $row['population'];
$continent = $row['continent'];
// etc. etc.
}
$rows = array('iso_alpha2');
foreach ($rows as $row) {
 $returnData =  "  ";
 $returnData.=  "";
 $returnData.=  "";
 $returnData.=  "";
 $returnData.=  "";
 $returnData.=  " ";
}
 $returnXML = "";
 $returnXML.=  "";
 $returnXML.=  "$returnData";
 $returnXML.=  "";

echo $returnXML;
?>
-- 
View this message in context: 
http://www.nabble.com/jquery-autocomplete-and-mysql-tf2783514.html#a7876110
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Change href of external links

2006-12-14 Thread agent2026

Hi,

I was just looking at this again, and wondered how I could make it work with
a string of links to not be external.  For example using a for loop to go
through var intLink = link1, link2, link3, etc.  Just not sure how to go
about getting the loop in there.

  $("[EMAIL PROTECTED]:not([EMAIL PROTECTED]'"+intLink+"']):not(.thickbox)")
.bind("click", function(){ return !window.open(this.href); });

Adam



dave.methvin wrote:
> 
> Even better, you could use the :not() selector to do the job all at once,
> I
> forgot about it. 
> 
>   $("[EMAIL PROTECTED]:not([EMAIL PROTECTED]'internal.com/']):not(.thickbox)")
>  .bind("click", function(){ return !window.open(this.href); }); 
> 
> This is the way jQuery optimization usually goes. You start with 10 lines
> of
> jQuery that would have been 20 lines of tedious DOM Javascript. By the
> time
> you are done it's down to two or three lines and it couldn't get any
> shorter
> unless it read your mind. :-)
> 

-- 
View this message in context: 
http://www.nabble.com/Change-href-of-external-links-tf2718387.html#a7876017
Sent from the JQuery mailing list archive at Nabble.com.


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


[jQuery] How to make radio button selected?

2006-12-14 Thread Sean O

Hi,


I'm trying to select a radio button based on user input in a text box.

Based on what is typed, I want one of two radio buttons with the same name,
but distinct IDs, to be selected.  I have the RegEx working fine to pick out
unique strings in the text box, but can't get the rest.

e.g.
O red (id=check_red)  O blue  (id=check_blue)
(id=textbox) [red] -> select red radio button on blur

Tips?


Thanks,

SEAN O

-- 
View this message in context: 
http://www.nabble.com/How-to-make-radio-button-selected--tf2821791.html#a7875982
Sent from the JQuery mailing list archive at Nabble.com.


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


[jQuery] Toggling div based on radio buttons

2006-12-14 Thread Calamity

hi, been playing with jQuery for all of about 3 days, and I need some
assistance on something simple.

Basically I have a form with several fieldsets (I can wrap them in divs if
absolutely necessary) that need to be displayed/hidden based on radio button
selection. For example:

There are 4 radio buttons: Software, Hardware, Telecom and Field Device

If a user clicks Software, it should display the fieldset that contains
pertinent information for software. If a user misclicked, or has an
additional request for say, hardware, I would like any section that is shown
to be hidden prior to showing the hardware section.

I am, unfortunately, struggling with this, any ideas out there?
-- 
View this message in context: 
http://www.nabble.com/Toggling-div-based-on-radio-buttons-tf2821322.html#a7874735
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Simple code, but not working with IE 6 / 7

2006-12-14 Thread Vincent Majer
I don't have duplicate id in my document, so the problem does not come 
from that point.

I've tried the code you are proposing, but it does not change the 
comportment in IE 6 / 7..

In IE 6, it works sometimes (seems to be a question of luck).. In IE 7, 
it seems not to work at all..




Peter Bengtsson a écrit :
>> 
>> $().ready(function(){
>>
>>  $("a.ShowMap").click(
>>  function()
>>  {
>>  
>> $("div.dynamic_zone").find("div#description").css({display:"none"});
>>  $("div.dynamic_zone").find("div#map").show("slow");
>>  
>>  });
>>  
>>  $("a.ShowImage").click(
>>  function(){
>>  $("div.dynamic_zone").find("div#map").css({display:"none"});
>>  $("div.dynamic_zone").find("div#description").show("slow");
>>  });
>>
>>
>> });
>> 
>>
> 
> I'm not a jQuery expert but why not just do this:
> 
>   $("a.ShowMap").click(
>   function()
>   {
>   $("div#description").css({display:"none"});
>   $("div#map").show("slow");
>   
>   });
>   
>   $("a.ShowImage").click(
>   function(){
>   $("div#map").css({display:"none"});
>   $("div#description").show("slow");
>   });
> 
> A valid XHTML page can only on contain 1 of the same ID tag.
> 
> 
> 
> 
> 
> 
> 

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


Re: [jQuery] Duplicate Events

2006-12-14 Thread Dave Methvin
> If i understand correctly we should only get one alert
> popping up since we registered the function globally
> and unclicked it. But it doesn't work :(( 

Works for me...is that the only code in your document.ready?


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


Re: [jQuery] Flash plugin and ExternalInterface

2006-12-14 Thread Kelvin Luck
Yeah - the good thing about ExternalInterface is that it also works the 
other way... You can (easily and reliably) call functions in Flash from 
JavaScript. Which I need to be able to do in this case...

I'll let you know if I figure anything out - thanks again for the plugin,

Kelvin :)

Luke Lutman wrote:
> I haven't used ExternalInterface before, but I have used:
> 
> getURL("javascript:myfunction(123,'abc');");
> 
> To call a javascript function from flash. This works like a charm if 
> passing numbers and strings (or JSON strings) to the function will 
> suffice, and is backwards compatible (as far as Flash 6, I think).
> 
> Luke
> 
> Kelvin Luck wrote:
>> Hi,
>>
>> I'm using the really nice "jQuery Flash Plugin"( 
>> http://jquery.lukelutman.com/plugins/flash/ ) to embed some Flash in a 
>> page I'm building. This Flash needs to communicate with JS through 
>> Flash's ExternalInterface. When embedded with the plugin IE fires a JS 
>> error (a very useful "Syntax error"!). If I embed a different swf 
>> which doesn't use ExternalInterface all is fine. And of course 
>> everything is fine in Firefox.

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


Re: [jQuery] jquery autocomplete and mysql

2006-12-14 Thread eugene33

Thanks Matt

I'm trying to build this PHP backend but nothing is working, again my skills
are not so good so if anyone could point me in the right direction ;)


Here is what I come with, expecting to extract the data from my db and then
sort them under a xml skeleton

";
$exceptionstring .= mysql_errno() . ": " . mysql_error();
throw new exception ($exceptionstring);
  } else {
mysql_select_db (MYSQLDB,$db);
  }
   return $db;
 } catch (exception $e) {
   echo $e->getmessage();
   die();
 }
   }

 function search(){
   $query = "SELECT iso_alpha2, name, population, continent FROM countryinfo
ORDER BY name ASC";
$database->setQuery( $query );
$name = $database->loadObjectList();
$iso = $_GET['iso_alpha2'];
$population = $_GET['population'];
$continent = $_GET['continent'];

header('Content-type: text/xml');

$q = strtolower($_GET["q"]);
if (!$q) return;
header('Content-type: text/xml');
$items = array(
echo "";
echo "";
foreach ($options as $items) {
echo "  ";
echo "";
echo "";
echo "";
echo " ";
}
echo "";
);
$items = array_flip($items);
foreach ($items as $key=>$value) {
if (strpos(strtolower($key), $q) !== false) {
echo "$key|$value\n";
}
}
}
-- 
View this message in context: 
http://www.nabble.com/jquery-autocomplete-and-mysql-tf2783514.html#a7873838
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Duplicate Events

2006-12-14 Thread floepi


A 

Please try for yourselves on any page.

var hello = function() {
alert('funzt nicht');
};
$('#mainWindow').unclick(hello).click(hello);
$('#mainWindow').unclick(hello).click(hello);

If i understand correctly we should only get one alert popping up since we
registered the function globally and unclicked it. But it doesn't work :((

Well i hope we can solve this mystery - thanks very much for your time guys. 

Cheers

Phil



floepi wrote:
> 
> I guess i am doing something wrong. If i try this
> 
> $('#mainWindow').click(function() { alert("Hello"); });
> $("#mainWindow").unbind( "click", function() { alert("Hello"); });
> 
> where the functions are identical, it still does not work. It will invoke
> the alert function when i click in the mainWindow. 
> 
> I must be missing something. 
> 
> Cheers
> 
> Phil
> 
> 
> 
> Sam Collett wrote:
>> 
>> On 14/12/06, floepi <[EMAIL PROTECTED]> wrote:
>>>
>>> Hi,
>>>
>>> i have the following problem using the events in jQuery:
>>>
>>> $('#mainWindow').click(function(){
>>>  alert('test');
>>> });
>>>
>>> and load this function at the end of a php script:
>>> >> bla bla bla
>>> ?>
>>> 
>>> my function
>>> 
>>>
>>> The problem is that i load this data into the mainWindow which means,
>>> that
>>> the event gets attached each time i load content into the mainWindow. So
>>> when i click in the mainWindow i get multiple alert messages.
>>>
>>> Is there a way to tell jQuery to overwrite the event if the function is
>>> the
>>> same. Otherwise i have to use the specific unbind each time i load data
>>> into
>>> the window, which feels hacky and unnecessary.
>>>
>>> Thanks for your time. Maybe you know how to solve my problem.
>>>
>>> Cheers
>>>
>>> Phil
>> 
>> Have you tried 'unclick'?
>> 
>> $('#mainWindow').unclick().click(...
>> 
>> ___
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Duplicate-Events-tf2820382.html#a7873813
Sent from the JQuery mailing list archive at Nabble.com.


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


Re: [jQuery] Simple code, but not working with IE 6 / 7

2006-12-14 Thread Peter Bengtsson
> 
> 
> $().ready(function(){
> 
>   $("a.ShowMap").click(
>   function()
>   {
>   
> $("div.dynamic_zone").find("div#description").css({display:"none"});
>   $("div.dynamic_zone").find("div#map").show("slow");
>   
>   });
>   
>   $("a.ShowImage").click(
>   function(){
>   $("div.dynamic_zone").find("div#map").css({display:"none"});
>   $("div.dynamic_zone").find("div#description").show("slow");
>   });
> 
> 
> });
> 
> 

I'm not a jQuery expert but why not just do this:

$("a.ShowMap").click(
function()
{
$("div#description").css({display:"none"});
$("div#map").show("slow");

});

$("a.ShowImage").click(
function(){
$("div#map").css({display:"none"});
$("div#description").show("slow");
});

A valid XHTML page can only on contain 1 of the same ID tag.







-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com

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


Re: [jQuery] Duplicate Events

2006-12-14 Thread Dave Methvin
> I guess i am doing something wrong. If i try this
>
> $('#mainWindow').click(function() { alert("Hello"); });
> $("#mainWindow").unbind( "click", function() { alert("Hello"); });
>
> where the functions are identical, it still does not work.
> It will invoke the alert function when i click in the mainWindow. 
>
> I must be missing something. 

The function text is identical, but they are not the same function object.
The .unbind() is getting a different function so it doesn't match the
original in .bind().

You can check the ECMA 262 spec but this is what I recall:

1) A "new Function(...)" always creates a new unique function object each
time it executes--even if it has the same text each time.

2) A function created inside an eval() always creates a new unique function
object each time it executes.

3) An anonymous inline function encountered at a specific point in static
program text represents a specific function object. (This is the rule that
causes problems for the example above.)

4) A Javascript implementation can use the same function object for two
different functions declared in static program text only if it can ensure no
interference between the two. In practice this is nearly impossible to do,
so I don't think any interpreter does it. (Think of issues like closures, or
static properties assigned to the function object itself.) 



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


Re: [jQuery] Flash plugin and ExternalInterface

2006-12-14 Thread Luke Lutman
I haven't used ExternalInterface before, but I have used:

getURL("javascript:myfunction(123,'abc');");

To call a javascript function from flash. This works like a charm if passing 
numbers and strings 
(or JSON strings) to the function will suffice, and is backwards compatible (as 
far as Flash 6, 
I think).

Luke

Kelvin Luck wrote:
> Hi,
> 
> I'm using the really nice "jQuery Flash Plugin"( 
> http://jquery.lukelutman.com/plugins/flash/ ) to embed some Flash in a 
> page I'm building. This Flash needs to communicate with JS through 
> Flash's ExternalInterface. When embedded with the plugin IE fires a JS 
> error (a very useful "Syntax error"!). If I embed a different swf which 
> doesn't use ExternalInterface all is fine. And of course everything is 
> fine in Firefox.
> 
> Has anyone run into any problems like this before?
> 
> Cheers,
> 
> Kelvin :)
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/


-- 
zinc Roe Design
www.zincroe.com
(647) 477-6016

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


Re: [jQuery] Duplicate Events

2006-12-14 Thread Klaus Hartl
floepi schrieb:
> I guess i am doing something wrong. If i try this
> 
> $('#mainWindow').click(function() { alert("Hello"); });
> $("#mainWindow").unbind( "click", function() { alert("Hello"); });
> 
> where the functions are identical, it still does not work. It will invoke
> the alert function when i click in the mainWindow. 
> 
> I must be missing something. 
> 
> Cheers
> 
> Phil

The functions are identical but still they are not the same objects.

Try:

var hello = function() {
 alert("Hello");
};
$('#mainWindow').unclick(hello).click(hello);


-- Klaus



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


Re: [jQuery] Duplicate Events

2006-12-14 Thread Sam Collett
On 14/12/06, Sam Collett <[EMAIL PROTECTED]> wrote:
> In that case, don't attach as an anonymous connection.

I meant anonymous function...

Got databases on the mind at the moment

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


  1   2   >