[jQuery] Re: Jquery gaming....

2008-08-26 Thread Paul Bakaus

Hi there,

I do have some experience with it, building a isometric game engine in
jQuery right now.
Best you ask me your questions directly via email, since I don't often
read the standard
jQuery lists.

Cheers,
Paul

On Aug 26, 8:15 pm, Aaron <[EMAIL PROTECTED]> wrote:
> Hi I am currently working on a website getting close to finishing it
> so I wanted to try and get ready for my other project after the
> website is done and ready.
>
> I plan on making a online game.
>
> Is their any good place where I can learn how to use jquery for 2d
> adventure type games??


[jQuery] Using keypress for key combination

2008-08-26 Thread hubbs

I have been looking for a way to have a key combination fire an alert,
but searching the group I have not really found what I was looking
for.  There are some plugins that I have found, but I would rather
just use jQuery without anything additional.

So, I found this:

$("input:text").bind("keypress",function(e) {
var key = e.keyCode || e.charCode;
if(key == 13) {
alert("You clicked a key!");
}
}
)

How could I have a key combination fire such, such as cntrl + d or
something similar?


[jQuery] Re: ajax IE error - only loads parts of the response

2008-08-26 Thread MorningZ

Without really getting into your code too much (i've never seen
someone try to split on a long string like that), have you considered
using JSON (using the getJSON method) to retrieve this data instead?

then you could say

$('#popList').html(response.List);
$('#holdBands').html(response.Bands);

instead of all that string manipulation stuff


[jQuery] Re: Turn off elements depending on current URL

2008-08-26 Thread Dave Methvin

Try putting your code inside a document.ready handler; otherwise it
will run too soon.


[jQuery] Re: Superfish - Evenly spread menu through entire width of ul

2008-08-26 Thread Joel Birch

Hello,

If for example you have 5 main menu items, you could set the top level
li elements to width:20% (or an equivalent pixel measurement) so that
the anchors, being display:block, expand to fill their li parent. You
may also want to set text-align:center on those anchors.

Good luck.

Joel Birch.


[jQuery] ajax IE error - only loads parts of the response

2008-08-26 Thread pedalpete

Hey Gang,

I've got two problems with IE (6&7) on a page that works perfectly in
Safari.

The problem seems to be that when retrieving an ajax response, only
parts of the response are properly loaded into the page.

if you want to take a look, I've set up a test environment at
http://zifimusic.com/test-v2

Problem #1
I make an ajax request to get two lists (from one request).
I then split the list into two, and the first part of the list goes
into one div, and the second part goes into a second list.

The code I use is
[code]
success: function(response){
$('#features').html('feature artistsupcoming shows ');
var splitList = 
response.split("remoteSplitList");
alert(splitList[1]);
$('#popList').html(splitList[0]);
$('#holdBands').html(splitList[1]);
}
[/code]

For some reason, IE will never show the 'splitList[1]'. I've swaped
the splitLists into the different divs, and IF I put $
(#holdBands').html(splitList[0]);, the first part of this list will
show in the holdBands area.
I have also put an alert on the splitList[1], and it does contain the
correct content in IE.

I've also gone through my CSS, and since it works perfectly in FF and
Safari, I think the problem may be the way the content is being
written in IE.

The second problem is very similar.
When selecting an artist, I make an ajax request, which gets shows,
albums, etc.
For some reason if the artist has albums, only the last album shows
up, if the artist does not have albums, then everything shows up
(songs, shows, etc.).

Again, looking at the alerts, both of the results look very similar,
and everything works in FF and Safari, but not IE's .

Here's that bit of code too (though I doubt this will be very helpful)
[code]
success: function(response){
alert(response);

$('#artistPage').html(response);
}
[/code]

I've spent many hours looking at this and trying things, but am
completely stumped...
any ideas?


[jQuery] Re: Disable jQuery Temporarily

2008-08-26 Thread MorningZ

Why not take the angle of fixing the Javascript error?

show the code!


[jQuery] Ajax and Rails

2008-08-26 Thread s.ross


I'm totally sure this has been asked and answered 1_000_000 times, but  
Google has let me down on this one. I'm using a link to trigger an  
ajax call that create a row in the database. On successful completion,  
a row in the DOM is appended.


Getting around to the question (you knew there was a question in here  
someplace, right?), I'm trying to return some JSON on success or an  
array of errors on failure. My failure also sets the HTTP status to  
"406 Unprocessable Entity". Firebug confirms this is all happening,  
but my $.ajax call always triggers the success: callback.


What is the magic differentiator that $.ajax uses to discern between a  
successful and failing server response?


TIA

Steve


[jQuery] Re: Plugin understanding question

2008-08-26 Thread Seungjin

Thank you so much guys. It really helped.

On Aug 26, 2:34 pm, Mike Alsup <[EMAIL PROTECTED]> wrote:
> > Instead of
> >    size()
> > He meant:
> >    this.size() which is the same as this.length
>
> Indeed!  Thanks for the correction, Ariel.


[jQuery] Disable jQuery Temporarily

2008-08-26 Thread Eureka DC

For some reason, I can't run a regular JavaScript prototype without a
jQuery error saying something like "this.blah" is not a function.

So, is there either a way to disable jQuery's trigger handler
temporarily or disable jQuery entirely temporarily without removing
the jQuery script?

Thanks in advance!


[jQuery] Re: [autocomplete] Auto populate form input field based on another

2008-08-26 Thread VirusMinus

Hi Jorn,

Is there a way to call a function when no results are returned by the
input the user has typed into the autocomplete?

This would be ideal as an option or a method for the autocomplete
object.

I've seen a few people ask for this on your site and also here. You
mentioned including such functionality in a future release but I don't
think it was done.

Anyone mange to do this or have pointers on how I could go about
implementing it myself?

If I succeed maybe we can add this as a feature to the current build
of autocomplete?

Cheers,
VM

On Aug 27, 8:04 am, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> The download includes demo PHP scripts that you can look at. Or check
> it online 
> viahttp://dev.jquery.com/view/trunk/plugins/autocomplete/demo/search.phps
> (linked fromhttp://jquery.bassistance.de/autocomplete/demo/)
>
> Jörn
>
> On Tue, Aug 26, 2008 at 10:11 PM, Mattl <[EMAIL PROTECTED]> wrote:
>
> > Thanks Jörn,
> > Is there a tutorial or demo that shows what the php file that queries
> > the db should look like, or in what format the results need to be
> > returned in?
>
> > ie what does 'my_autocomplete_backend.php' look like?
>
> > I've not been able to find one.
>
> > Thanks in advance,
> > Matt
>
> > On Aug 25, 11:32 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > wrote:
> >> The autocomplete plugin
> >> (http://plugins.jquery.com/project/autocompletex) can do that. Set the
> >> one up as usual, and configure the other one with a dynamic extra
> >> paramter:
>
> >> $("#second").autocomplete("url", {
> >>         extraParams: {
> >>                 first: function() {
> >>                         return $("#first").val();
> >>                 }
> >>         }
>
> >> });
>
> >> Jörn
>
> >> On Mon, Aug 25, 2008 at 11:22 PM, Mattl <[EMAIL PROTECTED]> wrote:
>
> >> > Hi,
> >> > Anyone know of a jQuery plugin similar to the Autocomplete that could
> >> > do the following?
>
> >> > I have a mysql db with two columns, 'Lot No' and 'Description'.
>
> >> > I have a form with two input fields, 'Lot No' and 'Description' and
> >> > I'd like the 'Description' input field to be auto-populated from the
> >> > database based on the entry the user puts into the 'Lot No' input
> >> > field.
>
> >> > ie if they typed in '1' into the 'Lot No' field then the 'Description'
> >> > input field would call up the corresponding row entry to '1' from the
> >> > database.
>
> >> > Hope I've explained this clearly enough...
>
> >> > Many thanks
> >> > Matt


[jQuery] Re: possible bug in each()? moving from 1.2.3 to 1.2.6

2008-08-26 Thread mausch

Thanks Ariel!

On Aug 26, 3:43 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> You can either update Prototype/Scriptaculous to 1.8.x or try the
> latest jQuery revision on the trunk. That should be 'patched'.
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com
>
> On Aug 25, 1:59 pm, mausch <[EMAIL PROTECTED]> wrote:
>
> > Nevermind, it was executing prototype's each() (I was also including
> > prototype on the same page) instead of jQuery's.
> > Why this changed from 1.2.4 to 1.2.6 (everything else being equal)
> > remains a mystery to me.
>
> > On Aug 25, 1:12 pm, mausch <[EMAIL PROTECTED]> wrote:
>
> > > I'm having the same problem here. If I execute the following in a
> > > firebug console in one of our pages:
>
> > > jQuery('input').each(function() {console.log(this)})
>
> > > With 1.2.4 I get the individual elements:
>
> > > 
> > >  > > size="10" name="currentSearch">
> > > 
> > > 
> > > ...
>
> > > With 1.2.6 I get one array containing all matching elements:
>
> > > [input, input#InputSearch, input#btnSearch, input,
> > > input#impressionsToAdd, input#checkAllHigh on, input#checkAllBold on,
> > > input#checkAllFeatured on, input#checkAllSponsored on,
> > > input#save1.save, input#chkHigh_1.chkStyle 1, input#chkBold_1.chkStyle
> > > 1, input#chkFeatured_1.chkStyle 1, input#chkSponsored_1.chkStyle 1,
> > > input#chkHigh_2.chkStyle 2, input#chkBold_2.chkStyle 2,
> > > input#chkFeatured_2.chkStyle 2, input#chkSponsored_2.chkStyle 2,
> > > input#chkHigh_3.chkStyle 3, input#chkBold_3.chkStyle 3,
> > > input#chkFeatured_3.chkStyle 3, ...]
>
> > > Any ideas? Can anyone confirm that this is a bug or a new behavior?


[jQuery] Superfish - Evenly spread menu through entire width of ul

2008-08-26 Thread Ara

Quick question (hopefully quick).  I'm trying to use superfish to
create a nav bar style menu, this all works as advertised, however
I've set the width of the  to be 960px, I'd like all the li's to
spread evenly through the entire 960px.

The default behavior is squished to the left, I know I could fix this
manually using margins, padding, borders, etc ... however I would like
more of a table style layout using ul, li's and superfish.

Anyone try this before?  I don't think I need to paste any examples,
I'm using the stock examples from 
http://users.tpg.com.au/j_birch/plugins/superfish/.

Thanks in advance.


[jQuery] UK salaries

2008-08-26 Thread Andrew Hedges

Hi all,

Can anyone provide guidance on ranges for salaries in the UK for
experienced jQuery / JavaScript / UI programmers?

Cheers,
-Andrew


[jQuery] Re: tablesorter.js default sort

2008-08-26 Thread me-and-jQuery

Hello. This is exactly what I also need (for specific row specific
first-click order). But I found simple turnaround with writing own
parser which add negative sign (-) at the begining (I know that css
still shows wrong order, but ok, the main problem is solved with
that).

But I would love if we would be able to set the first-click order
through metadata.


On Aug 12, 7:57 pm, MorningZ <[EMAIL PROTECTED]> wrote:
> oops. allow me a correction:
>
> your original post made me think that it was a good
> idea to be able to sort DEscending on the first click (it was
> requested
> by some users of my application)


[jQuery] Nesting Selector

2008-08-26 Thread CaCaEgg

Hello, i got a little problem with using selector,

i want to using selector to select a range of element,

can i use as following code?

$(object:gt(lowerBound-1):lt(upperBound+1)).doFunction();

thx!


[jQuery] Re: Understanding event delegation

2008-08-26 Thread hubbs

Bummer that is has to be done this way.  If I have a large block of
code that is needed for the click event, I would have to put it twice
in my code to account for the spans inside of my anchor.  Even with
doing this, and having more js, is it still a better idea to use event
delegation rather than something like livequery, where each element
gets an event binded?

On Aug 26, 2:01 pm, Brian Schilt <[EMAIL PROTECTED]> wrote:
> > so when you have an anchor set as
> > block, with a few spans to style text, it is hard to click on the
> > actual anchor to give it the class.  Is this normal?
>
> That is a normal reaction when using event delegation and its one of
> the "difficulties" that Ariel was probably referring to. You'll need
> to set up your event delegation to account for 1) clicking on the
> actual anchor and 2) clicking on the child span tag.
>
> You'll need to add a condition to your IF statement to account for the
> span tags...When $target is a span, select its parent anchor element.
>
> if ($target.is('.scroll a')) {
>   $("a.selected").removeClass("selected");
>   $(event.target).addClass("selected");}
>
> else if ($target.is('span')) {
>   var $anchor = $target.parent('a');
>   $("a.selected").removeClass("selected");
>   $anchor.addClass("selected");
>
> }
>
> Brian
>
> On Aug 26, 4:22 pm, hubbs <[EMAIL PROTECTED]> wrote:
>
> > Hmmm, I take that back.  It still seems like the is() is able to
> > select child elements of the anchor, so when you have an anchor set as
> > block, with a few spans to style text, it is hard to click on the
> > actual anchor to give it the class.  Is this normal?
>
> > On Aug 26, 11:37 am, hubbs <[EMAIL PROTECTED]> wrote:
>
> > > Thank you, that fixed it.
>
> > > Is the limitation of is() a javascript limitation, or a jQuery
> > > limitation?  Would this be coming in a new version of jQuery?
>
> > > Also, with event delegation, would you recommending using it for all
> > > event instances on a page?  I have a few places where a single click
> > > event is added to an ID, and I figure it is really not necessary to
> > > mess with event delegation there.
>
> > > On Aug 26, 11:31 am, Ariel Flesler <[EMAIL PROTECTED]> wrote:
>
> > > > Note that is() doesn't accept complex selectors (yet). The reason of
> > > > your problems is probably this.
> > > > Event delegation is surely the best approach, if you can live with its
> > > > difficulties.
>
> > > > --
> > > > Ariel Fleslerhttp://flesler.blogspot.com
>
> > > > On Aug 26, 2:31 pm, hubbs <[EMAIL PROTECTED]> wrote:
>
> > > > > I am working to replace all of my uses of livequery with event
> > > > > delegation (is this even a good idea?) and have a few questions.
>
> > > > > I have a simple script that will add a "selected" class to a link when
> > > > > it is clicked.  It does work using event delegation, but it seems that
> > > > > it is not limiting it to anchor tags, but will also add the "selected"
> > > > > class to any spans that are inside my anchor.  This seems strange, and
> > > > > is not what I want, is something wrong with the following code?
>
> > > > >  $('body').click(function(event) {
> > > > >         var $target = $(event.target);
> > > > >         if ($target.is('.scroll a')) {
> > > > >             $("a.selected").removeClass("selected");
> > > > >             $(event.target).addClass("selected");
> > > > >         }
> > > > >     });


[jQuery] Re: Password and Equalto

2008-08-26 Thread Jörn Zaefferer
The demo is here: http://jquery.bassistance.de/validate/demo/
I just commited the proposed solution to svn, see
http://dev.jquery.com/view/trunk/plugins/validate/demo/

Jörn

On Wed, Aug 27, 2008 at 12:05 AM, MorningZ <[EMAIL PROTECTED]> wrote:
>
> "I noticed the same thing in the demo on the jquery
> example"
>
> Where is this example?
>


[jQuery] Re: Password and Equalto

2008-08-26 Thread MorningZ

"I noticed the same thing in the demo on the jquery
example"

Where is this example?


[jQuery] Re: [autocomplete] Auto populate form input field based on another

2008-08-26 Thread Jörn Zaefferer
The download includes demo PHP scripts that you can look at. Or check
it online via 
http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/search.phps
(linked from http://jquery.bassistance.de/autocomplete/demo/)

Jörn

On Tue, Aug 26, 2008 at 10:11 PM, Mattl <[EMAIL PROTECTED]> wrote:
>
> Thanks Jörn,
> Is there a tutorial or demo that shows what the php file that queries
> the db should look like, or in what format the results need to be
> returned in?
>
> ie what does 'my_autocomplete_backend.php' look like?
>
> I've not been able to find one.
>
> Thanks in advance,
> Matt
>
> On Aug 25, 11:32 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> wrote:
>> The autocomplete plugin
>> (http://plugins.jquery.com/project/autocompletex) can do that. Set the
>> one up as usual, and configure the other one with a dynamic extra
>> paramter:
>>
>> $("#second").autocomplete("url", {
>> extraParams: {
>> first: function() {
>> return $("#first").val();
>> }
>> }
>>
>> });
>>
>> Jörn
>>
>> On Mon, Aug 25, 2008 at 11:22 PM, Mattl <[EMAIL PROTECTED]> wrote:
>>
>> > Hi,
>> > Anyone know of a jQuery plugin similar to the Autocomplete that could
>> > do the following?
>>
>> > I have a mysql db with two columns, 'Lot No' and 'Description'.
>>
>> > I have a form with two input fields, 'Lot No' and 'Description' and
>> > I'd like the 'Description' input field to be auto-populated from the
>> > database based on the entry the user puts into the 'Lot No' input
>> > field.
>>
>> > ie if they typed in '1' into the 'Lot No' field then the 'Description'
>> > input field would call up the corresponding row entry to '1' from the
>> > database.
>>
>> > Hope I've explained this clearly enough...
>>
>> > Many thanks
>> > Matt
>


[jQuery] Re: Password and Equalto

2008-08-26 Thread Jörn Zaefferer
The plugin is unable to detect that scenario, and implementing support
for it is not trivial. A workaround triggers validation on the confirm
field when the password field is blurred.

There is an example in the Marketo demo, second step:
http://jquery.bassistance.de/validate/demo/marketo/step2.htm
Uncheck the "Same as company" checkbox, submit the form, the check the
checkbox. You'll notice that the number of invalid fields is updated.
The relevant code is this:

$("input.toggleCheck").click(function() {
if (this.checked == true) {
subTableDiv.slideUp("medium");
$("form").valid();
} else {
subTableDiv.slideDown("medium");
}
});

You'd have to add similar code to your form:

$("#password").blur(function() {
$("#confirm").valid();
});

Let me know if that does the trick, and I'll add it to the documentation.

Jörn

On Tue, Aug 26, 2008 at 7:36 PM, koolkat <[EMAIL PROTECTED]> wrote:
>
> I have two input boxes: password and password confirmation.
> The password confirmation has the following validation code:
> equalTo: "Please enter the same password as above"
>
> This works fine as long as the user enters the password first.
> However, if the reverse happens and the user enters the confirm first,
> the error message does not disappear when the user correctly completes
> the password field. I noticed the same thing in the demo on the jquery
> example for this feature so I am wondering if there is any work around?
>


[jQuery] Re: AutoComplete -bassistance

2008-08-26 Thread Jörn Zaefferer
Try this instead:

$("#name").autocomplete("employeedirectory?command=ajax&limit=10");

Appending the parameter isn't your task - the plugin does handle that.
Just as the event handling...

I can highly recommend to read a few jQuery tutorials, eg. start with
this http://docs.jquery.com/How_jQuery_Works and continue here:
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
That will give you a much much better idea how jQuery's programming model works.

Jörn

On Tue, Aug 26, 2008 at 6:09 PM, kreiss <[EMAIL PROTECTED]> wrote:
>
> Jorn,
> Thanks for sticking w/ me...I almost have it!
>
> However below is the url i'm sending but the "q" value is not being
> recognized in my servlet...I'm I sending it over correctly?
>
> //JAVASCRIPT
> $(function()
> {
> $("#name").autocomplete("employeedirectory?command=ajax&q=" +
> document.forms[0].empName.value
>  + "&limit=10");
> });
>
> //IN THE HTML
> Name:
>
> //TRYING TO RECOGNIZE "Q" VALUE IN SERVLET
> String dataInput = req.getParameter("q").toUpperCase();
>
> Thanks so much!!
>
> Jörn Zaefferer wrote:
>> Look:
>>
>> $(function() {
>>   $("#name").autocomplete("someurl");
>> });
>>
>> That does nothing but bind a few event handlers. It doesn't create DOM
>> elements, nor does it load any records.
>>
>> As soon as the user starts typing, the keyup-event-handler loads some
>> data via ajax - how many rows are returned is up to your serverside.
>> It then creates the necessary DOM elements to show the result list and
>> adds event handlers to that (for keyboard navigation etc.).
>>
>> I hope that gives you a better idea how it works.
>>
>> Jörn
>>
>> On Mon, Aug 25, 2008 at 8:22 PM, kreiss <[EMAIL PROTECTED]> wrote:
>> >
>> > First of all...thanks for the help!
>> > I have about 4500 records in the database  (its an employee
>> > database)...if I understand correctly...on the document ready should I
>> > bring in all 4500 records?  Would the autocomplete be slow to respond
>> > due to all the records
>> >
>> > The reason I was doing an onKeyUp is so I could limit the number of
>> > records that the servlet brought back, keeping the array in javascript
>> > smaller..
>> >
>> > My question is am I supposed to bring back ALL records on the document
>> > ready?
>> >
>> > Thanks so much.
>> >
>> >
>> >
>> >
>> >
>> >
>> > Jörn Zaefferer wrote:
>> >> You're binding the autocomplete on keyup, which binds another keyup
>> >> event - every time. Remove your inline event handler and initialize
>> >> the autocomplete just once on document ready.
>> >>
>> >> Jörn
>> >>
>> >> On Mon, Aug 25, 2008 at 4:52 PM, kreiss <[EMAIL PROTECTED]> wrote:
>> >> >
>> >> > Following the documentation, it seems I'm doing it correctly...I'm
>> >> > getting data back from my database, but I just have to click out of
>> >> > the textbox first before I see the data, other than that it works
>> >> > great.
>> >> >
>> >> > Jörn Zaefferer wrote:
>> >> >> Please take a look at the examples here:
>> >> >> http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/
>> >> >>
>> >> >> The "remote" examples are based on PHP, but still show the essential
>> >> >> stuff. You've got it all mixed up.
>> >> >>
>> >> >> Jörn
>> >> >>
>> >> >> On Fri, Aug 22, 2008 at 9:57 PM, kreiss <[EMAIL PROTECTED]> wrote:
>> >> >> >
>> >> >> > I'm close to getting the autocomplete to finally work...but.
>> >> >> >
>> >> >> > First of all, I'm using Java / .jsp to query a database for results
>> >> >> >
>> >> >> > I'm sending the url to my servlet, my servlet passes the data back to
>> >> >> > the .jsp pageNothing appears in my dropdown UNLESS I use my 
>> >> >> > mouse,
>> >> >> > click outside of the textbox and then click back into it.  Then the
>> >> >> > autocomplete works great and displays the data from the database
>> >> >> >
>> >> >> > I've tried IE, Opera, Firefox and everyone of them requires me to
>> >> >> > start typing in the text box, click out, click back in then the
>> >> >> > autocomplete displays.
>> >> >> >
>> >> >> > Is this a bug or am I'm doing something wrong.
>> >> >> >
>> >> >> > I've read something in this form about a guy wanting to know if there
>> >> >> > was a "reinitialize" function that could be called in the javascript
>> >> >> > once the data was brought back from the servlet...I didn't see a
>> >> >> > solutions, but think maybe this is what I need.
>> >> >> >
>> >> >> > Here is sample code:
>> >> >> >
>> >> >> > //JavaScript Code
>> >> >> > function getNames()
>> >> >> > {
>> >> >> >  $("#name").autocomplete("employeedirectory?command=ajax&q=" +
>> >> >> > document.forms[0].test.value + "&limit=10");
>> >> >> > }
>> >> >> >
>> >> >> > //HTML
>> >> >> > Name:
>> >> >> > 

[jQuery] Re: Multiple FCKEditor instances & validate plugin problem

2008-08-26 Thread Diogo Abdalla
Well, at least Im not alone.

Since Im on a very, very tight deadline (tomorrow), I guess I will try my
luck with another editor, like that Tiny one.

On Tue, Aug 26, 2008 at 4:34 PM, David Di Biase <[EMAIL PROTECTED]>wrote:

> It would be so great if someone had an answer for this. I was struggling
> with the issue this last week!
>
> Thanks,
>
> -
> David D.
>
>
>
> On Tue, Aug 26, 2008 at 12:59 PM, Diogo <[EMAIL PROTECTED]> wrote:
>
>>
>> Nobody?
>>
>> On Aug 25, 10:55 pm, Diogo <[EMAIL PROTECTED]> wrote:
>> > Hey all.
>> >
>> > Im having a hard time getting FCKEdtitor plugin and the "validate"
>> > plugin to work along, so please, any advice is very welcome. Im using
>> > the fckeditor plugin on all fckeditors, adding the to textareas using
>> > the method described here:http://www.fyneworks.com/jquery/FCKEditor/
>> >
>> > First I was having that problem where when you try to submit the form,
>> > validation returns erros for every required fckeditors
>> > even if it actually has text on it. If you try to submit it again,
>> > then it works. Is the same problem reported here:
>> http://groups.google.com/group/jquery-en/browse_thread/thread/e07ffa6
>> >
>> > So I tried to add 'onclick="$.fck.update()"' on the submit button, and
>> > it works. But only if you got a single FCKEditor instance in the page.
>> > If you have multiple instances, "update" will only work for the first
>> > one. Worst yet: after "update" has been called, the validate plugin
>> > will always return errors for all required fckeditors (except the
>> > first one), no mather if they has text on then, no mather how many
>> > times you try to submit the form, rendering the form impossible to
>> > submit. So, calling "$.fck.update()" actually seens to agravate the
>> > problem, no fix it.
>> >
>> > Ive been doing some debbuging in the fckeditor plugin and I believe I
>> > found where the problem is. In the "content" method, we have this line
>> > "var x = FCKeditorAPI.GetInstance(i);", where the the plugin tries to
>> > retriveve the editor instance. What I found is that
>> > "FCKeditorAPI.GetInstance(i);" will return "undefined" for every
>> > instance except the first.
>> >
>> > I might be wrong here, but taking a look at the "FCKeditorAPI" code I
>> > found that all instances are supposed to be in the
>> > "FCKeditorAPI.Instances" object, so they could be returned by
>> > "FCKeditorAPI.GetInstance()". But if I do a "for in" in this object, I
>> > will really only get the first fckeditor instance, and none of the
>> > rest.
>> >
>> > So that seens to be the problem, but what can I do about it? Im really
>> > clueless here, perhaps Im doing something wrong, I dont know.  Anybody
>> > ever got to make "validate" and "fckeditor" plugins to work with a
>> > form with multiple fckeditor fields? If you did, please give me some
>> > advice.
>> >
>> > In any case, thank you all for the atention.
>>
>
>


-- 
Diogo Barioni Abdalla


[jQuery] Re: Plugin understanding question

2008-08-26 Thread Mike Alsup

> Instead of
>    size()
> He meant:
>    this.size() which is the same as this.length

Indeed!  Thanks for the correction, Ariel.


[jQuery] Re: Plugin understanding question

2008-08-26 Thread Ariel Flesler

> You will see an alert regardless of the selection criteria.  But if
> you do this it will not alert:
>
> jQuery.fn.myPlugin = function() {
>     if (size() > 0)
>         alert ( 'hello world' );
>     return this;
> };

Instead of
   size()
He meant:
   this.size() which is the same as this.length

--
Ariel Flesler
http://flesler.blogspot.com


[jQuery] Re: Understanding event delegation

2008-08-26 Thread Ariel Flesler

Indeed, that's one of them (the worst I think).

jQuery.Listen handles this special case successfully (elements inside
a link, only 1 level).
   http://demos.flesler.com/jquery/listen/

--
Ariel Flesler
http://flesler.blogspot.com

On Aug 26, 6:01 pm, Brian Schilt <[EMAIL PROTECTED]> wrote:
> > so when you have an anchor set as
> > block, with a few spans to style text, it is hard to click on the
> > actual anchor to give it the class.  Is this normal?
>
> That is a normal reaction when using event delegation and its one of
> the "difficulties" that Ariel was probably referring to. You'll need
> to set up your event delegation to account for 1) clicking on the
> actual anchor and 2) clicking on the child span tag.
>
> You'll need to add a condition to your IF statement to account for the
> span tags...When $target is a span, select its parent anchor element.
>
> if ($target.is('.scroll a')) {
>   $("a.selected").removeClass("selected");
>   $(event.target).addClass("selected");}
>
> else if ($target.is('span')) {
>   var $anchor = $target.parent('a');
>   $("a.selected").removeClass("selected");
>   $anchor.addClass("selected");
>
> }
>
> Brian
>
> On Aug 26, 4:22 pm, hubbs <[EMAIL PROTECTED]> wrote:
>
> > Hmmm, I take that back.  It still seems like the is() is able to
> > select child elements of the anchor, so when you have an anchor set as
> > block, with a few spans to style text, it is hard to click on the
> > actual anchor to give it the class.  Is this normal?
>
> > On Aug 26, 11:37 am, hubbs <[EMAIL PROTECTED]> wrote:
>
> > > Thank you, that fixed it.
>
> > > Is the limitation of is() a javascript limitation, or a jQuery
> > > limitation?  Would this be coming in a new version of jQuery?
>
> > > Also, with event delegation, would you recommending using it for all
> > > event instances on a page?  I have a few places where a single click
> > > event is added to an ID, and I figure it is really not necessary to
> > > mess with event delegation there.
>
> > > On Aug 26, 11:31 am, Ariel Flesler <[EMAIL PROTECTED]> wrote:
>
> > > > Note that is() doesn't accept complex selectors (yet). The reason of
> > > > your problems is probably this.
> > > > Event delegation is surely the best approach, if you can live with its
> > > > difficulties.
>
> > > > --
> > > > Ariel Fleslerhttp://flesler.blogspot.com
>
> > > > On Aug 26, 2:31 pm, hubbs <[EMAIL PROTECTED]> wrote:
>
> > > > > I am working to replace all of my uses of livequery with event
> > > > > delegation (is this even a good idea?) and have a few questions.
>
> > > > > I have a simple script that will add a "selected" class to a link when
> > > > > it is clicked.  It does work using event delegation, but it seems that
> > > > > it is not limiting it to anchor tags, but will also add the "selected"
> > > > > class to any spans that are inside my anchor.  This seems strange, and
> > > > > is not what I want, is something wrong with the following code?
>
> > > > >  $('body').click(function(event) {
> > > > >         var $target = $(event.target);
> > > > >         if ($target.is('.scroll a')) {
> > > > >             $("a.selected").removeClass("selected");
> > > > >             $(event.target).addClass("selected");
> > > > >         }
> > > > >     });


[jQuery] Re: Understanding event delegation

2008-08-26 Thread Brian Schilt

> so when you have an anchor set as
> block, with a few spans to style text, it is hard to click on the
> actual anchor to give it the class.  Is this normal?

That is a normal reaction when using event delegation and its one of
the "difficulties" that Ariel was probably referring to. You'll need
to set up your event delegation to account for 1) clicking on the
actual anchor and 2) clicking on the child span tag.

You'll need to add a condition to your IF statement to account for the
span tags...When $target is a span, select its parent anchor element.

if ($target.is('.scroll a')) {
  $("a.selected").removeClass("selected");
  $(event.target).addClass("selected");
}
else if ($target.is('span')) {
  var $anchor = $target.parent('a');
  $("a.selected").removeClass("selected");
  $anchor.addClass("selected");
}

Brian

On Aug 26, 4:22 pm, hubbs <[EMAIL PROTECTED]> wrote:
> Hmmm, I take that back.  It still seems like the is() is able to
> select child elements of the anchor, so when you have an anchor set as
> block, with a few spans to style text, it is hard to click on the
> actual anchor to give it the class.  Is this normal?
>
> On Aug 26, 11:37 am, hubbs <[EMAIL PROTECTED]> wrote:
>
> > Thank you, that fixed it.
>
> > Is the limitation of is() a javascript limitation, or a jQuery
> > limitation?  Would this be coming in a new version of jQuery?
>
> > Also, with event delegation, would you recommending using it for all
> > event instances on a page?  I have a few places where a single click
> > event is added to an ID, and I figure it is really not necessary to
> > mess with event delegation there.
>
> > On Aug 26, 11:31 am, Ariel Flesler <[EMAIL PROTECTED]> wrote:
>
> > > Note that is() doesn't accept complex selectors (yet). The reason of
> > > your problems is probably this.
> > > Event delegation is surely the best approach, if you can live with its
> > > difficulties.
>
> > > --
> > > Ariel Fleslerhttp://flesler.blogspot.com
>
> > > On Aug 26, 2:31 pm, hubbs <[EMAIL PROTECTED]> wrote:
>
> > > > I am working to replace all of my uses of livequery with event
> > > > delegation (is this even a good idea?) and have a few questions.
>
> > > > I have a simple script that will add a "selected" class to a link when
> > > > it is clicked.  It does work using event delegation, but it seems that
> > > > it is not limiting it to anchor tags, but will also add the "selected"
> > > > class to any spans that are inside my anchor.  This seems strange, and
> > > > is not what I want, is something wrong with the following code?
>
> > > >  $('body').click(function(event) {
> > > >         var $target = $(event.target);
> > > >         if ($target.is('.scroll a')) {
> > > >             $("a.selected").removeClass("selected");
> > > >             $(event.target).addClass("selected");
> > > >         }
> > > >     });
>
>


[jQuery] Re: [autocomplete] Auto populate form input field based on another

2008-08-26 Thread Mattl

Thanks Jörn,
Is there a tutorial or demo that shows what the php file that queries
the db should look like, or in what format the results need to be
returned in?

ie what does 'my_autocomplete_backend.php' look like?

I've not been able to find one.

Thanks in advance,
Matt

On Aug 25, 11:32 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> The autocomplete plugin
> (http://plugins.jquery.com/project/autocompletex) can do that. Set the
> one up as usual, and configure the other one with a dynamic extra
> paramter:
>
> $("#second").autocomplete("url", {
>         extraParams: {
>                 first: function() {
>                         return $("#first").val();
>                 }
>         }
>
> });
>
> Jörn
>
> On Mon, Aug 25, 2008 at 11:22 PM, Mattl <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > Anyone know of a jQuery plugin similar to the Autocomplete that could
> > do the following?
>
> > I have a mysql db with two columns, 'Lot No' and 'Description'.
>
> > I have a form with two input fields, 'Lot No' and 'Description' and
> > I'd like the 'Description' input field to be auto-populated from the
> > database based on the entry the user puts into the 'Lot No' input
> > field.
>
> > ie if they typed in '1' into the 'Lot No' field then the 'Description'
> > input field would call up the corresponding row entry to '1' from the
> > database.
>
> > Hope I've explained this clearly enough...
>
> > Many thanks
> > Matt


[jQuery] Re: slide()/show()/hide() does not expand across columns

2008-08-26 Thread J Junos

My first post was lacking a bit of info:

This works fine in IE7 (7.0.5730.13)

it does NOT work in Firefox 3 (3.0.1)


You got it though Bob,

show("slow") refused to work. And actually, continually hiding/showing
the element would create an odd buffer between the two cells.

Removing the "slow" made it work fine. But then, by removing it, I've
removed any distinguishing element from Prototype

Anyone found a work around for this?


Junos

On Aug 26, 1:55 pm, Bob Gregg <[EMAIL PROTECTED]> wrote:
> I've previously implemented table row show/hide in a production app,
> so I went back to check - the main difference between your code and
> mine was that you're using 'slow' in your toggle() statement.  When I
> eliminated that and just used toggle() (or show() / hide() ), your
> jQuery code seems to work fine.  Maybe this is a bug in the
> implementation of display effects for table rows?
>
> On Aug 26, 1:04 pm, J Junos <[EMAIL PROTECTED]> wrote:
>
> > My issue is that I want to allow users to hide and show expanded data.
> > Yet for some reason, when I implement this in jQuery, the expanded
> > rows always seem to stay in a single column, instead of returning back
> > to the full table width. I can get it to work in prototype, but jquery
> > won't.
>
> > Anyone else have problems with show()?
>
> > This is my example:


[jQuery] jQuery 1.2.X's .clean() mangles namespaced elements

2008-08-26 Thread Antonio Collins


The .clean() method tries to replace empty elements defined as  with
.  Here's the code from .clean():

   // Convert html string into DOM nodes
   if ( typeof elem == "string" ) {
  // Fix "XHTML"-style tags in all browsers
  elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
 return
tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
all :
front + ">";
  });

If the element is namespaced like this:
   
the manufactured closing tag is incorrect and will cause some DOM injection
methods to fail:
   

Changing the regular expression's (\w+) to ([A-Za-z0-9_:]+) fixes the
problem.   
-- 
View this message in context: 
http://www.nabble.com/jQuery-1.2.X%27s-.clean%28%29-mangles-namespaced-elements-tp19169103s27240p19169103.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Multiple FCKEditor instances & validate plugin problem

2008-08-26 Thread David Di Biase
It would be so great if someone had an answer for this. I was struggling
with the issue this last week!

Thanks,

-
David D.


On Tue, Aug 26, 2008 at 12:59 PM, Diogo <[EMAIL PROTECTED]> wrote:

>
> Nobody?
>
> On Aug 25, 10:55 pm, Diogo <[EMAIL PROTECTED]> wrote:
> > Hey all.
> >
> > Im having a hard time getting FCKEdtitor plugin and the "validate"
> > plugin to work along, so please, any advice is very welcome. Im using
> > the fckeditor plugin on all fckeditors, adding the to textareas using
> > the method described here:http://www.fyneworks.com/jquery/FCKEditor/
> >
> > First I was having that problem where when you try to submit the form,
> > validation returns erros for every required fckeditors
> > even if it actually has text on it. If you try to submit it again,
> > then it works. Is the same problem reported here:
> http://groups.google.com/group/jquery-en/browse_thread/thread/e07ffa6
> >
> > So I tried to add 'onclick="$.fck.update()"' on the submit button, and
> > it works. But only if you got a single FCKEditor instance in the page.
> > If you have multiple instances, "update" will only work for the first
> > one. Worst yet: after "update" has been called, the validate plugin
> > will always return errors for all required fckeditors (except the
> > first one), no mather if they has text on then, no mather how many
> > times you try to submit the form, rendering the form impossible to
> > submit. So, calling "$.fck.update()" actually seens to agravate the
> > problem, no fix it.
> >
> > Ive been doing some debbuging in the fckeditor plugin and I believe I
> > found where the problem is. In the "content" method, we have this line
> > "var x = FCKeditorAPI.GetInstance(i);", where the the plugin tries to
> > retriveve the editor instance. What I found is that
> > "FCKeditorAPI.GetInstance(i);" will return "undefined" for every
> > instance except the first.
> >
> > I might be wrong here, but taking a look at the "FCKeditorAPI" code I
> > found that all instances are supposed to be in the
> > "FCKeditorAPI.Instances" object, so they could be returned by
> > "FCKeditorAPI.GetInstance()". But if I do a "for in" in this object, I
> > will really only get the first fckeditor instance, and none of the
> > rest.
> >
> > So that seens to be the problem, but what can I do about it? Im really
> > clueless here, perhaps Im doing something wrong, I dont know.  Anybody
> > ever got to make "validate" and "fckeditor" plugins to work with a
> > form with multiple fckeditor fields? If you did, please give me some
> > advice.
> >
> > In any case, thank you all for the atention.
>


[jQuery] Re: Understanding event delegation

2008-08-26 Thread hubbs

Hmmm, I take that back.  It still seems like the is() is able to
select child elements of the anchor, so when you have an anchor set as
block, with a few spans to style text, it is hard to click on the
actual anchor to give it the class.  Is this normal?

On Aug 26, 11:37 am, hubbs <[EMAIL PROTECTED]> wrote:
> Thank you, that fixed it.
>
> Is the limitation of is() a javascript limitation, or a jQuery
> limitation?  Would this be coming in a new version of jQuery?
>
> Also, with event delegation, would you recommending using it for all
> event instances on a page?  I have a few places where a single click
> event is added to an ID, and I figure it is really not necessary to
> mess with event delegation there.
>
> On Aug 26, 11:31 am, Ariel Flesler <[EMAIL PROTECTED]> wrote:
>
> > Note that is() doesn't accept complex selectors (yet). The reason of
> > your problems is probably this.
> > Event delegation is surely the best approach, if you can live with its
> > difficulties.
>
> > --
> > Ariel Fleslerhttp://flesler.blogspot.com
>
> > On Aug 26, 2:31 pm, hubbs <[EMAIL PROTECTED]> wrote:
>
> > > I am working to replace all of my uses of livequery with event
> > > delegation (is this even a good idea?) and have a few questions.
>
> > > I have a simple script that will add a "selected" class to a link when
> > > it is clicked.  It does work using event delegation, but it seems that
> > > it is not limiting it to anchor tags, but will also add the "selected"
> > > class to any spans that are inside my anchor.  This seems strange, and
> > > is not what I want, is something wrong with the following code?
>
> > >  $('body').click(function(event) {
> > >         var $target = $(event.target);
> > >         if ($target.is('.scroll a')) {
> > >             $("a.selected").removeClass("selected");
> > >             $(event.target).addClass("selected");
> > >         }
> > >     });


[jQuery] Re: ui.dialog & Accessibility (Screen Readers)

2008-08-26 Thread Richard D. Worth
Please post this to the following lists:

http://groups.google.com/group/jquery-ui

http://groups.google.com/group/jquery-a11y

Thanks.

- Richard

On Tue, Aug 26, 2008 at 1:20 PM, Shao Kang Tat <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> I have a webpage that has multiple dialogs.  Since our goal is to make
> the pages as Accessible as possible (we support the screen reader JAWS
> 9), each time a dialog comes up, we must place focus on something
> inside the dialog so that the screen reader knows where to continue
> reading from.
>
> So far, my intermediate function that opens the dialog works in
> FireFox to target, say a password field so that the user can start
> typing right away without having to click into the password box.  Also
> if the user clicks on the overlay (screen blocker), then focus should
> be brought back into the focus object specified:
>
> try{ this.focus = $(params.$focus)[0]; }  // get the object that
> should get focus when dialog loads
> catch(e){ // if none specified, then get the anchor in the title tag
>  this.focus = $("." + $
> (this.modalContent).data("dialog").uiDialogTitlebar[0].className + "
> a")[0];
> }
> this.focus.focus();  // place focus on the focus object
> $(".ui-dialog-overlay")[0].onclick=function()
> { openOrders.focus.focus(); }  // if user clicks on the overlay, put
> focus back into the focus object
>
> The first few lines work for IE and FF but the last line doesn't work
> for IE.  Seems like I can only override a .onmouseover event for the
> overlay in IE.  onmousedown and onclick events don't seem to register.
>
> The 2nd problem:  If there is no $focus argument passed in, then I
> want to default the title in the title bar to be the object to focus
> on.
>
> I know the line of code in the catch phrase isn't the best way to get
> to the object, but it gets it properly.
> When I alert the innerHTML or className of the focus object I get
> what's expected, however, the call "this.focus.focus()" doesn't
> actually place focus on the anchor tag in the titlebar even though I
> have the correct object...Anyone else encounter this before?
>
> Thanks,
> Shao
>


[jQuery] Re: Plugin understanding question

2008-08-26 Thread Mike Alsup

> I've come to a situation of making one .js file for many pages.
>
> So, some pages have certain divs and some don't.
>
> My situation is that whenever a plugin was defined for a certain div
> in a certain page,
>
> I seem to see it being invoked even on pages that don't have that div.
>
> For example if page.html has a div called :  class="a">
>
> In a .js file I call: $('#page .a').plugin(); (let's say it does
> alert('hi'); )
>
> But on page2.html, I would see that plugin get invoked anyways, and a
> message box would say 'hi'.
> page2.html doesn't have . It only has 
>
> This causes a problem because I have to constantly manually check if
> all components needed for a plugin
> are there on the page, which I think the selector - plugin call line
> should automatically handle.
>
> Can anyone help me, or has anyone had the same situation?
>
> Thanks,
> Seungjin Kim


The plugin function is still invoked, it just has no DOM elements on
which to operate.  So if you have a plugin like this:

jQuery.fn.myPlugin = function() {
alert ( 'hello world' );
return this;
};

You will see an alert regardless of the selection criteria.  But if
you do this it will not alert:

jQuery.fn.myPlugin = function() {
if (size() > 0)
alert ( 'hello world' );
return this;
};

"Typical" plugins, though certainly not all, operate on DOM elements
and use iteration to mask this caveat:

jQuery.fn.myPlugin = function() {
return this.each(function() {
// operate on DOM element here
});
};

Hope this helps.

Mike


[jQuery] Re: slide()/show()/hide() does not expand across columns

2008-08-26 Thread Bob Gregg

I've previously implemented table row show/hide in a production app,
so I went back to check - the main difference between your code and
mine was that you're using 'slow' in your toggle() statement.  When I
eliminated that and just used toggle() (or show() / hide() ), your
jQuery code seems to work fine.  Maybe this is a bug in the
implementation of display effects for table rows?

On Aug 26, 1:04 pm, J Junos <[EMAIL PROTECTED]> wrote:
> My issue is that I want to allow users to hide and show expanded data.
> Yet for some reason, when I implement this in jQuery, the expanded
> rows always seem to stay in a single column, instead of returning back
> to the full table width. I can get it to work in prototype, but jquery
> won't.
>
> Anyone else have problems with show()?
>
> This is my example:
>


[jQuery] Re:

2008-08-26 Thread [EMAIL PROTECTED]

I tried that and didnt work. Also, what you said put me down, heh.
Thanks for the help! I will try to do some server side script then.


On Aug 26, 11:53 am, Mike Alsup <[EMAIL PROTECTED]> wrote:
> > I want to make a script to search in a page for script src='http://*
> > elements on a page for a site full of malicious scripts (added through
> > a bug in the input form of the news system of a restricted area...),
> > so I can make the script remove them on a page load (yeah, why not fix
> > the security hole? because the guy don't want to -_-, well whatever).
> > Anyway, how do I do that? I thought I could do that by using a $
> > ("script:contains('http://*').remove or something, but I am very naive
> > and didn't work. =P
>
> > Anyone has any ideas how could I do that? To search for that script
> > element and remove it? Thank you very much.
>
> You can remove the tags like this:
>
> $('script[src^=http://]').remove();
>
> but removing them from the DOM will not remove the JavaScript code
> that has already been evaluated.


[jQuery] remove xml nodes

2008-08-26 Thread jjh

I have this issue in IE7 where I do an ajax call that returns a XML
dataset. I would like to remove certain XML nodes before displaying it
into the page. The remove() function works in Firefox but now in IE7.

Example:
$("award[id='3']",xmldata).remove(); //works in FF but not IE

Can someone help me with this?


[jQuery] Plugin understanding question

2008-08-26 Thread Seungjin

Hi,

I've come to a situation of making one .js file for many pages.

So, some pages have certain divs and some don't.

My situation is that whenever a plugin was defined for a certain div
in a certain page,

I seem to see it being invoked even on pages that don't have that div.

For example if page.html has a div called : 

In a .js file I call: $('#page .a').plugin(); (let's say it does
alert('hi'); )

But on page2.html, I would see that plugin get invoked anyways, and a
message box would say 'hi'.
page2.html doesn't have . It only has 

This causes a problem because I have to constantly manually check if
all components needed for a plugin
are there on the page, which I think the selector - plugin call line
should automatically handle.

Can anyone help me, or has anyone had the same situation?

Thanks,
Seungjin Kim


[jQuery] Re: slide()/show()/hide() does not expand across columns

2008-08-26 Thread Bob Gregg

I've implemented show/hide of table rows in a production app, so I
checked my own code; the primary difference is that you're using
'slow', and I wasn't.  When I copied your code and removed the 'slow'
parameter, it worked just fine.  Maybe this is a bug in the
implementation of fade effects specifically on table rows?  I noticed
that it actually seems to move the DOM elements into a single table
cell width prior to the initial fade out; no idea why, though.

Bob

On Aug 26, 1:04 pm, J Junos <[EMAIL PROTECTED]> wrote:
> My issue is that I want to allow users to hide and show expanded data.
> Yet for some reason, when I implement this in jQuery, the expanded
> rows always seem to stay in a single column, instead of returning back
> to the full table width. I can get it to work in prototype, but jquery
> won't.
>
> Anyone else have problems with show()?
>
> This is my example:
>
> [code]
>
>                 
>                 jQuery.noConflict();
>
>                 function jqueryclick( node ) {
>                         var sibling = jQuery( node ).next('tr');
>                         sibling.toggle('slow');
>
>                         // $( node ).next('.expanded').toggle();
>                 }
>
>                 function prototypeclick( node ) {
>                         $( node ).next('.expanded').toggle();
>                 }
>                 
>
> 
> 
>
> 
>
>         
>                 
>                         TEST1
>                         Test 2
>                         Test 3 3
>                 
>         
>
>         
>
>         
>                 hey jude!
>                 I want
>                 some
>         
>         
>                 big
>                 top
>                 ice cream
>         
>
>         
>                 1+1=
>                 2+2=
>                 3+3=
>         
>         
>                 2
>                 4
>                 6
>         
>
>                 
>         
>
> 
> 
>
> [/code]


[jQuery] Re: detemine css properties?

2008-08-26 Thread J Junos

I believe you can simply do a

if( $(".information").css("background-color") == "#fff" ) {
  // your code
} else {
  // the rest of your code
}

http://docs.jquery.com/CSS/css#name


This is probably a better way of checking for equality among css
though

Junos

On Aug 26, 1:18 pm, weegekid <[EMAIL PROTECTED]> wrote:
> Hi,
>
> How (if it's possible) would I determine a specific css property for
> an element?
>
> For example, I have the following code on my page:
>
> 
> .information {display:block; background-color: #FFF}
> 
>
> ipsum lorem
>
> ---
>
> I'd then like to use jquery to determine the background-color of the
> element.  So that when a button or something is clicked:
>
> if the background-color of .information is #FFF, then do X, but if the
> background-color is #CCC, then do Y.
>
> Thanks for any help you can offer!


[jQuery] Jquery gaming....

2008-08-26 Thread Aaron

Hi I am currently working on a website getting close to finishing it
so I wanted to try and get ready for my other project after the
website is done and ready.

I plan on making a online game.

Is their any good place where I can learn how to use jquery for 2d
adventure type games??



[jQuery] Password and Equalto

2008-08-26 Thread koolkat

I have two input boxes: password and password confirmation.
The password confirmation has the following validation code:
equalTo: "Please enter the same password as above"

This works fine as long as the user enters the password first.
However, if the reverse happens and the user enters the confirm first,
the error message does not disappear when the user correctly completes
the password field. I noticed the same thing in the demo on the jquery
example for this feature so I am wondering if there is any work around?


[jQuery] Re: possible bug in each()? moving from 1.2.3 to 1.2.6

2008-08-26 Thread Ariel Flesler

You can either update Prototype/Scriptaculous to 1.8.x or try the
latest jQuery revision on the trunk. That should be 'patched'.

--
Ariel Flesler
http://flesler.blogspot.com

On Aug 25, 1:59 pm, mausch <[EMAIL PROTECTED]> wrote:
> Nevermind, it was executing prototype's each() (I was also including
> prototype on the same page) instead of jQuery's.
> Why this changed from 1.2.4 to 1.2.6 (everything else being equal)
> remains a mystery to me.
>
> On Aug 25, 1:12 pm, mausch <[EMAIL PROTECTED]> wrote:
>
> > I'm having the same problem here. If I execute the following in a
> > firebug console in one of our pages:
>
> > jQuery('input').each(function() {console.log(this)})
>
> > With 1.2.4 I get the individual elements:
>
> > 
> >  > size="10" name="currentSearch">
> > 
> > 
> > ...
>
> > With 1.2.6 I get one array containing all matching elements:
>
> > [input, input#InputSearch, input#btnSearch, input,
> > input#impressionsToAdd, input#checkAllHigh on, input#checkAllBold on,
> > input#checkAllFeatured on, input#checkAllSponsored on,
> > input#save1.save, input#chkHigh_1.chkStyle 1, input#chkBold_1.chkStyle
> > 1, input#chkFeatured_1.chkStyle 1, input#chkSponsored_1.chkStyle 1,
> > input#chkHigh_2.chkStyle 2, input#chkBold_2.chkStyle 2,
> > input#chkFeatured_2.chkStyle 2, input#chkSponsored_2.chkStyle 2,
> > input#chkHigh_3.chkStyle 3, input#chkBold_3.chkStyle 3,
> > input#chkFeatured_3.chkStyle 3, ...]
>
> > Any ideas? Can anyone confirm that this is a bug or a new behavior?


[jQuery] Re: Something equivalent to Prototype's Class.create() ??

2008-08-26 Thread Ariel Flesler

As an alternative (unconventional) possibility, there's jQuery
Collection:
   http://flesler.blogspot.com/2008/01/jquerycollection.html

--
Ariel Flesler
http://flesler.blogspot.com

On Aug 25, 4:17 pm, Shao Kang Tat <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I've googled this topic...
> I found one page that was an April Fool's joke but I'm not entirely
> sure if it's legit or not?http://ejohn.org/blog/classy-query/
>
> Then there's Low Pro 
> at:http://www.danwebb.net/2008/2/3/how-to-use-low-pro-for-jquery
>
> So is there a final version that's included in jQuery or does it have
> to be included separately (i.e. one of the two above - or is there an
> even better version out there?)
>
> Thanks,
> Shao


[jQuery] Re: full blown news ticker

2008-08-26 Thread Ariel Flesler

The plugin SerialScroll can be used for news tickers like the one you
show. It has prev, next, navigation 'at random' and auto sliding.
Note that the animation is done via scrolling.

http://demos.flesler.com/jquery/serialScroll/

--
Ariel Flesler
http://flesler.blogspot.com

On Aug 26, 4:32 am, Almir Karic <[EMAIL PROTECTED]> wrote:
> i'm looking for a full blown news ticker, features i'd like to have:
> - automatic scolling
> - navigation
> - jquery
>
> the ticker onhttp://avalanche.nhl.com/seems to do what i'd like it
> to, the problems are that i probably can't just take theirs, second
> problem being it is not jquery :-)
>
> any recommendations?


[jQuery] Re: Understanding event delegation

2008-08-26 Thread hubbs

Thank you, that fixed it.

Is the limitation of is() a javascript limitation, or a jQuery
limitation?  Would this be coming in a new version of jQuery?

Also, with event delegation, would you recommending using it for all
event instances on a page?  I have a few places where a single click
event is added to an ID, and I figure it is really not necessary to
mess with event delegation there.

On Aug 26, 11:31 am, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> Note that is() doesn't accept complex selectors (yet). The reason of
> your problems is probably this.
> Event delegation is surely the best approach, if you can live with its
> difficulties.
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com
>
> On Aug 26, 2:31 pm, hubbs <[EMAIL PROTECTED]> wrote:
>
> > I am working to replace all of my uses of livequery with event
> > delegation (is this even a good idea?) and have a few questions.
>
> > I have a simple script that will add a "selected" class to a link when
> > it is clicked.  It does work using event delegation, but it seems that
> > it is not limiting it to anchor tags, but will also add the "selected"
> > class to any spans that are inside my anchor.  This seems strange, and
> > is not what I want, is something wrong with the following code?
>
> >  $('body').click(function(event) {
> >         var $target = $(event.target);
> >         if ($target.is('.scroll a')) {
> >             $("a.selected").removeClass("selected");
> >             $(event.target).addClass("selected");
> >         }
> >     });


[jQuery] Re: it doesn't work with HTML loaded dynamically

2008-08-26 Thread Ariel Flesler

http://docs.jquery.com/FAQ#Why_do_my_events_stop_working_after_an_AJAX_request.3F

--
Ariel Flesler
http://flesler.blogspot.com

On Aug 26, 12:43 pm, Will <[EMAIL PROTECTED]> wrote:
> Ok Diego, I found a plugin wich works perfectly :
> "jquery live_bind"
>
> an example of use :
>
> $.live_bind("a.popup_link", 'click',
>         function(){
>             $("#"+popup+"_popup").css("margin-left","-"+
> (width.substr(0,width.length - 2) / 2)+"px");
>             $("#"+popup+"_popup").fadeIn("slow");
>         }
>     );
>
> ... perfect ! : )


[jQuery] Re: jQuery 1.2.X's .clean() mangles namespaced elements

2008-08-26 Thread Ariel Flesler

I haven't looked in detail, but it seems like a valid bug.
Can you create and ticket on the tracker ? http://dev.jquery.com/newticket

Thanks
--
Ariel Flesler
http://flesler.blogspot.com

On Aug 26, 11:23 am, Antonio Collins <[EMAIL PROTECTED]>
wrote:
> The .clean() method tries to replace empty elements defined as  with
> .  Here's the code from .clean():
>
>    // Convert html string into DOM nodes
>    if ( typeof elem == "string" ) {
>       // Fix "XHTML"-style tags in all browsers
>       elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
>          return
> tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
>             all :
>             front + ">";
>       });
>
> If the element is namespaced like this:
>    
> the manufactured closing tag is incorrect:
>    
>
> Changing the regular expression's (\w+) to ([A-Za-z0-9_:]+) fixes the
> problem.  
>
> --
> View this message in 
> context:http://www.nabble.com/jQuery-1.2.X%27s-.clean%28%29-mangles-namespace...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Understanding event delegation

2008-08-26 Thread Ariel Flesler

Note that is() doesn't accept complex selectors (yet). The reason of
your problems is probably this.
Event delegation is surely the best approach, if you can live with its
difficulties.

--
Ariel Flesler
http://flesler.blogspot.com

On Aug 26, 2:31 pm, hubbs <[EMAIL PROTECTED]> wrote:
> I am working to replace all of my uses of livequery with event
> delegation (is this even a good idea?) and have a few questions.
>
> I have a simple script that will add a "selected" class to a link when
> it is clicked.  It does work using event delegation, but it seems that
> it is not limiting it to anchor tags, but will also add the "selected"
> class to any spans that are inside my anchor.  This seems strange, and
> is not what I want, is something wrong with the following code?
>
>  $('body').click(function(event) {
>         var $target = $(event.target);
>         if ($target.is('.scroll a')) {
>             $("a.selected").removeClass("selected");
>             $(event.target).addClass("selected");
>         }
>     });


[jQuery] detemine css properties?

2008-08-26 Thread weegekid

Hi,

How (if it's possible) would I determine a specific css property for
an element?

For example, I have the following code on my page:


.information {display:block; background-color: #FFF}


ipsum lorem

---

I'd then like to use jquery to determine the background-color of the
element.  So that when a button or something is clicked:

if the background-color of .information is #FFF, then do X, but if the
background-color is #CCC, then do Y.


Thanks for any help you can offer!


[jQuery] slide()/show()/hide() does not expand across columns

2008-08-26 Thread J Junos

My issue is that I want to allow users to hide and show expanded data.
Yet for some reason, when I implement this in jQuery, the expanded
rows always seem to stay in a single column, instead of returning back
to the full table width. I can get it to work in prototype, but jquery
won't.

Anyone else have problems with show()?

This is my example:

[code]


jQuery.noConflict();

function jqueryclick( node ) {
var sibling = jQuery( node ).next('tr');
sibling.toggle('slow');


// $( node ).next('.expanded').toggle();
}

function prototypeclick( node ) {
$( node ).next('.expanded').toggle();
}









TEST1
Test 2
Test 3 3






hey jude!
I want
some


big
top
ice cream



1+1=
2+2=
3+3=


2
4
6










[/code]


[jQuery] Re: Multiple FCKEditor instances & validate plugin problem

2008-08-26 Thread Diogo

Nobody?

On Aug 25, 10:55 pm, Diogo <[EMAIL PROTECTED]> wrote:
> Hey all.
>
> Im having a hard time getting FCKEdtitor plugin and the "validate"
> plugin to work along, so please, any advice is very welcome. Im using
> the fckeditor plugin on all fckeditors, adding the to textareas using
> the method described here:http://www.fyneworks.com/jquery/FCKEditor/
>
> First I was having that problem where when you try to submit the form,
> validation returns erros for every required fckeditors
> even if it actually has text on it. If you try to submit it again,
> then it works. Is the same problem reported 
> here:http://groups.google.com/group/jquery-en/browse_thread/thread/e07ffa6
>
> So I tried to add 'onclick="$.fck.update()"' on the submit button, and
> it works. But only if you got a single FCKEditor instance in the page.
> If you have multiple instances, "update" will only work for the first
> one. Worst yet: after "update" has been called, the validate plugin
> will always return errors for all required fckeditors (except the
> first one), no mather if they has text on then, no mather how many
> times you try to submit the form, rendering the form impossible to
> submit. So, calling "$.fck.update()" actually seens to agravate the
> problem, no fix it.
>
> Ive been doing some debbuging in the fckeditor plugin and I believe I
> found where the problem is. In the "content" method, we have this line
> "var x = FCKeditorAPI.GetInstance(i);", where the the plugin tries to
> retriveve the editor instance. What I found is that
> "FCKeditorAPI.GetInstance(i);" will return "undefined" for every
> instance except the first.
>
> I might be wrong here, but taking a look at the "FCKeditorAPI" code I
> found that all instances are supposed to be in the
> "FCKeditorAPI.Instances" object, so they could be returned by
> "FCKeditorAPI.GetInstance()". But if I do a "for in" in this object, I
> will really only get the first fckeditor instance, and none of the
> rest.
>
> So that seens to be the problem, but what can I do about it? Im really
> clueless here, perhaps Im doing something wrong, I dont know.  Anybody
> ever got to make "validate" and "fckeditor" plugins to work with a
> form with multiple fckeditor fields? If you did, please give me some
> advice.
>
> In any case, thank you all for the atention.


[jQuery] Understanding event delegation

2008-08-26 Thread hubbs

I am working to replace all of my uses of livequery with event
delegation (is this even a good idea?) and have a few questions.

I have a simple script that will add a "selected" class to a link when
it is clicked.  It does work using event delegation, but it seems that
it is not limiting it to anchor tags, but will also add the "selected"
class to any spans that are inside my anchor.  This seems strange, and
is not what I want, is something wrong with the following code?

 $('body').click(function(event) {
var $target = $(event.target);
if ($target.is('.scroll a')) {
$("a.selected").removeClass("selected");
$(event.target).addClass("selected");
}
});


[jQuery] ui.dialog & Accessibility (Screen Readers)

2008-08-26 Thread Shao Kang Tat

Hello,

I have a webpage that has multiple dialogs.  Since our goal is to make
the pages as Accessible as possible (we support the screen reader JAWS
9), each time a dialog comes up, we must place focus on something
inside the dialog so that the screen reader knows where to continue
reading from.

So far, my intermediate function that opens the dialog works in
FireFox to target, say a password field so that the user can start
typing right away without having to click into the password box.  Also
if the user clicks on the overlay (screen blocker), then focus should
be brought back into the focus object specified:

try{ this.focus = $(params.$focus)[0]; }  // get the object that
should get focus when dialog loads
catch(e){ // if none specified, then get the anchor in the title tag
  this.focus = $("." + $
(this.modalContent).data("dialog").uiDialogTitlebar[0].className + "
a")[0];
}
this.focus.focus();  // place focus on the focus object
$(".ui-dialog-overlay")[0].onclick=function()
{ openOrders.focus.focus(); }  // if user clicks on the overlay, put
focus back into the focus object

The first few lines work for IE and FF but the last line doesn't work
for IE.  Seems like I can only override a .onmouseover event for the
overlay in IE.  onmousedown and onclick events don't seem to register.

The 2nd problem:  If there is no $focus argument passed in, then I
want to default the title in the title bar to be the object to focus
on.

I know the line of code in the catch phrase isn't the best way to get
to the object, but it gets it properly.
When I alert the innerHTML or className of the focus object I get
what's expected, however, the call "this.focus.focus()" doesn't
actually place focus on the anchor tag in the titlebar even though I
have the correct object...Anyone else encounter this before?

Thanks,
Shao


[jQuery] Re: Accordion open when opening a new page

2008-08-26 Thread GasGiant

I would like to do the same and have tried a few things, but it would
be most helpful if Accordion would read a variable passed in the URL,
such as ?accordionIndex=2. It already will read cookies to do this, so
adding the reading of a GET should be pretty easy.  Okay, so I haven't
figured it out yet, but that doesn't signify ;-)


[jQuery] Re: Using instead of with Superfish

2008-08-26 Thread Joe

Just a note for anyone who tries to do the same thing as me:

Be sure that the  you use doesn't interfere with the  that
superfish puts in to hold the arrows.  otherwise, everything will go
all screwy and you'll be able to see both arrows.

Alternately, if you remove the spans and use text like me, then
be sure to remove the css styling the  that you removed.


On Aug 26, 8:22 am, Joe <[EMAIL PROTECTED]> wrote:
> Thanks Joel,
>
> Putting in blank anchors worked perfectly.
>
> thanks
>
> -Joe
>
> On Aug 25, 10:51 pm, "Joel Birch" <[EMAIL PROTECTED]> wrote:
>
> > Hi Joe,
>
> > Be aware that by using spans instead of anchors you will be breaking
> > keyboard access to the submenus. Maybe using an anchor without a href
> > attribute would be a better option? If you still want to use spans
> > then you could probably change this line:
>
> >  if (o.autoArrows) addArrow( $('>a:first-child',this) );
>
> > to this:
>
> >  if (o.autoArrows) addArrow( $('>:first-child',this) );
>
> > I just removed the 'a' from before ':first-child'.
>
> > Good luck.
> > Joel Birch.


[jQuery] Re: How do I find out what the type of the HTML object?

2008-08-26 Thread Mike Alsup

> $(document).click(function(e){
>    var target = $(e.target);
>
> })
>
> How do I find out what HTML object (A, SPAN, DIV...) the target var
> is?

var tag = e.target.tagName;

:-)


[jQuery] How do I find out what the type of the HTML object?

2008-08-26 Thread temega

So I got this code:

$(document).click(function(e){
   var target = $(e.target);

})

How do I find out what HTML object (A, SPAN, DIV...) the target var
is?

Thanks.


[jQuery] Re: AutoComplete -bassistance

2008-08-26 Thread kreiss

Jorn,
Thanks for sticking w/ me...I almost have it!

However below is the url i'm sending but the "q" value is not being
recognized in my servlet...I'm I sending it over correctly?

//JAVASCRIPT
$(function()
{
 $("#name").autocomplete("employeedirectory?command=ajax&q=" +
document.forms[0].empName.value
  + "&limit=10");
});

//IN THE HTML
Name:

//TRYING TO RECOGNIZE "Q" VALUE IN SERVLET
String dataInput = req.getParameter("q").toUpperCase();

Thanks so much!!

Jörn Zaefferer wrote:
> Look:
>
> $(function() {
>   $("#name").autocomplete("someurl");
> });
>
> That does nothing but bind a few event handlers. It doesn't create DOM
> elements, nor does it load any records.
>
> As soon as the user starts typing, the keyup-event-handler loads some
> data via ajax - how many rows are returned is up to your serverside.
> It then creates the necessary DOM elements to show the result list and
> adds event handlers to that (for keyboard navigation etc.).
>
> I hope that gives you a better idea how it works.
>
> Jörn
>
> On Mon, Aug 25, 2008 at 8:22 PM, kreiss <[EMAIL PROTECTED]> wrote:
> >
> > First of all...thanks for the help!
> > I have about 4500 records in the database  (its an employee
> > database)...if I understand correctly...on the document ready should I
> > bring in all 4500 records?  Would the autocomplete be slow to respond
> > due to all the records
> >
> > The reason I was doing an onKeyUp is so I could limit the number of
> > records that the servlet brought back, keeping the array in javascript
> > smaller..
> >
> > My question is am I supposed to bring back ALL records on the document
> > ready?
> >
> > Thanks so much.
> >
> >
> >
> >
> >
> >
> > Jörn Zaefferer wrote:
> >> You're binding the autocomplete on keyup, which binds another keyup
> >> event - every time. Remove your inline event handler and initialize
> >> the autocomplete just once on document ready.
> >>
> >> Jörn
> >>
> >> On Mon, Aug 25, 2008 at 4:52 PM, kreiss <[EMAIL PROTECTED]> wrote:
> >> >
> >> > Following the documentation, it seems I'm doing it correctly...I'm
> >> > getting data back from my database, but I just have to click out of
> >> > the textbox first before I see the data, other than that it works
> >> > great.
> >> >
> >> > Jörn Zaefferer wrote:
> >> >> Please take a look at the examples here:
> >> >> http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/
> >> >>
> >> >> The "remote" examples are based on PHP, but still show the essential
> >> >> stuff. You've got it all mixed up.
> >> >>
> >> >> Jörn
> >> >>
> >> >> On Fri, Aug 22, 2008 at 9:57 PM, kreiss <[EMAIL PROTECTED]> wrote:
> >> >> >
> >> >> > I'm close to getting the autocomplete to finally work...but.
> >> >> >
> >> >> > First of all, I'm using Java / .jsp to query a database for results
> >> >> >
> >> >> > I'm sending the url to my servlet, my servlet passes the data back to
> >> >> > the .jsp pageNothing appears in my dropdown UNLESS I use my mouse,
> >> >> > click outside of the textbox and then click back into it.  Then the
> >> >> > autocomplete works great and displays the data from the database
> >> >> >
> >> >> > I've tried IE, Opera, Firefox and everyone of them requires me to
> >> >> > start typing in the text box, click out, click back in then the
> >> >> > autocomplete displays.
> >> >> >
> >> >> > Is this a bug or am I'm doing something wrong.
> >> >> >
> >> >> > I've read something in this form about a guy wanting to know if there
> >> >> > was a "reinitialize" function that could be called in the javascript
> >> >> > once the data was brought back from the servlet...I didn't see a
> >> >> > solutions, but think maybe this is what I need.
> >> >> >
> >> >> > Here is sample code:
> >> >> >
> >> >> > //JavaScript Code
> >> >> > function getNames()
> >> >> > {
> >> >> >  $("#name").autocomplete("employeedirectory?command=ajax&q=" +
> >> >> > document.forms[0].test.value + "&limit=10");
> >> >> > }
> >> >> >
> >> >> > //HTML
> >> >> > Name:
> >> >> > 

[jQuery] jquery and ThickBox question

2008-08-26 Thread Spinn

I'm working on a free project, and having an issue.  
http://208.101.28.218/?page_id=3
- the Monday link SHOULD be popping up in a 300x300 ThickBox, but it's
just popping up in the same page.  I've loaded jquery, Lightbox and
the CSS, so I'm stumped.

Any ideas?


[jQuery] Re: it doesn't work with HTML loaded dynamically

2008-08-26 Thread Will

Ok Diego, I found a plugin wich works perfectly :
"jquery live_bind"

an example of use :

$.live_bind("a.popup_link", 'click',
function(){
$("#"+popup+"_popup").css("margin-left","-"+
(width.substr(0,width.length - 2) / 2)+"px");
$("#"+popup+"_popup").fadeIn("slow");
}
);

... perfect ! : )


[jQuery] slideToggle not working correclty in i.e.

2008-08-26 Thread [EMAIL PROTECTED]

Hi guys,
I'm very confused because i had a solution working properly on both
browsers ( firefox3. i.e.6/7).
But suddenly its not working anylonger and i dont see why.

I have some widgets in my page which can be toggled..

this is the html code for one of these widgets



Search




content .
here you can 
search for available VM's





the corresponding jquery

$(document).ready(function(){


var imgDir = '/images/';

options = ''
+ ''




$('.moduleHead').append(options);


$('.moduleHead').hover(function(){
var moduleOptions = $(this).children('.moduleOptions');

$(moduleOptions).show();

$(this).addClass('over');

},function(){

$(this).removeClass('over');

$('#moduleBar * .moduleOptions').hide();

});



$('.toggleImage').click(function(){
$(this).parents('.moduleHead').next('div').slideToggle('fast');
if($(this).attr('src') == imgDir + 
'minus.gif') {
$(this).attr('src', imgDir + 'plus.gif')
  } else {
$(this).attr('src', imgDir + 
'minus.gif')
  }
});



Now the problem is that the image is not toggled on the first time.
And its flashing one time before the widget collapses. In Firefox the
minus image is swaped immediately on the click function how it is
desired and no flashing of the div before it disappears.
The problem occurs only in i.e.
I really hope that i described the problem coherent.

I appreciate your help.
thanks in advance...
kind regards


[jQuery] Re: it doesn't work with HTML loaded dynamically

2008-08-26 Thread Paul Mills

Hi,
I think you need to put the code for the second alert into the
callback function of the load().

So event.js should look something like this:

$(document).ready(function() {
// to load the content.html
$("a#b1").click( function() {
$("#c").load("content.html",function(){
// action on the loaded part
$("a#d").click( function() {
alert("test2");
});
});
alert("test");
} );
} );

Rgds Paul


On Aug 26, 2:53�pm, Will <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I prefer prevent you that I'm french. I post on this group cause
> french groups cannot answer to this problem :
>
> When I add dynamically HTML code in a page, Jquery doesn't take charge
> of it.
>
> I hope that this example will be more understandable :
>
> 3 files : index.html, event.js, content.html
> 
> index.html :
> 
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml"; xml:lang="fr" lang="fr">
> 
> � � � � Test
> � � � � 
> 
> � � � � 
> 
> 
> � � � � 
> � � � � � � � � Test1
> � � � � 
> � � � � 
> 
> 
> 
> event.js :
> 
> $(document).ready(function() {
> � � � � // to load the content.html
> � � � � $("a#b1").click( function() {
> � � � � � � � � � � $("#c").load("content.html");
> � � � � � � � � � � alert("test");
> � � � � } );
> � � � � // action on the loaded part
> � � � � $("a#d").click( function() {
> � � � � � � � � � � alert("test2");
> � � � � } );
>
> } );
>
> 
> content.html
> 
> Test2
> 
>
> as you'll notice it, content.html is added, but document.ready doesn't
> seem to see it, because the alert doesn't work !
>
> If you have any idea...
>
> Thanks


[jQuery] Re: [ $(document).ready ] it doesn't work with HTML loaded dynamically

2008-08-26 Thread Will

Hi

On 26 août, 16:25, "diego valobra" <[EMAIL PROTECTED]> wrote:
> Hi , i had the same problem and i solved it including the function you need
> in the loaded page like this:

Thanks Diego for your help, but i already thought about this... and
there is still a problem...

Indeed,  if i want to have each content of my page wich is load by
Ajax, I will call the specific JS script for each content called

==> it creates a trouble with functions like toggle, etc... if you
visit 10 links on my page, you will have 10 JS script opened !

unless you know how to desactivate a JS at any time... : )

Any idea now.. : )

PS :
i found a plugin, livequery, but it doesn't seem to work, a script
like that :
$("#test_button").livequery("click", function(){
alert("joe");
}
will send alert on each click on my page, wherever i click


[jQuery] Re: input:empty and remember password

2008-08-26 Thread sperks

Resolved:

Took what Karl suggested and reconfigured it into my original script.
The key here was to change the assumption that the area would be empty
with the page was ready, thus putting the background styling in onload
rather than trying to remove it afterward.

HTML:

  
username

password


  


jQuery:
$(document).ready(function() {
  $("#loginArea").addClass("active");
  $("#loginArea input")
.focus(function() {
  $(this).removeClass("empty");
})
.blur(function() {
  if ($(this).val() == "") {
$(this).addClass("empty");
  };
});
  $(window).load(function() {
$("#loginArea input[value='']").addClass("empty");
  });
});

css:
#SMTuname,
#SMTpword { background-color: #728398; color: #fff; font-size: 1em;
background-image: none; background-repeat: no-repeat; background-
position: left; }
#SMTuname.empty { background-image: url(/images/username.gif); }
#SMTpword.empty { background-image: url(/images/password.gif); }

On Aug 26, 10:07 am, sperks <[EMAIL PROTECTED]> wrote:
> Karl,
>
> Thanks, your code reads well and understanding that you hadn't tested
> it, I threw it in to give it a whirl. It didn't work, but I'm seeing
> if I can put the tweaks in where needed.  I'll probably end up
> bloating it up a little, but I'll come back with the solution if I can
> get it to play nice...
>
> On Aug 26, 9:46 am, sperks <[EMAIL PROTECTED]> wrote:
>
> > Thanks Andy,
>
> > This is a good script for switching input content, but the problem
> > with a login form is that one of the fields is a password field and
> > displays as .  Therefore, I'm using a background image that is
> > removed when there's content.
>
> > On Aug 25, 4:33 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
>
> > > This is what someone on this list gave me about 2 weeks ago:
>
> > > // the focus / blur functionality of the text input
> > > // fields for the email a friend form.
> > > $('#input.email').bind('focus', function() {
> > >         // Set the default value if it isn't set
> > >         if ( !this.defaultValue ) this.defaultValue = this.value;
> > >         // Check to see if the value is different
> > >         if ( this.defaultValue && this.defaultValue != this.value ) 
> > > return;
> > >         // It isn't, so remove the text from the input
> > >         this.value = '';})
>
> > > .bind('blur', function() {
> > >         // If the value is blank, return it to the defaultValue
> > >         if ( this.value.match(/^\s*$/) )
> > >                 this.value = this.defaultValue;
>
> > > });
> > > -Original Message-
> > > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> > > Behalf Of sperks
> > > Sent: Monday, August 25, 2008 3:26 PM
> > > To: jQuery (English)
> > > Subject: [jQuery] input:empty and remember password
>
> > > I have a script that displays username and password as background images 
> > > in
> > > the input fields when the field is empty and they removes it when on focus
> > > (or when there's content left in the field). I then came up against the
> > > issue where if someone's browser populates the input fields after their
> > > browser is asked to remember their password and I end up with both the 
> > > input
> > > fields being populated and the background showing.  Here's my initial
> > > script:
>
> > > $(document).ready(function() {
> > >   $('#loginArea').addClass('active');
> > >   $('#loginArea.active input')
> > >     .focus(function() {
> > >       $(this).addClass("nobg");
> > >     })
> > >     .blur(function() {
> > >       if ($(this).val() == '') {
> > >         $(this).addClass("nobg");
> > >       };
> > >    });
> > > });
>
> > > I tried using
> > >   $('#loginArea.active input:empty').removeClass("nobg");
> > > but FF doesn't add the username/password until after the page has loaded 
> > > (I
> > > don't know what other browsers are doing), and thus the decision to 
> > > addClass
> > > is based on empty cells.
>
> > > Anyone have an idea of how to resolve this one?


[jQuery] Re: Fade() Function not Working on Flash Objects in Firefox

2008-08-26 Thread Jim D

Correction:  I am having the same problem in Safari


[jQuery] Re: jQuery Coding Standards

2008-08-26 Thread Eric Martin

Check out this "best practices" thread from a couple weeks ago:
http://groups.google.com/group/jquery-en/browse_thread/thread/3d5f3ebd49158822/22278429aeaad489

-Eric

On Aug 25, 11:46 pm, johannesf <[EMAIL PROTECTED]> wrote:
> Hello
>
> I'm looking for "coding standards" for jQuery but find it difficult to find
> any.
>
> Does someone have any suggestions on how our dev-team sould write the code
> in "best practice", name variables, objects and so on?
>
> best regards / johannes
> --
> View this message in 
> context:http://www.nabble.com/jQuery-Coding-Standards-tp19156680s27240p191566...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re:

2008-08-26 Thread Mike Alsup

> I want to make a script to search in a page for script src='http://*
> elements on a page for a site full of malicious scripts (added through
> a bug in the input form of the news system of a restricted area...),
> so I can make the script remove them on a page load (yeah, why not fix
> the security hole? because the guy don't want to -_-, well whatever).
> Anyway, how do I do that? I thought I could do that by using a $
> ("script:contains('http://*').remove or something, but I am very naive
> and didn't work. =P
>
> Anyone has any ideas how could I do that? To search for that script
> element and remove it? Thank you very much.

You can remove the tags like this:

$('script[src^=http://]').remove();

but removing them from the DOM will not remove the JavaScript code
that has already been evaluated.


[jQuery]

2008-08-26 Thread [EMAIL PROTECTED]

Hi everybody,

I want to make a script to search in a page for script src='http://*
elements on a page for a site full of malicious scripts (added through
a bug in the input form of the news system of a restricted area...),
so I can make the script remove them on a page load (yeah, why not fix
the security hole? because the guy don't want to -_-, well whatever).
Anyway, how do I do that? I thought I could do that by using a $
("script:contains('http://*').remove or something, but I am very naive
and didn't work. =P

Anyone has any ideas how could I do that? To search for that script
element and remove it? Thank you very much.


[jQuery] Re: Plugin: Validation: Error message order

2008-08-26 Thread caseyw

That did it for me. Thanks Jörn.


[jQuery] Fade() Function not Working on Flash Objects in Firefox

2008-08-26 Thread Jim D

Hello all,

I have a page with an iframe inside of a div tag.  In the iframe, I
have a page with several flash objects.  Each of the flash objects is
a button that, when clicked, will load another page into the iframe.
There is also functionality to show and hide the div containing the
iframe.  This is where my problem lies.  Right now, I am simply
calling the fadeIn() and fadeOut() functions on the container div,
which is working fine in ie, safari, and opera.  However, in Firefox,
the Flash objects are not fading out with the rest of the HTML on the
page.  They remain unchanged, then become invisible with the rest of
the div once the animation completes.  Is there a way around this
(while still keeping the Flash buttons)?  I'm sure there is, but I
haven't been able to find anything on the subject while combing
various discussion boards and documentation online.

Here is an example of what I'm talking about:

HTML:

 
 

Click here to hide the div up there

JavaScript:
$("#hideButton").click( function() {
 $("#frameWrapper").fadeOut("slow");
});

This isn't exactly the code I'm using (and its obviously abridged for
the sake of this forum) but it's along the lines of what I'm doing.
If anyone could offer me some insight as to why Flash objects don't
fade in Firefox or could point me in the right direction I would
really appreciate it.  Thanks


[jQuery] Re: [ $(document).ready ] it doesn't work with HTML loaded dynamically

2008-08-26 Thread Will

Hi Diego

On 26 août, 16:25, "diego valobra" <[EMAIL PROTECTED]> wrote:
> Hi , i had the same problem and i solved it including the function you need
> in the loaded page like this:

Thanks for this, but I thought about it before, I forgot to say it...

Discovering this group, I found some guy who talked about "livequery",
I tried but it seems to not work correctly

I think that your solution is the only one.

best regards

Will


[jQuery] Re: Multiple Callbacks within an load, post, get or Ajax Call (to get a more detailed progress)

2008-08-26 Thread pello1337

Nobody?

On 22 Aug., 12:00, pello1337 <[EMAIL PROTECTED]> wrote:
> Hi,
> I am not a native englisch speaker so please excuse my language.
>
> I am developing a project which handles a lot of data. Yesterday I
> thought about a progressbar, which indicates the actual status of an
> Ajax Call (Progressbar Plugin: 
> e.g.http://www.anthor.net/fr/jquery-progression.html)
>
> Now it would be nice to know, if somebody knows how I can tell the
> progressbar, which status the Ajax call has.
>
> For example:
> A click on a button starts a "load", "post", "get" whatever on a PHP
> file.
>
> $("#button").click(function() {
>         $.post("the_php_file.php", function(mysql_status) {
>                 if (mysql_status == 1) {
>                         alert("OK");
>                 } else {
>                         alert("BAD");
>                 }
>         });
>
> });
>
> This is the way I am doing it in the moment. Perfect would be a more
> detailed callback. Something like "mysql_status == 1", "...== 2",
> "...== 3" and so on after each mysql query has finished. So I could
> tell the progressbar, the first mysql query has finished, please go to
> 10% and so on.
>
> I hope you understand what I want. It would be very nice for the user
> to know, how long it takes until his data is inserted into the
> database or how long it takes, until he sees his requested data.
>
> Greetings and thanks for your replies. Hopefully :)


[jQuery] Re: [ $(document).ready ] it doesn't work with HTML loaded dynamically

2008-08-26 Thread diego valobra
Hi , i had the same problem and i solved it including the function you need
in the loaded page like this:
first page:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml";>

   Test
   


$(document).ready(function() {
   // to load the content.html
   $("a#b1").click( function() {
   $("#c").load("content.php");
   alert("test");
} );
} );



   
   Test1
   
   


_
second page
_


$(document).ready(function() {
   // action on the loaded part
   $("a#d").click( function() {
   alert("test2");
   } );
} );

Test2



and that's it
take a look at the demo page http://www.pirolab.it/jtb/content_1.php

I hope it helps you

Diego


2008/8/26 Will <[EMAIL PROTECTED]>

>
> Hello,
>
> I prefer prevent you that I'm french. I post on this group cause
> french groups cannot answer to this problem :
>
> When I add dynamically HTML code in a page, Jquery doesn't take charge
> of it.
>
> I hope that this example will be more understandable :
>
> 3 files : index.html, event.js, content.html
>
> 
> index.html :
>
> 
>  www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> http://www.w3.org/1999/xhtml"; xml:lang="fr" lang="fr">
> 
>Test
> />
> 
>
> 
> 
>
>Test1
>
>
> 
> 
>
> 
> event.js :
>
> 
> $(document).ready(function() {
>// to load the content.html
>$("a#b1").click( function() {
>$("#c").load("content.html");
>alert("test");
>} );
>// action on the loaded part
>$("a#d").click( function() {
>alert("test2");
>} );
> } );
>
>
> 
> content.html
>
> 
> Test2
>
> 
>
>
> as you'll notice it, content.html is added, but document.ready doesn't
> seem to see it, because the alert doesn't work !
>
> If you have any idea...
>
> Thanks
>


[jQuery] Re: input:empty and remember password

2008-08-26 Thread sperks

Karl,

Thanks, your code reads well and understanding that you hadn't tested
it, I threw it in to give it a whirl. It didn't work, but I'm seeing
if I can put the tweaks in where needed.  I'll probably end up
bloating it up a little, but I'll come back with the solution if I can
get it to play nice...

On Aug 26, 9:46 am, sperks <[EMAIL PROTECTED]> wrote:
> Thanks Andy,
>
> This is a good script for switching input content, but the problem
> with a login form is that one of the fields is a password field and
> displays as .  Therefore, I'm using a background image that is
> removed when there's content.
>
> On Aug 25, 4:33 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
>
> > This is what someone on this list gave me about 2 weeks ago:
>
> > // the focus / blur functionality of the text input
> > // fields for the email a friend form.
> > $('#input.email').bind('focus', function() {
> >         // Set the default value if it isn't set
> >         if ( !this.defaultValue ) this.defaultValue = this.value;
> >         // Check to see if the value is different
> >         if ( this.defaultValue && this.defaultValue != this.value ) return;
> >         // It isn't, so remove the text from the input
> >         this.value = '';})
>
> > .bind('blur', function() {
> >         // If the value is blank, return it to the defaultValue
> >         if ( this.value.match(/^\s*$/) )
> >                 this.value = this.defaultValue;
>
> > });
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> > Behalf Of sperks
> > Sent: Monday, August 25, 2008 3:26 PM
> > To: jQuery (English)
> > Subject: [jQuery] input:empty and remember password
>
> > I have a script that displays username and password as background images in
> > the input fields when the field is empty and they removes it when on focus
> > (or when there's content left in the field). I then came up against the
> > issue where if someone's browser populates the input fields after their
> > browser is asked to remember their password and I end up with both the input
> > fields being populated and the background showing.  Here's my initial
> > script:
>
> > $(document).ready(function() {
> >   $('#loginArea').addClass('active');
> >   $('#loginArea.active input')
> >     .focus(function() {
> >       $(this).addClass("nobg");
> >     })
> >     .blur(function() {
> >       if ($(this).val() == '') {
> >         $(this).addClass("nobg");
> >       };
> >    });
> > });
>
> > I tried using
> >   $('#loginArea.active input:empty').removeClass("nobg");
> > but FF doesn't add the username/password until after the page has loaded (I
> > don't know what other browsers are doing), and thus the decision to addClass
> > is based on empty cells.
>
> > Anyone have an idea of how to resolve this one?


[jQuery] [ $(document).ready ] it doesn't work with HTML loaded dynamically

2008-08-26 Thread Will

Hello,

I prefer prevent you that I'm french. I post on this group cause
french groups cannot answer to this problem :

When I add dynamically HTML code in a page, Jquery doesn't take charge
of it.

I hope that this example will be more understandable :

3 files : index.html, event.js, content.html

index.html :


http://www.w3.org/1999/xhtml"; xml:lang="fr" lang="fr">

Test






Test1





event.js :

$(document).ready(function() {
// to load the content.html
$("a#b1").click( function() {
$("#c").load("content.html");
alert("test");
} );
// action on the loaded part
$("a#d").click( function() {
alert("test2");
} );
} );


content.html

Test2



as you'll notice it, content.html is added, but document.ready doesn't
seem to see it, because the alert doesn't work !

If you have any idea...

Thanks


[jQuery] Autocomplete and multidimension data

2008-08-26 Thread foxtrot

I have a datastructure looking like this:
var customers = [
{ name: "A", projects: [{name:"val1",name:"val2",name:"val3"}] },
{ name: "B", projects:
[{name:"val1",name:"val2",name:"val3,name:"val4,name:"val5"}] },
.
{ name: "", projects: [{name:"val1",name:"val2"}] },
];

I use one autocomplete to set the name-values, and in another textbox
I'd like to use autocomplete to go through the previously chosen
customer to find the projects.

formatItem or formatMatch is propably the place to make this happen,
but how can I limit the data to just customers.projects, and for the
correct item?

Know there have been similar posts before, but didn't find anyone with
a clear strategy...

Thanx!


[jQuery] Re: input:empty and remember password

2008-08-26 Thread sperks

Thanks Andy,

This is a good script for switching input content, but the problem
with a login form is that one of the fields is a password field and
displays as .  Therefore, I'm using a background image that is
removed when there's content.

On Aug 25, 4:33 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
> This is what someone on this list gave me about 2 weeks ago:
>
> // the focus / blur functionality of the text input
> // fields for the email a friend form.
> $('#input.email').bind('focus', function() {
>         // Set the default value if it isn't set
>         if ( !this.defaultValue ) this.defaultValue = this.value;
>         // Check to see if the value is different
>         if ( this.defaultValue && this.defaultValue != this.value ) return;
>         // It isn't, so remove the text from the input
>         this.value = '';})
>
> .bind('blur', function() {
>         // If the value is blank, return it to the defaultValue
>         if ( this.value.match(/^\s*$/) )
>                 this.value = this.defaultValue;
>
> });
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of sperks
> Sent: Monday, August 25, 2008 3:26 PM
> To: jQuery (English)
> Subject: [jQuery] input:empty and remember password
>
> I have a script that displays username and password as background images in
> the input fields when the field is empty and they removes it when on focus
> (or when there's content left in the field). I then came up against the
> issue where if someone's browser populates the input fields after their
> browser is asked to remember their password and I end up with both the input
> fields being populated and the background showing.  Here's my initial
> script:
>
> $(document).ready(function() {
>   $('#loginArea').addClass('active');
>   $('#loginArea.active input')
>     .focus(function() {
>       $(this).addClass("nobg");
>     })
>     .blur(function() {
>       if ($(this).val() == '') {
>         $(this).addClass("nobg");
>       };
>    });
> });
>
> I tried using
>   $('#loginArea.active input:empty').removeClass("nobg");
> but FF doesn't add the username/password until after the page has loaded (I
> don't know what other browsers are doing), and thus the decision to addClass
> is based on empty cells.
>
> Anyone have an idea of how to resolve this one?


[jQuery] Re: Problem with Tutorials:How jQuery Works

2008-08-26 Thread Andy Matthews
"Oh?! You mean I have to include jQuery before the examples will work?"
 
:)
 
I've done that before without realizing it.

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Tuesday, August 26, 2008 8:20 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Problem with Tutorials:How jQuery Works


Hi there, 

First thing to do is make sure the reference to the jquery.js file is
correct. That sort of error usually occurs when it can't find the jquery.js
file. In Firefox, open the script tab in Firebug (If you don't have this
extension, get it here: http://www.getfirebug.com/ ) and click on the file
name heading. you should see two file names, one for jquery.js and one for
the current html page. Select the jquery.js file and look in the Script
inspector to see if it's giving you a 404.

You'll probably want to add a return false; after the alert line, too.

--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Aug 26, 2008, at 8:41 AM, Caveman wrote:



I'm having a problem running the first simple example in this
tutorial. here is my code:


 
   



$(document).ready(function(){
  $("a").click(function(){
  alert("Thanks for visiting!");
});

});
   
 
 
   http://jquery.com/";>jQuery
 
 

Seems pretty simple but does not work for me in IE 7, firefox, or
Opera.  I am running this in IIS on my XP Pro box.  IE just gives me
the error Object Expected.





[jQuery] Re: Problem with Tutorials:How jQuery Works

2008-08-26 Thread Karl Swedberg

Hi there,

First thing to do is make sure the reference to the jquery.js file is  
correct. That sort of error usually occurs when it can't find the  
jquery.js file. In Firefox, open the script tab in Firebug (If you  
don't have this extension, get it here: http://www.getfirebug.com/ )  
and click on the file name heading. you should see two file names, one  
for jquery.js and one for the current html page. Select the jquery.js  
file and look in the Script inspector to see if it's giving you a 404.


You'll probably want to add a return false; after the alert line, too.

--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Aug 26, 2008, at 8:41 AM, Caveman wrote:



I'm having a problem running the first simple example in this
tutorial. here is my code:


 
   



$(document).ready(function(){
  $("a").click(function(){
  alert("Thanks for visiting!");
});

});
   
 
 
   http://jquery.com/";>jQuery
 
 

Seems pretty simple but does not work for me in IE 7, firefox, or
Opera.  I am running this in IIS on my XP Pro box.  IE just gives me
the error Object Expected.




[jQuery] Re: Problem with Tutorials:How jQuery Works

2008-08-26 Thread Mike Alsup

> I'm having a problem running the first simple example in this
> tutorial. here is my code:
>
> 
>   
>     
>
>  
>
> $(document).ready(function(){
>    $("a").click(function(){
>    alert("Thanks for visiting!");
>  });
>
>  });
>     
>   
>   
>     http://jquery.com/";>jQuery
>   
>   
>
> Seems pretty simple but does not work for me in IE 7, firefox, or
> Opera.  I am running this in IIS on my XP Pro box.  IE just gives me
> the error Object Expected.


What errors are reported in the FF or Opera error console?  The most
likely problem is that the jQuery library is not loaded.  Are you
certain that the path is correct?  Try changing your inline script to
the following and see what gets alerted:


alert ( typeof jQuery );



[jQuery] Re: jQuery.data and pre-rendered pages.

2008-08-26 Thread Mike Alsup

> The problem is that i don't have access to the metadata plugin.
>
> So the question is still... is this possible with the built in
> function $.data?


No, the data function does not extract data from the markup.  "data"
is a convenient way of getting and storing runtime state.  You could
write your own logic for extracting data from the markup using attr or
hasClass for example..


[jQuery] SOT: Documenting keyboard entry for select element

2008-08-26 Thread Dan G. Switzer, II

Has anyone seen any good documentation on how the keyboard selection works
for the  element in the various browsers. It looks like the
behavior is pretty different in each browser. 

Firefox and IE7 allow variations of doing "ba" to select the first option
with a string starting with "ba", however the actual implementation differs
(and quite frankly confusing.) IE6 only allows you to toggle through the
first letter. So press "b" and then "a" would go to the first option
starting with "b" and then go to the first option starting with "a".

I've been trying to find any documentation, preferable something really
indepth.

We've had some customers ask for use to replicate this behavior in a
plug-in, but since the behavior is so different in all the browsers I'm
trying to really fully understand how each method works before I make
recommendations.

-Dan



[jQuery] Re: jQuery Calling Functions

2008-08-26 Thread Mike Alsup

> My code is (I am using a plugin to make my table searchable):
>
> $(document).ready(function()
>     {
>
>                 $('table#ratings tbody tr th').quicksearch({
>                         attached: "table#ratings",
>                         position: "before",
>                         hideElement: 'parent',
>                         loaderText:'',
>                         stripeRowClass: ['r1'],
>                         labelText: 'Search through keywords:',
>                         inputText: '',
>                         delay: 50
>                 });
>
>                 $("#MinimumLinks a").click(function(){
>                         $("#ratings_div").load("display_ratings.php?filter="+$
> (this).attr("value"));
>                 });
>
>     }
> );
>
> Display_ratings.php is the script that shows the table's tbody. The
> problem is that the table is easily filterable/searchable using the
> plugin when the page is loaded. However after I update the table using
> the click function on some hyperlinks, the table is no longer
> searchable. It looks like the classes are no longer added to the row
> that the plugin does. So I wanted to rerun the plugin function
> after .click event. How do I do this?
>
> Thank you very much,
>
> Eiso


Hi Eiso,

Give this doc a read.  I think it will help you understand the
problem:

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F

Mike


[jQuery] Re: jQuery.data and pre-rendered pages.

2008-08-26 Thread P. Skoog

The problem is that i don't have access to the metadata plugin.

So the question is still... is this possible with the built in
function $.data?

Patrik

On Aug 26, 1:20 pm, Mike Alsup <[EMAIL PROTECTED]> wrote:
> The metadata plugin page describes several ways to do this:
>
> http://plugins.jquery.com/project/metadata
>
> Mike
>
> On Aug 26, 2:55 am, "P. Skoog" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Is it possible to store meta data in html-tags on the page without the
> > help of jQuery.
>
> > The problem I'm having is that I have an existing php-script rendering
> > tables, and I really need to store meta data in each cell for later
> > use by jQuery.
>
> > Is this even possible?
>
> > Thanks,
> > Patrik Skoog


[jQuery] Problem with Tutorials:How jQuery Works

2008-08-26 Thread Caveman

I'm having a problem running the first simple example in this
tutorial. here is my code:


  


 

$(document).ready(function(){
   $("a").click(function(){
   alert("Thanks for visiting!");
 });

 });

  
  
http://jquery.com/";>jQuery
  
  

Seems pretty simple but does not work for me in IE 7, firefox, or
Opera.  I am running this in IIS on my XP Pro box.  IE just gives me
the error Object Expected.


[jQuery] Re: Using instead of with Superfish

2008-08-26 Thread Joe

Thanks Joel,

Putting in blank anchors worked perfectly.

thanks

-Joe

On Aug 25, 10:51 pm, "Joel Birch" <[EMAIL PROTECTED]> wrote:
> Hi Joe,
>
> Be aware that by using spans instead of anchors you will be breaking
> keyboard access to the submenus. Maybe using an anchor without a href
> attribute would be a better option? If you still want to use spans
> then you could probably change this line:
>
>  if (o.autoArrows) addArrow( $('>a:first-child',this) );
>
> to this:
>
>  if (o.autoArrows) addArrow( $('>:first-child',this) );
>
> I just removed the 'a' from before ':first-child'.
>
> Good luck.
> Joel Birch.


[jQuery] Re: jQuery Accordion Library and jQuery Lightbox Plugin Conflict?

2008-08-26 Thread Jörn Zaefferer
Try to add a class like "header" to the accordion anchors, and specify
header: "a.anchor" when initializing the accordion.

Jörn

On Tue, Aug 26, 2008 at 7:19 AM, swaters <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Does anybody know what is causing this and could hint on how to fix
> this:
>
> I have a jQuery lightbox gallery (which is using code from this page:
> http://leandrovieira.com/projects/jquery/lightbox/) inside a jQuery
> accordion panel (which is using this code from this library
> http://docs.jquery.com/UI/Accordion) and every time I click on an
> image, the accordion panel the image is inside collapses.
>
>  I'm not sure but I think it has something to do with CSS selectors,
> because the accordion scripts target the anchor tags and I have a
> feeling that it's trying to convert same the anchor tags written fort
> the images in the lightbox gallery? any clue on how to change the css
> selectors or do these symptoms sound familiar?
>
> Thanks,
>
> Steven
>


[jQuery] jQuery Calling Functions

2008-08-26 Thread Eiso

Dear jQuery Group,

I am new to jQuery and ran into my first obstacle that I can't solve
by Googleing.

My code is (I am using a plugin to make my table searchable):

$(document).ready(function()
{

$('table#ratings tbody tr th').quicksearch({
attached: "table#ratings",
position: "before",
hideElement: 'parent',
loaderText:'',
stripeRowClass: ['r1'],
labelText: 'Search through keywords:',
inputText: '',
delay: 50
});

$("#MinimumLinks a").click(function(){
$("#ratings_div").load("display_ratings.php?filter="+$
(this).attr("value"));
});

}
);

Display_ratings.php is the script that shows the table's tbody. The
problem is that the table is easily filterable/searchable using the
plugin when the page is loaded. However after I update the table using
the click function on some hyperlinks, the table is no longer
searchable. It looks like the classes are no longer added to the row
that the plugin does. So I wanted to rerun the plugin function
after .click event. How do I do this?

Thank you very much,

Eiso


[jQuery] Re: problem using form.js and nice edit together.

2008-08-26 Thread Mike Alsup

> well.. no Mike I think you got it wrong...
>
> OK I have written the code to explain the above problem and hosted it
> here...http://www.offthegroundmedia.com/edit/
>
> In this form when I change the ID combo box I retrieve data via ajax
> (using forms.js for jquery) and fills in to a text box(title) and text
> area(description). It works fine since I haven't implemented NideEdit
> (a rich text editor) to the text area. But when I implement NiceEdit I
> need to refresh the page to content fill in to the text area.

>From a jQuery perspective your is fine.  So I still think this is just
a matter of learning how NicEdit works.  How do you update the
contents of the editor programmatically?  Take all the ajax, etc out
of the equation and start with a blank editor.  How do you tell
NicEdit to change the contents of the editor to "Hello World"?  I
doubt very much that altering the native textarea's value will do the
trick.  I may be wrong, but I think that's the question you need to
answer.  Have you tried the NicEdit forums?  Anyone else out there
familiar with NicEdit?

Mike


[jQuery] Re: Finding form tag wrapping around image

2008-08-26 Thread Mike Alsup


> Using sDumper( $(this).parents('form') ); to dump the result visually
>
> I can see that length = 0, and there is only one parent object - tagName =
> 'IMG'
>
> So to me at least it doesnt look like its doing what it should?
>
> Any further help would be great - thanks!


I think you need to post a link to a sample page.  An IMG tag can
never be a parent node so something odd is happening there.


[jQuery] Re: jQuery.data and pre-rendered pages.

2008-08-26 Thread Mike Alsup

The metadata plugin page describes several ways to do this:

http://plugins.jquery.com/project/metadata

Mike


On Aug 26, 2:55 am, "P. Skoog" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is it possible to store meta data in html-tags on the page without the
> help of jQuery.
>
> The problem I'm having is that I have an existing php-script rendering
> tables, and I really need to store meta data in each cell for later
> use by jQuery.
>
> Is this even possible?
>
> Thanks,
> Patrik Skoog


[jQuery] Re: Autocomplete data lookup from DB

2008-08-26 Thread DineshRao

I never thought it will this simple, i was trying with JSON, just a
new line at the end of every item has solved the problem.
Thanks a lot ...

On Aug 26, 9:16 am, VirusMinus <[EMAIL PROTECTED]> wrote:
> Whats the data like at the moment?
>
> By default the autocomplete takes a list with each list item on a new
> line or a space.
>
> eg.
>
> ITEM1 ITEM2 ITEM3 ... ...
>
> or
>
> ITEM1
> ITEM2
> ITEM3
>
> On Aug 25, 11:16 pm, DineshRao <[EMAIL PROTECTED]> wrote:
>
> > I am trying to populate the autocomplete with list fetched from DB
> > (SQL server 2005), i am using ajax to do this.
> > But, i am facing some problem in which format the list fetch from DB
> > should be passed to the jquery.autocomplete.js
> > By the by i am using Java and Jsp. I have tried to pass as string,
> > arraylist.
> > Can some one please help me.


[jQuery] Re: Autocomplete data lookup from DB

2008-08-26 Thread VirusMinus

Whats the data like at the moment?

By default the autocomplete takes a list with each list item on a new
line or a space.

eg.

ITEM1 ITEM2 ITEM3 ... ...

or

ITEM1
ITEM2
ITEM3

On Aug 25, 11:16 pm, DineshRao <[EMAIL PROTECTED]> wrote:
> I am trying to populate the autocomplete with list fetched from DB
> (SQL server 2005), i am using ajax to do this.
> But, i am facing some problem in which format the list fetch from DB
> should be passed to the jquery.autocomplete.js
> By the by i am using Java and Jsp. I have tried to pass as string,
> arraylist.
> Can some one please help me.


[jQuery] Re: Re[jQuery] name several divs

2008-08-26 Thread roadtaken99


Greetings,

(i'm still very much a beginner in js and jquery. sorry if i'm missing
something obvious).

Am i missing something or the function above only returns the first
occurence of the divs with id "foo-" (instead of "all divs that have an id
that starts with "foo-"")??

what do i need to go through all (preferably in an array) the matched divs?

Thank you for your time and attention.

Regards,
Ernest.



ahlt wrote:
> 
> 
> On 29 Jul, 16:11, Klaus Hartl <[EMAIL PROTECTED]> wrote:
>> Try this:
>>
>> $('[EMAIL PROTECTED]"foo-"]').attr('id', function() {
>>  return this.id.replace('foo', 'bar');
>>
>> });
>>
>> --Klaus
> 
> Thank you very much. That solved my problem:)
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Rename-several-divs-tp11851468s27240p19157006.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] full blown news ticker

2008-08-26 Thread Almir Karic

i'm looking for a full blown news ticker, features i'd like to have:
- automatic scolling
- navigation
- jquery



the ticker on http://avalanche.nhl.com/ seems to do what i'd like it
to, the problems are that i probably can't just take theirs, second
problem being it is not jquery :-)

any recommendations?


[jQuery] Re: making this work with drupal

2008-08-26 Thread MarvinC

Wow thanks for this :D at last an answer that works :)

Thanks and regards

On Aug 20, 4:22 pm, nikhil <[EMAIL PROTECTED]> wrote:
> In jquery.autocomplete.js  make changes  in following function which
> is on line 341
>
> -> change parameter q with any other character or comment this line of
> parameter.
>
>         $.ajax({
>                                 // try to leverage ajaxQueue plugin to abort 
> previous requests
>                                 mode: "abort",
>                                 // limit abortion to this input
>                                 port: "autocomplete" + input.name,
>                                 dataType: options.dataType,
>                                 url: options.url,
>                                 data: $.extend({
>                                         q: lastWord(term),
>                                         limit: options.max
>                                 }, extraParams),
>                                 success: function(data) {
>                                         var parsed = options.parse && 
> options.parse(data) || parse(data);
>                                         cache.add(term, parsed);
>                                         success(term, parsed);
>                                 }
>                         });
>
> On Jul 21, 11:21 am, MarvinC <[EMAIL PROTECTED]> wrote:
>
> > i'm having problems with remote query forautocomplete.  the q is
> > already being used bydrupaland it seems thatautocomplete'sq
> > parameter conflicts withdrupal'sq parameter being used by menu.
>
> > Is there a way to change theautocompletesearch parameter q to other
> > variable (ex mysearch?searchTerm=foo)
>
> > any tips on makingautocompletework withdrupalwill be greatly
> > appreciated
>
> > thanks and regards
>
>


[jQuery] Accordion open when opening a new page

2008-08-26 Thread phew72

Is there any way to Accordion something open as soon as the page
loads? I'd like a  group to accordion open when a user has been
sent there.

Cheers, PH


[jQuery] autocomplete function to fire when no results

2008-08-26 Thread VirusMinus

I'm using bassistance.de , Jörn Zaefferer's autocomplete plugin and
loving it.

However I need to be able to call a function or run some javascript
code if the inputted text by the user into the autocomplete field
returns no results.

This would be ideal as an option or a method for the autocomplete
object.

I've seen a few people ask for this on his site and also here. He
mentioned including such functionality in a future release but I don't
think he got around to it.

Anyone mange to do this or have pointers on how I could go about
implementing it myself?

If I succeed maybe we can add this as a feature to the current build
of autocomplete?

Cheers,
M


[jQuery] Re: problem using form.js and nice edit together.

2008-08-26 Thread Hasanga

well.. no Mike I think you got it wrong...

OK I have written the code to explain the above problem and hosted it
here... http://www.offthegroundmedia.com/edit/

In this form when I change the ID combo box I retrieve data via ajax
(using forms.js for jquery) and fills in to a text box(title) and text
area(description). It works fine since I haven't implemented NideEdit
(a rich text editor) to the text area. But when I implement NiceEdit I
need to refresh the page to content fill in to the text area.

So this is my problem

Glad if anyone can help

Thanks!

>
> If NicEdit is like TinyMCE or FCKEdit then there is probably an
> additional step you need to do before submitting the data.  There data
> typically needs to be pulled from the editor's iframe and back into
> the original textarea.  I'd suggest looking through the NicEdit docs
> for something along those lines.
>
> Mike


  1   2   >