[jQuery] Tag Cloud

2007-09-19 Thread Mandy Singh
Is there an implementation of Tag Cloud css or logic using jquery?


[jQuery] Re: IE shows nothing o.0

2007-09-19 Thread John Resig

Do you have a full page online that we can look at? That line, alone,
shouldn't cause any problems.

--John

On 9/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi there,
>
> im new at jQuery and totaly new with JavaScript.
> But there is a huge Problem with jQuery an IE.
>
> To include jQuery i use that Line:
> 
>
> And since i have put this line to my Code IE shows only a blank white
> page.
> But it works fine with Opera and Firefox. Same thin with the
> StarterKit, it wont show up in the IE.
>
> How can i fix that Problem?
>
>


[jQuery] Re: getJSON doesnt remove ...

2007-09-19 Thread John Resig

How so? I see this line in the jQuery source:
head.removeChild( script );

Once the script is finished loading the script tag is then removed.

--John

On 9/19/07, Tom <[EMAIL PROTECTED]> wrote:
>
> Ive noticed that $.getJSON never attempts to remove the script tags it
> inserts. Is this a bug or by design?
>
> -Tom
>
>


[jQuery] Comet calls/multiple open HTTP connections

2007-09-19 Thread David Pollak

Howdy,

I'm using jQuery 1.2.1 (I love it... the selectors are most awesome
and it has a very "functional" flavor)

I've got a situation that I've seen on Firefox 2.0 (it may be an issue
on other browsers.)  It seems that I can only have 2 pending HTTP
requests from the browser to the same server at a given time.

I've been adding Comet support to lift (http://liftweb.net) and it's
pretty cool.  lift opens an HTTP GET request to the server with a list
of components on the page and last modified times.  If the components
have a newer modified time, the server immediately responds with
updates, otherwise the server keeps the connection open until either
one of the components updates or 2 minutes elapses.

There is also the possibility of doing an AJAX call on the page and
the AJAX calls may update the components causing them to redraw.  This
gives us 2 open connections.

The problem comes in if I've got 2 browser tabs open to the same site
(2 open HTTP Comet connections.)  In that case, the AJAX requests
block until one of the Comet connections closes.

First, is this expected behavior?

Second, is there a way to test to see how many browser tabs/windows
are making a request on the same server?

Third, is there a priority for POST rather than GET or are they
treated the same way?

Fourth, is there a way to kill the pending Comet request when I know
I'm about to do an AJAX request?

Fifth, are there any questions I'm not asking that I should?

Thanks,

David



[jQuery] Re: Installation of UI?

2007-09-19 Thread Rabbit

Hi Christian, thanks for the reply. Here's the wiki page with the
tablesorter typo:
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Sort_me:_Using_the_tablesorter_plugin

On Sep 18, 3:56 am, "Christian Bach" <[EMAIL PROTECTED]>
wrote:
> On what page in the wiki did you find tableSorter?
>
> Could you point me to the page so i can change it.
>
> /christian
>
> 2007/9/18, Rabbit <[EMAIL PROTECTED]>:
>
>
>
> > Ah, of course. It's tablesorter() -- lowercase 's'. The wiki needs to
> > be updated to reflect that, as it uses a capital 'S'.
>
> > On 9/17/07, Rabbit <[EMAIL PROTECTED]> wrote:
> > > [ If this is a duplicate I apologize -- it's been about 15 minutes and
> > > I don't see it on the list so I'm trying again. ]
>
> > > Hi all. I'm attempting to move to jQuery from MooTools, as I
> > > (generally) like the jQuery documentation better. However, I'm having
> > > trouble using the tableSorter function.
>
> > > I've downloaded jQuery 1.2.1 and UI 1.0. My JavaScript includes look
> > > like...
>
> > > 
> > > 
> > > 
>
> > > jQuery works, as I use $(document).ready... (inside rabbit.js) to
> > > throw an alert. But calling $('#clients').tableSorter(); tells me "no
> > > such function."
>
> > > Any ideas?



[jQuery] IE shows nothing o.0

2007-09-19 Thread [EMAIL PROTECTED]

Hi there,

im new at jQuery and totaly new with JavaScript.
But there is a huge Problem with jQuery an IE.

To include jQuery i use that Line:


And since i have put this line to my Code IE shows only a blank white
page.
But it works fine with Opera and Firefox. Same thin with the
StarterKit, it wont show up in the IE.

How can i fix that Problem?



[jQuery] Re: Accordion plugin height calcullation bug

2007-09-19 Thread Frantisek Malina

Demo at http://vizualbod.com/accordion/demo.html



[jQuery] Re: Can anyone suggest a jQuery way of improving this UI? Screenshot included.

2007-09-19 Thread 胡争辉
It seems there are some bugs in the sortables component.

2007/9/16, Karl Swedberg <[EMAIL PROTECTED]>:
>
>
> Hi Steve,
>
> The planned release of jQuery UI (including the sortables component) is
> today, so if you can hold off until the announcement, you'll probably be in
> really good shape. I'm sure there is some feverish work going on in
> preparation for the launch.
>
> --Karl
> _
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
>
>


-- 
http://www.goumin.com/
QQ: 443089607
QQ mail: [EMAIL PROTECTED]
Skype: huzhenghui
Gtalk: huzhengh


[jQuery] getJSON doesnt remove ...

2007-09-19 Thread Tom

Ive noticed that $.getJSON never attempts to remove the script tags it
inserts. Is this a bug or by design?

-Tom



[jQuery] Why is this accordion crashing in IE7?

2007-09-19 Thread Frantisek Malina

Demo is at http://vizualbod.com/accordion/demo.html



[jQuery] Re: Accordion plugin height calcullation bug

2007-09-19 Thread Frantisek Malina


demo is at http://vizualbod.com/accordion/demo.html

On Sep 19, 11:13 pm, Frantisek Malina <[EMAIL PROTECTED]> wrote:
> Hi all,
> I've got a problem with the accordion plugin height callcullation. It
> is a very cool plugin, but there seems to be bug in here.
>
> Plugin athttp://bassistance.de/jquery-plugins/jquery-plugin-accordion/
>
> It basically uses for stretching - height of the first element I hover
> over, instead of the height of the highest or current element.
>
> I use this XHTML for my navigation.
> _
> 
> Carnival Cruises
> 
> Carnival Conquest
> Carnival Destiny
> Carnival Fascination
> 
> 
> Celebrity Cruises
> 
> Celebrity Century
> Celebrity Constellation
> Celebrity Galaxy
> Celebrity Infinity
> Celebrity Journey
> Celebrity Mercury
> Celebrity Millennium
> Celebrity Quest
> Celebrity Summit
> 
> 
> Costa Cruises
> 
> Costa Allegra
> Costa Atlantica
> Costa Romantica
> Costa Serena
> Costa Victoria
> 
> 
> 
> _
>
> And this JavaScript to start it.
> _
> $(function() {
> jQuery('#n').Accordion({
> active: false,
> header: '.head',
> navigation: true,
> event: 'mouseover',
> autoheight: false,
> animated: 'easeslide'
> });});
>
> _
>
> Someone in the comments noted this bug and found a dirty workaround.
>
> Changing the line 170:
> var height = settings.toHide.height();
> to:
> var height = settings.toShow.height();
>
> I tried his hack. It fix the problem and it works but It shows many
> errors in the console:
> _
> Dom style property
> Invalid value for property height:
> Line: 1
> -XXXpx
> _
>
> Plugin code athttp://jquery.bassistance.de/accordion/jquery.accordion.js
>
> Please, help.
>
> Thank you



[jQuery] Re: Accordion plugin height calcullation bug

2007-09-19 Thread Frantisek Malina

Lovely demo of this bug is at http://vizualbod.com/accordion/demo.html

It is still crashing in IE7.




[jQuery] IE problem

2007-09-19 Thread Jonathon Stierman


Hi all --

This is my first foray into the jQuery library!  I'm working on an Accordion
-- and I've got everything running smoothly in Firefox, but for the life of
me I cannot get this example to function using IE:

http://www.learningjquery.com/2007/03/accordion-madness

It functions just fine on their site in IE7, but when I imported the data
(perhaps I missed something?  I did strip out most of what I thought wasn't
being used) to my test environment, IE fails to perform the actions.  No
error messages or anything -- just no actions.  Here's the code I am using:





$(document).ready(
function()
{
$('div.demo-show> div').hide();
$('div.demo-show> h3').click(
function()
{
var $nextDiv =
$(this).next();
var $visibleSiblings
= $nextDiv.siblings('div:visible');
if
($visibleSiblings.length )
{

$visibleSiblings.slideUp('fast', function() {$nextDiv.slideToggle('fast');
});
}
else
{

$nextDiv.slideToggle('fast');
}
}
);
}
);



/* ---
   =more show, more hide
-- */
.demo-show {
width: 350px;
margin: 1em .5em;
}

.demo-show h3 {
margin: 0;
padding: 5px;
width: 338px;
background: #bfcd93;
border-top: 1px solid #386785;
border-bottom: 1px solid #386785;
cursor: pointer;
}

.demo-show div {
padding: 1em .25em .5em;
}
.demo-show p {
margin-top: 0;
}





Title 1
Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.
Title 2
Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
Title 3
Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum
dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.




Thanks in advance for any insights!

Jonathon





[jQuery] Re: Accordion plugin height calcullation bug

2007-09-19 Thread Frantisek Malina

Lovely demo of this bug is at http://vizualbod.com/accordion/demo.html

It is still crashing in IE7. I hope it can halp you to help me.



[jQuery] Re: jquery looping is slow

2007-09-19 Thread John Resig

> Also, it's possible your initial selection is slow. I imagine having tbody
> in there isn't helping at all, and is probably making it slower. "#tableId
> tr" or even better, "#tableId > tbody > tr" would probably be faster.

The shorter the selector, the faster it is and every time you see a
space, >, +, or ~ in your selector - double how long it takes (a very
rough rule of thumb).

"tr" is faster than "#table tr" is faster than "#table tbody tr" is
faster than "#table > tbody > tr".

Of course, all those selectors actually select different things,
therefore your mileage may vary.

--John


[jQuery] Re: problem with nested ajax calls

2007-09-19 Thread Michael Geary

I'll bet "this" is not what you expect. What is all the "this" usage for? It 
doesn't look like you are creating an object, or are
you? I don't see the calling code - do you call "new jDemon" or just "jDemon()"?

login, getAllCustomers, and getAllCustomersSuccess are methods of... what?

For example:

success: this.getAllCustomers

When getAllCustomers() gets called, it won't be called as a method of that 
particular "this" object

Can you write the code without all the "this" stuff? (Use "this" inside the 
.each callback, of course, I'm talking about the other
"this" methods.) It may be a lot easier to get it working that way.

Do you have a link to a test page?

-Mike

> From: Lee Hinde
> 
> I am trying to nest an ajax call as part of the success 
> callback to an ajax call. Specifically, after a successful 
> log in, I'd like to populate some data.
> 
> I'm stepping into a lot of new ground, for me, so it's hard 
> to figure out why something isn't working.
> 
> The login works fine. And the first callback is run, using 
> Firebug, I can tell that the 2nd ajax call is returning the 
> data I expect. But the success callback for the 2nd ajax use 
> isn't firing. I'd be grateful for any assistance.
> 
> Thanks.
> 
> 
> //jDemon was a typo that seemed appropriate, so it stuck 
> function jDemon() {
> 
> //This works
> this.login = function () {
> var vusername = $("#name").val();
> var vpassword = $("#password").val();
> $.ajax({
> type:"GET",
> url:"dax/login",
> data: "username="+vusername+"&password="+vpassword,
> success: this.getAllCustomers,
> error: this.loginResponseError
> }
> );
> };
> 
> //This works
> this.getAllCustomers = function (data){
> this.sessionId = $("sessionId",data).text();
> postDebug(this.sessionId);
> 
> $.ajax({
>type:"GET",
>url:"dax/allrecords",
>data: "sessionid="+this.sessionId+"&tableid=1",
>success: this.getAllCustomersSuccess,
>error: this.loginResponseError
>});
> 
> };
>   //this never runs, although I can tell that data 
> has come back from the server
> this.getAllCustomersSuccess  = function(data){
> postDebug("getallcustomer");
> 
> var textToDisplay = "";
> var len=$("row",data).length;
> $("row",data).each(function(i){
> 
> $("field",data).each(function(i){
>  textToDisplay =+ $(this).attr("id");
>   textToDisplay =+ $(this).text();
> 
> }) //each field
> 
> } )//each row
> $("#debug").text(textToDisplay);
> 
> };
> 
>;}
> 
>//debug is a console I setup in the page.
>function postDebug(textToPost){
>var hold =  $("#debug").text();
>$("#debug").text(hold+"\n"+textToPost);
> 
>}
> 



[jQuery] Re: problem with nested ajax calls

2007-09-19 Thread Lee Hinde

On 9/19/07, Lee Hinde <[EMAIL PROTECTED]> wrote:
> Hi;
>
> I am trying to nest an ajax call as part of the success callback to an
> ajax call. Specifically, after a successful log in, I'd like to
> populate some data.
>
> I'm stepping into a lot of new ground, for me, so it's hard to figure
> out why something isn't working.
>
> The login works fine. And the first callback is run, using Firebug, I
> can tell that the 2nd ajax call is returning the data I expect. But
> the success callback for the 2nd ajax use isn't firing. I'd be
> grateful for any assistance.
>
> Thanks.
>
>
> //jDemon was a typo that seemed appropriate, so it stuck
> function jDemon() {
>
> //This works
> this.login = function () {
> var vusername = $("#name").val();
> var vpassword = $("#password").val();
> $.ajax({
> type:"GET",
> url:"dax/login",
> data: "username="+vusername+"&password="+vpassword,
> success: this.getAllCustomers,
> error: this.loginResponseError
> }
> );
> };
>
> //This works
> this.getAllCustomers = function (data){
> this.sessionId = $("sessionId",data).text();
> postDebug(this.sessionId);
>
> $.ajax({
>type:"GET",
>url:"dax/allrecords",
>data: "sessionid="+this.sessionId+"&tableid=1",
>success: this.getAllCustomersSuccess,
>error: this.loginResponseError
>});
>
> };
>   //this never runs, although I can tell that data has come
> back from the server
> this.getAllCustomersSuccess  = function(data){
> postDebug("getallcustomer");
>
> var textToDisplay = "";
> var len=$("row",data).length;
> $("row",data).each(function(i){
>
> $("field",data).each(function(i){
>  textToDisplay =+ $(this).attr("id");
>   textToDisplay =+ $(this).text();
>
> }) //each field
>
> } )//each row
> $("#debug").text(textToDisplay);
>
> };
>
>;}
>
>//debug is a console I setup in the page.
>function postDebug(textToPost){
>var hold =  $("#debug").text();
>$("#debug").text(hold+"\n"+textToPost);
>
>}
>

I found one problem with how I was referencing the variable sessionId.
I broke out the 2nd call "getAllCustomers" to a link and, with the
fixed variable, it works fine. But it still doesn't work when called
in a nested fashion.


[jQuery] jQuery UI Tabs

2007-09-19 Thread Eridius


http://www.kaizendigital.com/codereck/index_jquery.php

this is my page to test out jQuery scripts. right now i am going through the
jQuery UI stuff and hit a bug(?) in the tabs.  First thing which is not so
big is that the tabs seem to be way to right, much more than i thought and
can't find where in the css is controlling that.  The second big issues is
if you look at this in IE, the tabs are in the container box when they
should be on top of it.  any help with these two issue would be great,
-- 
View this message in context: 
http://www.nabble.com/jQuery-UI-Tabs-tf4484490s15494.html#a12788443
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: UI Photo Demo on Safari

2007-09-19 Thread John Resig

David & Duncan -

Thanks for the feedback! UI-specific stuff should head to the jQuery UI list:
http://groups.google.com/group/jquery-ui

--John

On 9/19/07, Duncan Heal <[EMAIL PROTECTED]> wrote:
>  Hi David
>
> I've heard somewhere that they are working on it. I think they're also
> discouraging posts to this list about UI though I'm sure they appreciate the
> feedback.
>
> Regards
>
> Duncan
> - - - - - - - - - - - - - - - - -
> Sprocket Web Design
> www.sprocket.co.nz
> - - - - - - - - - - - - - - - - -
>
>
>
> On 19/09/2007, at 3:52 PM, David Pollak wrote:
>
>
> Howdy,
>
> I'm wicked impressed with the photo demo of the new jQuery UI kit.
> Unfortunately, it doesn't seem to work on Safari.  Is this a known
> issue (I couldn't find mention on this list with a couple of
> searches)?  If it is, what's the ETA for a fix?
>
> Thanks,
>
> David
>
>
>


[jQuery] Re: UI Photo Demo on Safari

2007-09-19 Thread Duncan Heal

Hi David

I've heard somewhere that they are working on it. I think they're  
also discouraging posts to this list about UI though I'm sure they  
appreciate the feedback.


Regards
Duncan
- - - - - - - - - - - - - - - - -
Sprocket Web Design
www.sprocket.co.nz
- - - - - - - - - - - - - - - - -


On 19/09/2007, at 3:52 PM, David Pollak wrote:



Howdy,

I'm wicked impressed with the photo demo of the new jQuery UI kit.
Unfortunately, it doesn't seem to work on Safari.  Is this a known
issue (I couldn't find mention on this list with a couple of
searches)?  If it is, what's the ETA for a fix?

Thanks,

David





[jQuery] problem with nested ajax calls

2007-09-19 Thread Lee Hinde

Hi;

I am trying to nest an ajax call as part of the success callback to an
ajax call. Specifically, after a successful log in, I'd like to
populate some data.

I'm stepping into a lot of new ground, for me, so it's hard to figure
out why something isn't working.

The login works fine. And the first callback is run, using Firebug, I
can tell that the 2nd ajax call is returning the data I expect. But
the success callback for the 2nd ajax use isn't firing. I'd be
grateful for any assistance.

Thanks.


//jDemon was a typo that seemed appropriate, so it stuck
function jDemon() {

//This works
this.login = function () {
var vusername = $("#name").val();
var vpassword = $("#password").val();
$.ajax({
type:"GET",
url:"dax/login",
data: "username="+vusername+"&password="+vpassword,
success: this.getAllCustomers,
error: this.loginResponseError
}
);
};

//This works
this.getAllCustomers = function (data){
this.sessionId = $("sessionId",data).text();
postDebug(this.sessionId);

$.ajax({
   type:"GET",
   url:"dax/allrecords",
   data: "sessionid="+this.sessionId+"&tableid=1",
   success: this.getAllCustomersSuccess,
   error: this.loginResponseError
   });

};
  //this never runs, although I can tell that data has come
back from the server
this.getAllCustomersSuccess  = function(data){
postDebug("getallcustomer");

var textToDisplay = "";
var len=$("row",data).length;
$("row",data).each(function(i){

$("field",data).each(function(i){
 textToDisplay =+ $(this).attr("id");
  textToDisplay =+ $(this).text();

}) //each field

} )//each row
$("#debug").text(textToDisplay);

};

   ;}

   //debug is a console I setup in the page.
   function postDebug(textToPost){
   var hold =  $("#debug").text();
   $("#debug").text(hold+"\n"+textToPost);

   }


[jQuery] Re: OT: PHP to read jQuery API XML

2007-09-19 Thread Stephan Beal

On Sep 19, 8:52 pm, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> What I have so far 
> is:http://www.commadot.com/jquery/experiments/api/xmlReader.txt(code)
> http://www.commadot.com/jquery/experiments/api/xmlReader.php(results)
>
> I will have to make more nested foreach loops to get grandchildren and
> great-grandchildren.
> This seems like a horrible pattern.

If the rendering code is in its own function, it can recursively call
itself to handle the great[great[great]]grandchildren.

> Is there a better way on the server-side to do this?  Any code samples or
> demos would be awesome. :)

My first thought is simply to move the main loop into a function, so
it can be called recursively. You seem to be on the right track
though.

> jQuery is so easy.  PHP is not. (for me)

Perhaps i can help out - feel free to get in touch with my off-list.
i'm pretty good with PHP, if i may say so myself.

Where did you get the XML data from, by the way?

Another minor tip for you: some web servers are configured to
server .phps files as context-highlighted PHP source code. So, instead
of xmlReader.txt, try copying (or symlinking) xmlReader.php to
xmlReader.phps and see if you server can do that. It makes reading the
code much simpler. :)



[jQuery] Re: How to return a click event from the container function

2007-09-19 Thread Erik Beeson
Anytime you do $(...), that's often the slowest part of your chain. So if
you find yourself doing it a lot for the same selector, it might help
performance to do it once, store it in a variable, then reference the
variable instead. This specific case is probably not a great example,
because selecting by ID is fairly fast already, but it certainly wouldn't
hurt. Here's the same thing again with caching:

this.showDialog = function(msg, buttons, onHide) {
   var $inline_dialog = $('#inline_dialog');
   $inline_dialog.show().swapDepths();
   var buttons = (buttons) || '';
   $('#' + self.window_id).floatWinSetContent({content:msg + buttons,
title:''});
   $('#inline_alert_close_button').click(function() {
 $inline_dialog.hide();
 if($.isFunction(onHide)) onHide.call($inline_dialog);
 return false;
   });
}

Like I said, it's not a great example, because it's only used 3 times, and
selecting by ID is pretty fast. But it's something to keep in mind in
general.

I prefix the variable with $ as a convention to remind myself that that
variable points to a jQuery object.

--Erik


On 9/19/07, Brook Davies <[EMAIL PROTECTED]> wrote:
>
> Question: When you say "consider caching $('#inline_dialog') in a local
> variable", do you mean simply storing the string x = '' or
another
> method of caching. How would you cache it and reuse it with jQuery? Does
it
> need to be inserted into the document before it can be cached?
>
> Thanks!
>
> Brook
>
>
>
>
> 
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Erik Beeson
> Sent: September 19, 2007 11:39 AM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: How to return a click event from the container
> function
>
> For that to happen, showDialog would have to block until the dialog was
> closed, and that's not how JavaScript works. To do what you want, pass a
> callback function to showDialog and call it on close. Something like this
> (untested):
>
> this.showDialog = function(msg, buttons, onHide) {
>  $('#inline_dialog').show().swapDepths();
>  var buttons = (buttons) || ' id="inline_alert_close_button">';
>  $('#' + self.window_id).floatWinSetContent({content:msg + buttons,
> title:''});
>  $('#inline_alert_close_button').click(function() {
>  $('#inline_dialog').hide();
>  if($.isFunction(onHide)) onHide.call(/* whatever you want 'this' to be
> in your callback, maybe $('#inline_dialog') */);
>  return false;
>  });
> }
>
> Also, you might consider caching $('#inline_dialog') in a local variable,
> since you call it a lot. Lastly, it's good form to include a semicolon
after
> the last } since it's technically an assignment, so one should be there.
> It'll help save you from potential problems down the road.
>
> Good luck with it.
>
> --Erik
>
>
> On 9/19/07, Skilip <[EMAIL PROTECTED]> wrote:
> >
> > Hi, I'm currently working on a function which shows a inline dialog,
> > so I can use html in the dialog box. In the dialogbox I've put a
> > button to close the dialog box. If the button is clicked I want the
> > function showDialog() to return a value. The problem is that it's out
> > of the scope when I'm in the click() function. It there a solution?
> >
> > this.showDialog = function(msg, buttons) {
> > $('#inline_dialog').show().swapDepths();
> > var buttons = (buttons) || ' > id="inline_alert_close_button">';
> > $('#' + self.window_id).floatWinSetContent({content:msg + buttons,
> > title:''});
> > $('#inline_alert_close_button').click(function() {
> > $('#inline_dialog').hide();
> > return false;
> > });
> > }
> >
> >
>
>
>


[jQuery] Re: easiest question all day

2007-09-19 Thread Josh Nathanson



var GitRDone = "smoke'n hot";


$("body").append(GitRDone);

Not tested...


- Original Message - 
From: "FrankTudor" <[EMAIL PROTECTED]>

To: "jQuery (English)" 
Sent: Wednesday, September 19, 2007 12:45 PM
Subject: [jQuery] easiest question all day




can someone show me an example of creating a simple variable and
appending that variable to the document body?

Here is my simple example (that doesn't work)...

var GitRDone = "smoke'n hot";
$GitRDone.appendTo('body');

Thanks,
Frank



[jQuery] loading into scrollable div?

2007-09-19 Thread Sav

I'm using the load() function to insert external html files into a
scrollable div container.

The problem is that if you scroll down in the content of the div, then
do an action that loads new text into the div, the scroll stays where
you were rather than returning to the top of the content.

Is there a way around this?



[jQuery] Re: ajax response url

2007-09-19 Thread x0nix

That's what I was afraid of. I'll work it around with custom header as
you suggest.

Many thanks.

x0nix

On 19 Zář, 13:44, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> As far as I can tell, this can't be done cross-browser. Firefox has an
> xhr.channel object that has both the original URL, and the redirected
> URL in various places, but there seems to be no such thing available
> in Safari 2. And xhr.getAllResponseHeaders() gives the headers for the
> post-redirected page only.
>
> I didn't try Safari 3, IE, Opera, etc.
>
> If it was really important, you could do some voodoo with sending
> along the current URL as a custom response header that you could then
> check against. Or, depending on the scenario, maybe you'd be better of
> using a different HTTP status code, or using a JSON object and do your
> "redirection" client side.
>
> --Erik
>
> On 9/19/07, x0nix <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > is there a way how to read url of ajax response? Usually it is the
> > same url I called it with, but sometimes the target url is changed by
> > redirect (code 302). So can I somehow read the "final" url?
>
> > Thanks



[jQuery] Re: How to return a click event from the container function

2007-09-19 Thread Brook Davies

Question: When you say “consider caching $('#inline_dialog') in a local
variable”, do you mean simply storing the string x = ‘’ or another
method of caching. How would you cache it and reuse it with jQuery? Does it
need to be inserted into the document before it can be cached?

Thanks!

Brook 





From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Erik Beeson
Sent: September 19, 2007 11:39 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: How to return a click event from the container
function

For that to happen, showDialog would have to block until the dialog was
closed, and that's not how JavaScript works. To do what you want, pass a
callback function to showDialog and call it on close. Something like this
(untested): 

this.showDialog = function(msg, buttons, onHide) {
   $('#inline_dialog').show().swapDepths();
   var buttons = (buttons) || ''; 
   $('#' + self.window_id).floatWinSetContent({content:msg + buttons,
title:''});
   $('#inline_alert_close_button').click(function() {
 $('#inline_dialog').hide();
 if($.isFunction(onHide)) onHide.call(/* whatever you want 'this' to be
in your callback, maybe $('#inline_dialog') */);
 return false;
   });
}

Also, you might consider caching $('#inline_dialog') in a local variable,
since you call it a lot. Lastly, it's good form to include a semicolon after
the last } since it's technically an assignment, so one should be there.
It'll help save you from potential problems down the road. 

Good luck with it.

--Erik


On 9/19/07, Skilip <[EMAIL PROTECTED]> wrote:
> 
> Hi, I'm currently working on a function which shows a inline dialog, 
> so I can use html in the dialog box. In the dialogbox I've put a
> button to close the dialog box. If the button is clicked I want the
> function showDialog() to return a value. The problem is that it's out 
> of the scope when I'm in the click() function. It there a solution?
> 
>   this.showDialog = function(msg, buttons) {
> $('#inline_dialog').show().swapDepths();
> var buttons = (buttons) || ' id="inline_alert_close_button">';
> $('#' + self.window_id).floatWinSetContent({content:msg + buttons,
> title:''});
> $('#inline_alert_close_button').click(function() { 
>   $('#inline_dialog').hide();
>   return false;
> });
>   }
> 
> 




[jQuery] Accordion plugin height calcullation bug

2007-09-19 Thread Frantisek Malina

Hi all,
I've got a problem with the accordion plugin height callcullation. It
is a very cool plugin, but there seems to be bug in here.

Plugin at http://bassistance.de/jquery-plugins/jquery-plugin-accordion/

It basically uses for stretching - height of the first element I hover
over, instead of the height of the highest or current element.

I use this XHTML for my navigation.
_

Carnival Cruises

Carnival Conquest
Carnival Destiny
Carnival Fascination


Celebrity Cruises

Celebrity Century
Celebrity Constellation
Celebrity Galaxy
Celebrity Infinity
Celebrity Journey
Celebrity Mercury
Celebrity Millennium
Celebrity Quest
Celebrity Summit


Costa Cruises

Costa Allegra
Costa Atlantica
Costa Romantica
Costa Serena
Costa Victoria



_

And this JavaScript to start it.
_
$(function() {
jQuery('#n').Accordion({
active: false,
header: '.head',
navigation: true,
event: 'mouseover',
autoheight: false,
animated: 'easeslide'
});
});
_

Someone in the comments noted this bug and found a dirty workaround.

Changing the line 170:
var height = settings.toHide.height();
to:
var height = settings.toShow.height();

I tried his hack. It fix the problem and it works but It shows many
errors in the console:
_
Dom style property
Invalid value for property height:
Line: 1
-XXXpx
_

Plugin code at http://jquery.bassistance.de/accordion/jquery.accordion.js

Please, help.

Thank you



[jQuery] Open and search a .XML file

2007-09-19 Thread Danjojo

Can anyone provide me a link of how to open an xml file using JQuery?



[jQuery] easiest question all day

2007-09-19 Thread FrankTudor

can someone show me an example of creating a simple variable and
appending that variable to the document body?

Here is my simple example (that doesn't work)...

var GitRDone = "smoke'n hot";
$GitRDone.appendTo('body');

Thanks,
Frank



[jQuery] Job Posting: Javascript/JQuery Developer

2007-09-19 Thread Assembla

Venture-funded hot startup seeks an experienced JQuery/JavaScript
developer for an exciting project to be used in the science and
research worlds. Our multinational team has diverse backgrounds in
academics, sciences, bio-tech, and hi-tech, and was founded on the
observation that individual scientists have too much to read and
understand, and also no convenient way to combine and evaluate
existing information into potentially valuable new knowledge.

The primary responsibility of the developer is to develop and maintain
a web-based desktop that integrates multiple application services for
scientists and researchers. The desktop, which uses a windowing
metaphor with direct manipulation and visual alerts, will be extended
with a range of new applications essential for scientists.

Qualifications:
Strong Javascript skills, with jQuery experience
PHP experience
Talented Web developer

Experience working as part of a distributed team and with agile
development processes is a plus

Compensation will be based on the skills and experience of the
candidate. This is a telecommuting position and you can be located
anywhere. Candidates will be offered a paid trial. Those successful in
trial will be offered long-term positions.

For a complete job description, please go to 
http://www.assembla.com/search/show_job/73
To apply, click on the Apply to this job link. Include in your note
when you might be available to begin a paid trial, the number of hours
per week you are available, and your hourly or weekly rate.



[jQuery] Re: validation - multiple errorPlacements

2007-09-19 Thread seedy


Sounds good I'll give that a try, thanks.

Jörn Zaefferer wrote:
> 
> 
> seedy schrieb:
>> ok now a follow up question
>>
>> I have 3 text boxes that make up a telephone number.  I want validation
>> to
>> fail if any of the text boxes are not complete, but I only want to show
>> one
>> message for the failure, not one per textbox.  Any recommended ways of
>> doing
>> this?
>>   
> The first thing that I'd come up with is to put a single custom method 
> on the first/last field (depending on your error placement on or the 
> other may be easier) and check the other two fields inside that method.
> 
> -- Jörn
> 
> 

-- 
View this message in context: 
http://www.nabble.com/validation---multiple-errorPlacements-tf4482247s15494.html#a12786661
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Update div

2007-09-19 Thread Erik Beeson

The Taconite plugin is good for that kind of thing. Not sure if it's
been update for 1.2 yet:

http://www.malsup.com/jquery/taconite/

--Erik


On 9/19/07, David <[EMAIL PROTECTED]> wrote:
>
> How update multiple div by ajax from php?
>
>


[jQuery] Re: Jquery in the BBB

2007-09-19 Thread Andy Matthews

Better Business Bureau 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Chris W. Parker
Sent: Wednesday, September 19, 2007 3:52 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Jquery in the BBB


On Wednesday, September 19, 2007 12:16 PM Anthony Leboeuf(Worcester Wide
Web) said:

> I'm doing the  back end programming for the new BBB websites launching 
> at the beginning of next month, they are rocking Jquery all the way!
> 
> They are using interface, roundbox, slider

Battle Bots from Bornio? Big Bumble Bees? Beautiful Brown Barns?
Bartholomew's Biggest Bungle?




[jQuery] Update div

2007-09-19 Thread David

How update multiple div by ajax from php?



[jQuery] Effiecint way to create an object for checkboxes onload

2007-09-19 Thread Potluri


Hi I've multiple criteria of checkboxes on one page. Each criteria contains
differnt number of checkboxes. I've 8 criterias of checkboxes. 
For example

A
B
C


A1
B1
C1
D1
E1

etc...

All I'm trying to do is create objects for each criteria of checkboxes like
mentioned below on page load

var $cuisineCheckBoxObject = $(".refSearchCuisineForm
[EMAIL PROTECTED]'checkbox']");
 cuisineCheckBoxObject=$cuisineCheckBoxObject[0];
var $entreeCheckBoxObject = $(".refSearchEntreeForm
[EMAIL PROTECTED]'checkbox']");  
entreeCheckBoxObject=$entreeCheckBoxObject[0];
var $neighborhoodCheckBoxObject = $(".refSearchNeighborhoodForm
[EMAIL PROTECTED]'checkbox']");
neighborhoodCheckBoxObject=$neighborhoodCheckBoxObject[0];
var $openForCheckBoxObject = $(".refSearchOpenForForm
[EMAIL PROTECTED]'checkbox']");
openForCheckBoxObject=$openForCheckBoxObject[0];
var $restTypeCheckBoxObject = $(".refSearchRestTypeForm
[EMAIL PROTECTED]'checkbox']");
restTypeCheckBoxObject=$restTypeCheckBoxObject[0];
var $restFeaturesCheckBoxObject = $(".refSearchRestFeaturesForm
[EMAIL PROTECTED]'checkbox']");
restFeaturesCheckBoxObject=$restFeaturesCheckBoxObject[0];
var $barTypeCheckBoxObject = $(".refSearchBarTypeForm
[EMAIL PROTECTED]'checkbox']");
barTypeCheckBoxObject=$barTypeCheckBoxObject[0];
var $barFeaturesCheckBoxObject = $(".refSearchBarFeaturesForm
[EMAIL PROTECTED]'checkbox']");
barFeaturesCheckBoxObject=$barFeaturesCheckBoxObject[0];


Annoyingly this initialition is taking 4-5 secs... I think I'm not doing is
in efficient way..I want to take this initialization to below 1 sec..  Is
that possible.. Please reply to this ASAP..
Thanks in advance.

Regards,
Vijay Potluri



-- 
View this message in context: 
http://www.nabble.com/Effiecint-way-to-create-an-object-for-checkboxes-onload-tf4483982s15494.html#a12786808
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: jQuery UI - How do I get the X and Y of the DROP div

2007-09-19 Thread Erik Beeson

ev is the event that triggered the callback (mousemove for over/out,
mouseup for drop, etc). ui is an object that has the following
properties: helper, position, offset, draggable, options. I suggest
you log them to firebug console to get a feel for what they mean.

In your droppable callbacks, 'this' is the droppable.

To get the position of the droppable, to $(this).offset(); To get the
position of the draggable, do $(ui.helper).offset(); If your draggable
sets the "helper" property, so it isn't dragging the original element,
then you can get the position of the original element with
$(ui.draggable.element).offset()

Hope it helps.

--Erik


On 9/19/07, Frank Peterson <[EMAIL PROTECTED]> wrote:
>
> I'm using the example at:
> http://docs.jquery.com/UI/Droppables
>
> and I have the BLOCK dragging and able to drop it, but I want the
> BLOCK to take the X and Y position of the DROP div, I'm not sure how
> to find that out
>
> Also what are the ev, ui in the drop: function? Will UI give me the
> actual DROP div incase i have more than 1?
>
>


[jQuery] Re: validation - multiple errorPlacements

2007-09-19 Thread Jörn Zaefferer


seedy schrieb:

ok now a follow up question

I have 3 text boxes that make up a telephone number.  I want validation to
fail if any of the text boxes are not complete, but I only want to show one
message for the failure, not one per textbox.  Any recommended ways of doing
this?
  
The first thing that I'd come up with is to put a single custom method 
on the first/last field (depending on your error placement on or the 
other may be easier) and check the other two fields inside that method.


-- Jörn


[jQuery] Re: Jquery in the BBB

2007-09-19 Thread Chris W. Parker

On Wednesday, September 19, 2007 12:16 PM Anthony Leboeuf(Worcester Wide
Web) said:

> I'm doing the  back end programming for the new BBB websites launching
> at the beginning of next month, they are rocking Jquery all the way!
> 
> They are using interface, roundbox, slider

Battle Bots from Bornio? Big Bumble Bees? Beautiful Brown Barns?
Bartholomew's Biggest Bungle?


[jQuery] Re: Determining the source of a load

2007-09-19 Thread Erik Beeson
Right, I was suggesting you make a change on your server so you don't send a
3xx redirection, and instead send another code that you can check for on the
client. You could still do the redirection from javascript.

There was just another thread about detecting URL redirections in ajax.
Seems it's possible in firefox, but not safari, and I don't know about other
browsers.

--Erik


On 9/18/07, dougXN <[EMAIL PROTECTED]> wrote:
>
>
> I thought the status code would work, but the status code that returns
> does not say anything about being redirected. It all comes back very
> normal like it did something that it was suppose to do.
>
> Actually the status code seems to be a bit disappointing in general.
> It would be easiest if it just had a returning url property
>
> cheers
> dn
>
>
> On Sep 18, 2:12 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> > Ick, don't check the content. That's very ugly. You could always return
> JSON
> > objects that include status information, or better yet, use HTTP status
> > codes.
> >
> > I'll provide an example in a new thread.
> >
> > --Erik
> >
> > On 9/18/07, dougXN <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > We have a website that requires login. When we go to the site, if the
> > > login has expired we get a screen that logs us in, then redirects us
> > > to our initial request.
> >
> > > The problem is that if the request is a jquery/ajax .load(,
> > > 'mydiv'), it does not go into the div it justs loaded the whole bloody
> > > page into the window, thus ruining the page setup.
> >
> > > I think the answer is to check the returning page source and then
> > > either reload the page or continue depending if I am logged on or not.
> >
> > > Anyone have any ideas how to accomplish this in a jquery sort of way?
> >
> > > thanks
> > > dn
>
>


[jQuery] Re: get all checkboxes

2007-09-19 Thread seedy


if you know the 'my_' is always at the start of the id this might be a bit
faster

$("input[id^='my_']:checkbox")


Glen Lipka wrote:
> 
> Try $("input[id*='my_']:checkbox")
> I havent tested this, but it should work.
> 
> Glen
> 
> On 9/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> Hello,
>>
>> is it possible in prototype to get all checkboxes on a page with a fixed
>> id namepart like this:
>>
>> ID="my_checkbox"
>>
>> and i want to get all checkboxes beginning on "my_"
>>
>> 
>> Virus checked by G DATA AntiVirusKit
>> Version: AVK 17.7901 from 19.09.2007
>> Virus news: www.antiviruslab.com
>>
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/get-all-checkboxes-tf4481356s15494.html#a12785057
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] jQuery UI - How do I get the X and Y of the DROP div

2007-09-19 Thread Frank Peterson

I'm using the example at:
http://docs.jquery.com/UI/Droppables

and I have the BLOCK dragging and able to drop it, but I want the
BLOCK to take the X and Y position of the DROP div, I'm not sure how
to find that out

Also what are the ev, ui in the drop: function? Will UI give me the
actual DROP div incase i have more than 1?



[jQuery] Re: get all checkboxes

2007-09-19 Thread Trans



On Sep 19, 4:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> is it possible in prototype to get all checkboxes on a page with a fixed
> id namepart like this:
>
> ID="my_checkbox"
>
> and i want to get all checkboxes beginning on "my_"

I'm having a similar issue. I used:

var videos_checkboxes = $('[EMAIL PROTECTED]');

That seems to work, however I can't seem to use it. I have:

var videos = [];
var videos_checkboxes = $('[EMAIL PROTECTED]');

alert( videos_checkboxes.size() );  // returns 3 like I expect

   // But this only iterates over 1 element and it is not a jQuery
object.

$('[EMAIL PROTECTED]').each(function(i, e) {
  alert(e); // [object HtmlInputElement]  (why?)
  videos.push(e.val());  // Error
});

What am I doing wrong? I'm trying to collect all the value attributes
of the selected checkboxes.

T.




[jQuery] Re: Jquery in the BBB

2007-09-19 Thread John Resig

That's exciting! Are there any URLs where we can see the results, when
they launch?

--John

On 9/19/07, Anthony Leboeuf(Worcester Wide Web)
<[EMAIL PROTECTED]> wrote:
>
> I'm doing the  back end programming for the new BBB websites launching
> at the beginning of next month, they are rocking Jquery all the way!
>
> They are using interface, roundbox, slider
>
>
>


[jQuery] Re: ScrollTo

2007-09-19 Thread John Resig

jQuery has scrollTo built straight into core:

$("html,body").animate({ scrollTop: 400 });

or to scroll to a specific element, do:

$("html,body").animate({ scrollTop: $("#elem").offset().top });

More info and demo:
http://www.learningjquery.com/2007/09/animated-scrolling-with-jquery-12

--John

On 9/19/07, Idowatiwant <[EMAIL PROTECTED]> wrote:
>
> We need a scrollTo function like mooTools, the one.. interface
> elements has sucks, plus theirs an unfixed bug in it! something about
> jQuery.dequeue isn't a function.
>
> But please consider this, it's needed! Lol
>
>


[jQuery] Re: validation - multiple errorPlacements

2007-09-19 Thread seedy


ok now a follow up question

I have 3 text boxes that make up a telephone number.  I want validation to
fail if any of the text boxes are not complete, but I only want to show one
message for the failure, not one per textbox.  Any recommended ways of doing
this?



Jörn Zaefferer wrote:
> 
> 
> seedy schrieb:
>> Is it possible to use errorPlacement with the validation plugin to have a
>> different placement for each field validated?
>>
>> ie.
>> $('#testForm').validate({
>>  rules:{
>>  firstname:{required:true},
>>  integer:{required:true}
>>  }
>> })
>>
>> I would like to have the error for firstname appended to $('#div1') , and
>> errors for integer before $('#div2')
>>   
> You can use the errorPlacement option for that. Its far from perfect, 
> but allows you to do every placement you can think of.
> 
> One example of the usage of errorPlacement can be found here: 
> http://dev.jquery.com/view/trunk/plugins/validate/demo-test/milk/
> The interesting part:
> 
> |// the errorPlacement has to take the table layout into account 
> errorPlacement: function(error, element) { 
> if ( element.is(":radio") ) 
> error.appendTo( element.parent().next().next() ); 
> else if ( element.is(":checkbox") ) 
> error.appendTo ( element.next() ); 
> else 
> error.appendTo( element.parent().next() ); 
> }, 
> |
> 
> -- Jörn
> 
> 

-- 
View this message in context: 
http://www.nabble.com/validation---multiple-errorPlacements-tf4482247s15494.html#a12784330
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: ScrollTo

2007-09-19 Thread Benjamin Sterling
Yup, the dimensions plugin has scrollTop and scrollLeft:
http://brandonaaron.net/docs/dimensions/#sample-3

On 9/19/07, Benjamin Sterling <[EMAIL PROTECTED]> wrote:
>
> Um.. I do believe the dimensions plugin has this and has had it.  I could
> be wrong.
>
> On 9/19/07, Idowatiwant < [EMAIL PROTECTED]> wrote:
> >
> >
> > We need a scrollTo function like mooTools, the one.. interface
> > elements has sucks, plus theirs an unfixed bug in it! something about
> > jQuery.dequeue isn't a function.
> >
> > But please consider this, it's needed! Lol
> >
> >
>
>
> --
> Benjamin Sterling
> http://www.KenzoMedia.com
> http://www.KenzoHosting.com




-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Re: ScrollTo

2007-09-19 Thread Benjamin Sterling
Um.. I do believe the dimensions plugin has this and has had it.  I could be
wrong.

On 9/19/07, Idowatiwant <[EMAIL PROTECTED]> wrote:
>
>
> We need a scrollTo function like mooTools, the one.. interface
> elements has sucks, plus theirs an unfixed bug in it! something about
> jQuery.dequeue isn't a function.
>
> But please consider this, it's needed! Lol
>
>


-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Jquery in the BBB

2007-09-19 Thread Anthony Leboeuf(Worcester Wide Web)


I'm doing the  back end programming for the new BBB websites launching 
at the beginning of next month, they are rocking Jquery all the way!


They are using interface, roundbox, slider




[jQuery] Re: jQuery UI

2007-09-19 Thread Erik Beeson
The demos on the main UI page show an example that uses grid:

http://ui.jquery.com/

It's also available here:

http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.draggable.html

--Erik


On 9/19/07, Frank Peterson <[EMAIL PROTECTED]> wrote:
>
>
> Draggable for the UI has options, like GRID but there are no examples
> on how to use these options.
>
> Anyone know how?
>
>


[jQuery] jQuery UI

2007-09-19 Thread Frank Peterson

Draggable for the UI has options, like GRID but there are no examples
on how to use these options.

Anyone know how?



[jQuery] Re: $.load() javascript problems in IE and Safari

2007-09-19 Thread Bryan Blakey

Jim, that info was extremely helpful.  I also noticed that $.load
calls .html which calls .append which in turn calls domManip, but
couldn't figure out why it still wasn't evaluating my scripts, and
therefore added the evalScripts back in.  The fact that script tags
have to be at the top level is something that I missed entirely.
Thanks for the pointer!

On Sep 14, 1:23 pm, Jim Marion <[EMAIL PROTECTED]> wrote:
> I did some looking at the code. The $.loadin 1.1.4 and 1.2 actually
> does eval scripts onIEwithout adding evalScripts back into the lib.
> The eval is in the domManip. It looks like $.loadcalls .html which
> calls .append. append calls domManip. The only problem is that the
> code doesn't do a deep search for script tags inIE. Therefore, forIE, you 
> script tags have to be at the top level. They don't appear to
> get evaluated if they are buried deeper in the document.
>
> On Sep 11, 10:03 am, Jolyon Terwilliger <[EMAIL PROTECTED]> wrote:
>
> > Check out the revisions made to .load() and the new getScript feature
> > of 1.2:  http://docs.jquery.com/Release:jQuery_1.2/Ajax
>
> > These may help you solve your problems!
>
> > peace,
>
> > Jt
>
> > On Sep 11, 3:05 am, Stamen Georgiev <[EMAIL PROTECTED]> wrote:
>
> > > I'm having the same problems here.
> > > And it looks the same with the latest release (1.2) :-(
>
> > > Help, anyone?
>
> > > On Sep 10, 7:26 pm, Bryan Blakey <[EMAIL PROTECTED]> wrote:
>
> > > > As many others have already noted, if your page makes anAJAXcall
> > > > that returnsjavascriptand HTML, for some reasonIEandSafariare
> > > > unwilling to execute any of thejavascript.  Looking through the
> > > > jQuery code, I noticed that there *used* to be an evalScripts function
> > > > in the same object as theloadfunction, but that is deprecated in
> > > > light of the fact that there is now a globalEval function that should
> > > > be called with certain of the the HTML injection methods.  However,
> > > > after numerous tests, it seems that this wasn't working all the time
> > > > in eitherSafariorIE.  I dediced to add the evalScripts function
> > > > back in like so:
>
> > > > evalScripts: function( self ){
> > > > var scripts = self.get(0).getElementsByTagName( 
> > > > 'script' );
> > > > $(scripts).each(function(){
> > > > if ( window.execScript ) {
> > > > window.execScript( $(this).html() );
> > > > }
> > > > else if ( jQuery.browser.safari) {
> > > > window.setTimeout( $(this).html(), 0 );
> > > > }
> > > > else {
> > > >eval.call( window, $(this).html() );
> > > > }
> > > > });
> > > > }
>
> > > > This gets called byloadif the oncomplete status is "success" with:
>
> > > > self.evalScripts( self );
>
> > > > Can anyone tell me if this is a bad idea (and if so, why?) as well as
> > > > any insights into why the built in globalEval function doesn't always
> > > > work inIEorSafari?



[jQuery] Re: Treeview navigation highlighting?

2007-09-19 Thread Joan Piedra
lol, I love localhost

On 9/19/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
>
>
> Jörn Zaefferer schrieb:
> >
> > sgrover schrieb:
> >> I'm using the Treeview library from
> >> http://bassistance.de/jquery-plugins/jquery-plugin-treeview/, with
> >> jQuery 1.1.4.  All is going well except for one tiny point.
> >>
> >> We're using the tree to list navigation structure.  When choosing a
> >> page, we need to load the selected page and have the corresponding
> >> tree node display (expanded), and have that node indicated as the
> >> current element.
> >>
> >> The treeview doesn't seem to handle this (nor the one in the SVN
> >> repository).  Am I just missing something, or will I need to write
> >> some custom code?  Is there some existing code/plugin/etc. to do
> >> this?  I can't imagine I'm the first to be looking at this...
> >>
> > Please give this demo a try: http://localhost/plugins/treeview/
> Sorry, of course I meant this one:
> http://dev.jquery.com/view/trunk/plugins/treeview/
>
> -- Jörn
>



-- 
Joan Piedra  ||  Frontend web developer
http://www.justaquit.com/  ||  http://www.joanpiedra.com/


[jQuery] ScrollTo

2007-09-19 Thread Idowatiwant

We need a scrollTo function like mooTools, the one.. interface
elements has sucks, plus theirs an unfixed bug in it! something about
jQuery.dequeue isn't a function.

But please consider this, it's needed! Lol



[jQuery] Re: validation - multiple errorPlacements

2007-09-19 Thread seedy


wow I hadn't considered using an if to check the id of the element.  Feeling
really dumb right now.  Thanks!


Jörn Zaefferer wrote:
> 
> 
> seedy schrieb:
>> Is it possible to use errorPlacement with the validation plugin to have a
>> different placement for each field validated?
>>
>> ie.
>> $('#testForm').validate({
>>  rules:{
>>  firstname:{required:true},
>>  integer:{required:true}
>>  }
>> })
>>
>> I would like to have the error for firstname appended to $('#div1') , and
>> errors for integer before $('#div2')
>>   
> You can use the errorPlacement option for that. Its far from perfect, 
> but allows you to do every placement you can think of.
> 
> One example of the usage of errorPlacement can be found here: 
> http://dev.jquery.com/view/trunk/plugins/validate/demo-test/milk/
> The interesting part:
> 
> |// the errorPlacement has to take the table layout into account 
> errorPlacement: function(error, element) { 
> if ( element.is(":radio") ) 
> error.appendTo( element.parent().next().next() ); 
> else if ( element.is(":checkbox") ) 
> error.appendTo ( element.next() ); 
> else 
> error.appendTo( element.parent().next() ); 
> }, 
> |
> 
> -- Jörn
> 
> 

-- 
View this message in context: 
http://www.nabble.com/validation---multiple-errorPlacements-tf4482247s15494.html#a12783968
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] OT: PHP to read jQuery API XML

2007-09-19 Thread Glen Lipka
I am working on an API Browser.
Rather than transform the whole XML structure on the client-side, I am using
PHP to get and return only the parts I need.
I am hoping this is a speed improvement.

What I have so far is:
http://www.commadot.com/jquery/experiments/api/xmlReader.txt (code)
http://www.commadot.com/jquery/experiments/api/xmlReader.php (results)

I will have to make more nested foreach loops to get grandchildren and
great-grandchildren.
This seems like a horrible pattern.

Is there a better way on the server-side to do this?  Any code samples or
demos would be awesome. :)

jQuery is so easy.  PHP is not. (for me)

Glen


[jQuery] Re: Opinions on YUI?

2007-09-19 Thread Stuart

Yeah! what Jorn said! I love both jQuery and Ext but wouldn't it be
fantastic to have Ext's widgets, panels, etc all with jQuery's syntax?

On Sep 19, 1:28 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Brian Miller schrieb:> Hopefully, people are open-minded, and willing to mash 
> up 2-3 different
> > libraries.
>
> I'm mashing Ext and jQuery at work. So far there is no equivalent
> jQuery-based component to replace Ext's grid and tree components. And
> jQuery helps a lot to fill all the gaps that Ext doesn't handle, like
> executing scripts in pages (eg. tabs) loaded via AJAX. I also never
> bothered learning DomQuery, instead I'm using jQuery to select elements
> and pass them to Ext as plain DOM elements.
>
> A lot of times I wish that Ext would have been built upon jQuery. That'd
> be much more fun.
>
> -- Jörn



[jQuery] Re: How to return a click event from the container function

2007-09-19 Thread Erik Beeson
For that to happen, showDialog would have to block until the dialog was
closed, and that's not how JavaScript works. To do what you want, pass a
callback function to showDialog and call it on close. Something like this
(untested):

this.showDialog = function(msg, buttons, onHide) {
   $('#inline_dialog').show().swapDepths();
   var buttons = (buttons) || '';
   $('#' + self.window_id).floatWinSetContent({content:msg + buttons,
title:''});
   $('#inline_alert_close_button').click(function() {
 $('#inline_dialog').hide();
 if($.isFunction(onHide)) onHide.call(/* whatever you want 'this' to be
in your callback, maybe $('#inline_dialog') */);
 return false;
   });
}

Also, you might consider caching $('#inline_dialog') in a local variable,
since you call it a lot. Lastly, it's good form to include a semicolon after
the last } since it's technically an assignment, so one should be there.
It'll help save you from potential problems down the road.

Good luck with it.

--Erik


On 9/19/07, Skilip <[EMAIL PROTECTED]> wrote:
>
> Hi, I'm currently working on a function which shows a inline dialog,
> so I can use html in the dialog box. In the dialogbox I've put a
> button to close the dialog box. If the button is clicked I want the
> function showDialog() to return a value. The problem is that it's out
> of the scope when I'm in the click() function. It there a solution?
>
>   this.showDialog = function(msg, buttons) {
> $('#inline_dialog').show().swapDepths();
> var buttons = (buttons) || ' id="inline_alert_close_button">';
> $('#' + self.window_id).floatWinSetContent({content:msg + buttons,
> title:''});
> $('#inline_alert_close_button').click(function() {
>   $('#inline_dialog').hide();
>   return false;
> });
>   }
>
>


[jQuery] Re: validation - multiple errorPlacements

2007-09-19 Thread Jörn Zaefferer


seedy schrieb:

Is it possible to use errorPlacement with the validation plugin to have a
different placement for each field validated?

ie.
$('#testForm').validate({
rules:{
firstname:{required:true},
integer:{required:true}
}
})

I would like to have the error for firstname appended to $('#div1') , and
errors for integer before $('#div2')
  
You can use the errorPlacement option for that. Its far from perfect, 
but allows you to do every placement you can think of.


One example of the usage of errorPlacement can be found here: 
http://dev.jquery.com/view/trunk/plugins/validate/demo-test/milk/

The interesting part:

|// the errorPlacement has to take the table layout into account 
   errorPlacement: function(error, element) { 
   if ( element.is(":radio") ) 
   error.appendTo( element.parent().next().next() ); 
   else if ( element.is(":checkbox") ) 
   error.appendTo ( element.next() ); 
   else 
   error.appendTo( element.parent().next() ); 
   }, 
|


-- Jörn


[jQuery] Re: Opinions on YUI?

2007-09-19 Thread Jörn Zaefferer


Brian Miller schrieb:

Hopefully, people are open-minded, and willing to mash up 2-3 different
libraries.
  
I'm mashing Ext and jQuery at work. So far there is no equivalent 
jQuery-based component to replace Ext's grid and tree components. And 
jQuery helps a lot to fill all the gaps that Ext doesn't handle, like 
executing scripts in pages (eg. tabs) loaded via AJAX. I also never 
bothered learning DomQuery, instead I'm using jQuery to select elements 
and pass them to Ext as plain DOM elements.


A lot of times I wish that Ext would have been built upon jQuery. That'd 
be much more fun.


-- Jörn


[jQuery] Re: Treeview navigation highlighting?

2007-09-19 Thread Jörn Zaefferer


Jörn Zaefferer schrieb:


sgrover schrieb:
I'm using the Treeview library from 
http://bassistance.de/jquery-plugins/jquery-plugin-treeview/, with 
jQuery 1.1.4.  All is going well except for one tiny point.


We're using the tree to list navigation structure.  When choosing a 
page, we need to load the selected page and have the corresponding 
tree node display (expanded), and have that node indicated as the 
current element.


The treeview doesn't seem to handle this (nor the one in the SVN 
repository).  Am I just missing something, or will I need to write 
some custom code?  Is there some existing code/plugin/etc. to do 
this?  I can't imagine I'm the first to be looking at this...
  

Please give this demo a try: http://localhost/plugins/treeview/
Sorry, of course I meant this one: 
http://dev.jquery.com/view/trunk/plugins/treeview/


-- Jörn


[jQuery] Re: Treeview navigation highlighting?

2007-09-19 Thread Jörn Zaefferer


sgrover schrieb:
I'm using the Treeview library from 
http://bassistance.de/jquery-plugins/jquery-plugin-treeview/, with 
jQuery 1.1.4.  All is going well except for one tiny point.


We're using the tree to list navigation structure.  When choosing a 
page, we need to load the selected page and have the corresponding tree 
node display (expanded), and have that node indicated as the current 
element.


The treeview doesn't seem to handle this (nor the one in the SVN 
repository).  Am I just missing something, or will I need to write some 
custom code?  Is there some existing code/plugin/etc. to do this?  I 
can't imagine I'm the first to be looking at this...
  

Please give this demo a try: http://localhost/plugins/treeview/

I modded the stylesheet a bit to make the selected-highlighting more 
obvious.


-- Jörn


[jQuery] Re: contains() with a jquery object reference (form field)

2007-09-19 Thread Karl Swedberg

Not sure, but maybe like this ...

$("#sqltable tr td:contains(" + $('#workgroup').val() +  
")").toggleClass("highlight");



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



On Sep 19, 2007, at 2:03 PM, Graeme B. Davis wrote:



I'm trying to highlight some rows of a table, and previously did  
this with

the following code:

$('#sqltable').find('td').contains($('#workgroup').val 
()).toggleClass("highl

ight");

The new code:

$("#sqltable tr td:contains(TEXT TO SEARCH FOR
HERE)").toggleClass("highlight");

How do I specify $('#workgroup').val() for the text to search for,  
like the

first example?

Thanks in advance It's just not clear to me... I've also tried
.filter(':contains($('#workgroup').val())')

Graeme





[jQuery] Re: contains() with a jquery object reference (form field)

2007-09-19 Thread John Resig

Like so:

$("#sqltable tr td:contains(" + $('#workgroup').val() +
")").toggleClass("highlight");

--John

On 9/19/07, Graeme B. Davis <[EMAIL PROTECTED]> wrote:
>
> I'm trying to highlight some rows of a table, and previously did this with
> the following code:
>
> $('#sqltable').find('td').contains($('#workgroup').val()).toggleClass("highl
> ight");
>
> The new code:
>
> $("#sqltable tr td:contains(TEXT TO SEARCH FOR
> HERE)").toggleClass("highlight");
>
> How do I specify $('#workgroup').val() for the text to search for, like the
> first example?
>
> Thanks in advance It's just not clear to me... I've also tried
> .filter(':contains($('#workgroup').val())')
>
> Graeme
>
>


[jQuery] contains() with a jquery object reference (form field)

2007-09-19 Thread Graeme B. Davis

I'm trying to highlight some rows of a table, and previously did this with
the following code:

$('#sqltable').find('td').contains($('#workgroup').val()).toggleClass("highl
ight");

The new code:

$("#sqltable tr td:contains(TEXT TO SEARCH FOR
HERE)").toggleClass("highlight");

How do I specify $('#workgroup').val() for the text to search for, like the
first example?

Thanks in advance It's just not clear to me... I've also tried
.filter(':contains($('#workgroup').val())')

Graeme



[jQuery] Re: [SITE SUBMISSION] wo2do.com

2007-09-19 Thread Michael Stuhr


Rey Bango schrieb:

Jonah at 64squar.es sent me this one:

http://wo2do.com/

An online community for sharing and caring about things to do around the 
world.




they need a new google-api-key :-)

micha


[jQuery] [SITE SUBMISSION] wo2do.com

2007-09-19 Thread Rey Bango


Jonah at 64squar.es sent me this one:

http://wo2do.com/

An online community for sharing and caring about things to do around the 
world.




[jQuery] Re: PERFORMANCE TIP: removeClass()

2007-09-19 Thread Jonathan Sharp
Here's a rough outline of the code/style in question.

My plugin will position an element in one of 16 predefined locations and add
a css class pertaining to that location (eg. location1). It knows nothing
about the element it's positioning. When it adds the location css class it
first has to remove any existing location classes (16 total) as an element
could have been previously positioned. The location css classes have no
style but are used as selectors for an element.

.location0 img.foo {
left: 0px;
}
.location1 img.foo {
left: 10px;
}

The final code in question is along the lines of:
$(element).removeClass('location0 location1 ...
location15').addClass('location' + n);

-js



On 9/19/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
>  I might argue that if you're having to add/remove 15 classes, that your
> time could be better spent optimizing your display code.
>
>
> andy
>
>  --
> *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Jonathan Sharp
> *Sent:* Wednesday, September 19, 2007 11:55 AM
> *To:* jquery-en@googlegroups.com
> *Subject:* [jQuery] PERFORMANCE TIP: removeClass()
>
>
>  *Do not do:*
> $(...).removeClass('a').removeClass('b').removeClass('c');
>
> *Instead do:*
> $(...).removeClass('a b c');
>
> Same applys to addClass()
>
> I had 15 classes I had to remove and Firefox was a champ at chained
> removeClass calls, IE was taking 760ms!
>
> -js
>


[jQuery] Re: PERFORMANCE TIP: removeClass()

2007-09-19 Thread Karl Swedberg

On Sep 19, 2007, at 1:31 PM, Stephan Beal wrote:


On Sep 19, 6:55 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:

I had 15 classes I had to remove and Firefox was a champ at chained
removeClass calls, IE was taking 760ms!


If i'm not mistaken, IE takes so long in that case because it has to
email the results of each function call to Microsoft for approval.



Stephan,

That's the funniest thing I've read on this list in a long time.  
thanks for brightening my day. :-)



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






[jQuery] Re: PERFORMANCE TIP: removeClass()

2007-09-19 Thread Andy Matthews

On Vista at least. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Stephan Beal
Sent: Wednesday, September 19, 2007 12:31 PM
To: jQuery (English)
Subject: [jQuery] Re: PERFORMANCE TIP: removeClass()


On Sep 19, 6:55 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> I had 15 classes I had to remove and Firefox was a champ at chained 
> removeClass calls, IE was taking 760ms!

If i'm not mistaken, IE takes so long in that case because it has to email
the results of each function call to Microsoft for approval.




[jQuery] Re: PERFORMANCE TIP: removeClass()

2007-09-19 Thread Andy Matthews
I might argue that if you're having to add/remove 15 classes, that your time
could be better spent optimizing your display code.
 
 
andy

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jonathan Sharp
Sent: Wednesday, September 19, 2007 11:55 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] PERFORMANCE TIP: removeClass()


Do not do:
$(...).removeClass('a').removeClass('b').removeClass('c');
 
Instead do:
$(...).removeClass('a b c');
 
Same applys to addClass()
 
I had 15 classes I had to remove and Firefox was a champ at chained
removeClass calls, IE was taking 760ms!
 
-js


[jQuery] Re: PERFORMANCE TIP: removeClass()

2007-09-19 Thread Gordon

Good rule of thumb in all programming is to keep function calls to a
minimum.  Chaining is a powerful jQuery feature but it's also
expensive even in script engines that aren't as utterly awful as
IE's.  This is a prime example.

Another tip that's pertinent to Javascript and jQuery is DOM access is
SLOW!  Avoid it unless absolutely necessary.  In this case you're
adding and removing classes.  Do these classes have an impact on the
element's appearance or are they simply being used to store state?  If
it's the latter case then store all the state in an array or object
instead as you can access it far more quickly than you can DOM props.

On Sep 19, 5:55 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> *Do not do:*
> $(...).removeClass('a').removeClass('b').removeClass('c');
>
> *Instead do:*
> $(...).removeClass('a b c');
>
> Same applys to addClass()
>
> I had 15 classes I had to remove and Firefox was a champ at chained
> removeClass calls, IE was taking 760ms!
>
> -js



[jQuery] Re: Spolsky's Strategy Letter VI

2007-09-19 Thread Andy Matthews

LOL

"You could spend six months rewriting your inner loops in Assembler, or take
six months off to play drums in a rock and roll band, and in either case,
your program would run faster."


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Bil Corry
Sent: Wednesday, September 19, 2007 11:37 AM
To: jQuery List
Subject: [jQuery] Spolsky's Strategy Letter VI


This is interesting in the context of jQuery's core optimization vs. larger,
less-optimized libraries:

-
The developers who put a lot of effort into optimizing things and making
them tight and fast will wake up to discover that effort was, more or less,
wasted, or, at the very least, you could say that it "conferred no long term
competitive advantage," if you're the kind of person who talks like an
economist.


-


- Bil






[jQuery] Re: Announce: jQuery Tablesorter 2.0.1 Released

2007-09-19 Thread tlphipps

Personally I would prefer the metadata approach since I'm already
using metadata to control other tablesorter parameters.

Thanks for tackling this issue!

On Sep 19, 10:22 am, "Christian Bach" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I can take a look into this issue on Thursday.
>
> One way to solve this would either to have a option in the plugin
> constructor that would allow you to specify a row index or use the metadata
> plugin.
>
> Do you have a preferred way?
>
> /christian
>
> 2007/9/19, tlphipps <[EMAIL PROTECTED]>:
>
>
>
> > Christian, have you had a chance to look into the issue with multiple
> >  tags in a ?  I've verified that this issue still exists
> > with the 2.0.1 version of the tablesorter code.  Any help or insight
> > you could provide on this issue would be greatly appreciated.
>
> > I sent the following off-list a few weeks ago:
> > ===
> > I've setup an example page at:
> >http://www.garethphipps.com/tablesorttest/index.html
> > I've enabled debug mode for simplicity.
>
> > Just to recap:
> > This table has two  tags in the .  What is happening is
> > that the checkCellColSpan() function is not properly filling the array
> > of s in this case.  If I bypass that function and just create the
> > array of s myself, everything in the tablesorter works correctly.
> > One note: Currently the second  actually utilizes a colspan, but I
> > originally was NOT using them in either .  The issue existed
> > before I added the colspan.
>
> > As a side note, I couldn't figure out why you are passing 4 arguments
> > to the checkCellColSpan() function.  That could just be my lack of
> > JavaScript knowledge.
>
> > Also, I setup a second page with my modified tablesorter code that
> > simply bypasses the checkCellColSpan() function so you can see the
> > result I'm looking for.
> > It's:http://www.garethphipps.com/tablesorttest/index2.html
> > =
>
> > On Sep 18, 6:02 am, "Christian Bach" <[EMAIL PROTECTED]>
> > wrote:
> > > Thanks Kia, saved a few more bytes!
>
> > > Removed and updated tablesorter.com with the latest version.
>
> > > /christian
>
> > > 2007/9/18, Kia Niskavaara <[EMAIL PROTECTED]>:
>
> > > > Thanks for the update!!
>
> > > > I've noticed that you've included two almost identical sorters:
>
> > > > $.tablesorter.addParser({
> > > > id: "integer",
> > > > is: function(s) {
> > > > return s.match(new RegExp(/^\d+$/));
> > > > },
> > > > format: function(s) {
> > > > return $.tablesorter.formatInt(s);
> > > > },
> > > > type: "numeric"
> > > > });
>
> > > > $.tablesorter.addParser({
> > > > id: "integer",
> > > > is: function(s) {
> > > > return /^\d+$/.test(s);
> > > > },
> > > > format: function(s) {
> > > > return $.tablesorter.formatFloat(s);
> > > > },
> > > > type: "numeric"
> > > > });
>
> > > > Christian Bach wrote:
> > > > > Hi list!
>
> > > > > Just uploaded the new version of tablesorter that works with the 1.2
> > > > > release of jQuery.
>
> > > > > Here are the main changes in version tablesorter 2.0.1
>
> > > > > General
> > > > > * Removed the need for Dimensions plugin when using the pagination
> > > > > plugin thanks to offset being included in the jQuery 1.2 core.
> > > > > * Added support for jQuery 1.2
> > > > > * Added new Minified version of tablesorter
> > > > > * Updated documenation and website with new examples
>
> > > > > Bug fixes
> > > > > * If row values are identical the original order is kept (Thanks to
> > > > > David hull)
> > > > > * If thead includes a table $('tbody:first', table) breaks (Thanks
> > to
> > > > > David Hull)
>
> > > > > Speed improvements:
> > > > > * appendToTable, setting innerHTML to "" before appending new
> > content to
> > > > > table body.
> > > > > * zebra widget. (Thanks to James Dempster)
>
> > > > > Get it all athttp://tablesorter.com
>
> > > > > Enjoy!
>
> > > > > /christian



[jQuery] Re: PERFORMANCE TIP: removeClass()

2007-09-19 Thread Stephan Beal

On Sep 19, 6:55 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> I had 15 classes I had to remove and Firefox was a champ at chained
> removeClass calls, IE was taking 760ms!

If i'm not mistaken, IE takes so long in that case because it has to
email the results of each function call to Microsoft for approval.



[jQuery] Re: Localization and using JQuery

2007-09-19 Thread Andy Martone

Yes, you can use jQuery to select nodes out of an XML document as you
would out of the HTML DOM.  We are using a similar technique for
client-side i18n in our application.

$("SomeNode", someDoc) returns all the SomeNode elements inside
someDoc.

You may find the XPath plugin to be helpful to navigate the XML DOM:
http://jquery.com/plugins/project/xpath

However, you won't be able to use .text() to update an XML document in
IE or Firefox 3 until this ticket is fixed: http://dev.jquery.com/ticket/1419

On Sep 19, 8:36 am, daSMC <[EMAIL PROTECTED]> wrote:
> Hi Ya'll I am just about to start using Jquery this morning to open an
> xml file and find a tag and its contents.
> We are trying to NOT use a server side language (asp/php etc).
>
> This can be done right?
>
> On Sep 18, 3:14 pm, daSMC <[EMAIL PROTECTED]> wrote:
>
> > I have an idea to get a mockup of a new site working in 2 languages
> > WITHOUT being connected to a relational database. So my idea is to
> > have an xml file with custom tags, a version for the English language
> > and a version with the Japanese language.
>
> > Can I use JQuery to traverse an xml document in the same directory and
> > find the custom tag, grab the innertext and replace it in the html (or
> > add it)?
>
> > Can I get some sample code?
>
> > Would this be too slow for production but good for a mockup site?
>
> > Here is an example of the xml data.
>
> > 
>
> > 
> > 
>
> > 
> > Home
> > Login
> > Order Tracking
> > My Parts List
> > Contact
> > Help
> > Your Account
>
> > About Us
>
> > US Locations
> > Worldwide
> > Product Overview
> > Trade Shows
> > Education & Training
> > Career Opportunities
> > Financials
> > SMC History
> > Order Tracking
>
> > Actuators
> > Valves & Manifolds
> > Airline Equipment
> > Fittings & Tubing
> > Instrumentation
> > Autoswitches
> > Electric
> > High Purity
> > Accessories
>
> > 
> > SMC is the world's largest manufacturer of pneumatic
> > automation products.
> > 
>
> > 
> > Search
> > Search term or part 
> > #
> > http://www.lljsdfljsdfljsdljsj > modSearchSubmitBtn>
> > 
>
> > 
> > New SMC 
> > Products
> > Series ZSE80/ISE80 - 2-Color 
> > Display > modNewSMCProductsProd1Link>
> > Stainless diaphragm, Oil-free 
> > (Single-
> > layor diaphragm structure) 3-step setting
> > http://www.lljsdfljsdfljsdljsj > modNewSMCProductsProd1Img>
>
> > Series ZSE80/ISE80 - 2-Color 
> > Display > modNewSMCProductsProd2Link>
> > Stainless diaphragm, Oil-free 
> > (Single-
> > layor diaphragm structure) 3-step setting
> > http://www.lljsdfljsdfljsdljsj > modNewSMCProductsProd2Img>
> > 
>
> > 
> > Trade Show 
> > Information
> > Pack Expo
> > Las Vegas, NV Sept, 
> > 26-29
> > Assembly Technology 
> > Show
> > Rosemont, IL Sept, 
> > 27-29
> > Worldwide Food 
> > Expo
> > Chicago, IL Oct. 
> > 26-29
> > More Trade Show Information > modTradeShowBottomLink>
> > 
>
> > 
> > News & Events
> > August 16, 2007
> > , Products for Wash-Down Applications > modNewsEvents1Text>
> > August 16, 2007
> > , Products for Wash-Down Applications > modNewsEvents2Text>
> > 
>
> > 
> > New SMC Products > modFeaturedSMCProductsTitle>
> > Series ZSE80/ISE80 - 
> > 2-Color
> > Display
> > Stainless diaphragm, 
> > Oil-free
> > (Single-layor diaphragm structure) 3-step setting > modFeaturedSMCProductsProd1Text>
> > 
> > http://www.lljsdfljsdfljsdljsj > modFeaturedSMCProductsProd1Img>
>
> > Series ZSE80/ISE80 - 
> > 2-Color
> > Display
> > Stainless diaphragm, 
> > Oil-free
> > (Single-layor diaphragm structure) 3-step setting > modFeaturedSMCProductsProd2Text>
> > 
> > http://www.lljsdfljsdfljsdljsj > modFeaturedSMCProductsProd2Img>
> > 
>
> > 
> > Projects & 
> > Parts
> > http://www.lljsdfljsdfljsdljsj > modProjectsPartsAddBtn>
> > Manage Projects & Parts > modProjectsPartsBottomLink>
> > 
>
> > 
> > Branches & Distributors > modBranchesDistributorsTitle>
> > In the United States > modBranchesDistributorsText>
> > Enter your > modBranchesDistributorsZipText>
> > Zip Code > modBranchesDistributorsZipInputBox>
> > 
> > http://www.lljsdfljsdfljsdljs

[jQuery] Re: PERFORMANCE TIP: removeClass()

2007-09-19 Thread Jonathan Sharp
I'm not sure how it compares but the case I'm talking about isn't simply
removing all classes. I'm removing a subset of the classes and I don't
arbitrarily know what other classes may be on the element.

-js



On 9/19/07, seedy <[EMAIL PROTECTED]> wrote:
>
>
>
> just curious how would that compare to
> $(...).attr('class','');
>
>
> Jonathan Sharp-2 wrote:
> >
> > *Do not do:*
> > $(...).removeClass('a').removeClass('b').removeClass('c');
> >
> > *Instead do:*
> > $(...).removeClass('a b c');
> >
> > Same applys to addClass()
> >
> > I had 15 classes I had to remove and Firefox was a champ at chained
> > removeClass calls, IE was taking 760ms!
> >
> > -js
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/PERFORMANCE-TIP%3A-removeClass%28%29-tf4482293s15494.html#a12781851
> Sent from the JQuery mailing list archive at Nabble.com.
>
>


[jQuery] Re: Toggle working, but 2 clicks are needed ... (noob question?)

2007-09-19 Thread Fanck

Thanks.
Indeed it worked fine, and you're way is much more clean ^^

On 19 sep, 17:44, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> I usually avoid putting onClick events in the html and do it all in the JS.
>
> Like
> $("span.control a).toggle(function(){
>   $(this).addClass("selected");},function(){
>
>   $(this).removeClass("selected");
>
> });
>
> Check out this demo of a similar 
> thing.http://www.commadot.com/jquery/slideMenu.php
>
> I change the handle image too.
>
> Glen



[jQuery] Re: [SITE SUBMISSION] Google Code

2007-09-19 Thread polyrhythmic

Totally sweet.

Charles



[jQuery] Re: PERFORMANCE TIP: removeClass()

2007-09-19 Thread seedy


just curious how would that compare to
$(...).attr('class','');


Jonathan Sharp-2 wrote:
> 
> *Do not do:*
> $(...).removeClass('a').removeClass('b').removeClass('c');
> 
> *Instead do:*
> $(...).removeClass('a b c');
> 
> Same applys to addClass()
> 
> I had 15 classes I had to remove and Firefox was a champ at chained
> removeClass calls, IE was taking 760ms!
> 
> -js
> 
> 

-- 
View this message in context: 
http://www.nabble.com/PERFORMANCE-TIP%3A-removeClass%28%29-tf4482293s15494.html#a12781851
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] validation - multiple errorPlacements

2007-09-19 Thread seedy


Is it possible to use errorPlacement with the validation plugin to have a
different placement for each field validated?

ie.
$('#testForm').validate({
rules:{
firstname:{required:true},
integer:{required:true}
}
})

I would like to have the error for firstname appended to $('#div1') , and
errors for integer before $('#div2')



-- 
View this message in context: 
http://www.nabble.com/validation---multiple-errorPlacements-tf4482247s15494.html#a12781506
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] PERFORMANCE TIP: removeClass()

2007-09-19 Thread Jonathan Sharp
*Do not do:*
$(...).removeClass('a').removeClass('b').removeClass('c');

*Instead do:*
$(...).removeClass('a b c');

Same applys to addClass()

I had 15 classes I had to remove and Firefox was a champ at chained
removeClass calls, IE was taking 760ms!

-js


[jQuery] Re: Spolsky's Strategy Letter VI

2007-09-19 Thread Josh Nathanson


Well, I might wake up in five years and decide that I can use a 1MB library, 
but when I woke up this morning, I was glad I'm using 25K jQuery.  And not 
only because it's optimized for small footprint, but also because it's easy 
to use.


-- Josh

- Original Message - 
From: "Bil Corry" <[EMAIL PROTECTED]>

To: "jQuery List" 
Sent: Wednesday, September 19, 2007 9:37 AM
Subject: [jQuery] Spolsky's Strategy Letter VI



This is interesting in the context of jQuery's core optimization vs. larger, 
less-optimized libraries:


-
The developers who put a lot of effort into optimizing things and making 
them tight and fast will wake up to discover that effort was, more or less, 
wasted, or, at the very least, you could say that it “conferred no long term 
competitive advantage,” if you’re the kind of person who talks like an 
economist.



-


- Bil




[jQuery] Bigstring's jQuery front-end

2007-09-19 Thread njsuperfreak

Hey I wanted everyone to check our site, I used jQuery and corner.js
plugin for the font-end. Thanks to all of you!
Just another fine example of what can be accomplished, with JQuery!
http://www.bigstring.com



[jQuery] Re: Spolsky's Strategy Letter VI

2007-09-19 Thread Michael Stuhr


Bil Corry schrieb:

This is interesting in the context of jQuery's core optimization vs. larger, 
less-optimized libraries:



"Assembler programmers don’t have groupies."

xcellent!

micha



[jQuery] Spolsky's Strategy Letter VI

2007-09-19 Thread Bil Corry


This is interesting in the context of jQuery's core optimization vs. larger, 
less-optimized libraries:

-
The developers who put a lot of effort into optimizing things and making them 
tight and fast will wake up to discover that effort was, more or less, wasted, 
or, at the very least, you could say that it “conferred no long term 
competitive advantage,” if you’re the kind of person who talks like an 
economist.


-


- Bil




[jQuery] Re: $.getJSON and timeouts

2007-09-19 Thread Matt
Hi Peter,

Thanks for your answer, I will try that.

Matt



2007/9/19, Peter Bengtsson <[EMAIL PROTECTED]>:
>
>
> $.getJSON() is just a wrapper on $.ajax(). The equivaqlent of
> $.ajax({url:..., dataType:'json', data:..., success:..})
>
> Try using $.ajax with that dataType instead and throw in the timeout on
> that.
>
> Matt wrote:
> > Hi guys,
> >
> > Is there any way to handle timeouts when using $.getJSON() ?
> > I tried to setup ajax "timeout" options to 2500 (2.5 sec), but as
> > getJSON does not use a XHR,
> > it seems not to work.
> >
> > Any help would be grately appreciated,
> >
> > thanks in advance,
> > Matt
> >
> >
>
> --
> Peter Bengtsson,
> work www.fry-it.com
> home www.peterbe.com
> hobby www.issuetrackerproduct.com
>



-- 
Matthias ETIENNE


[jQuery] Re: Multi-Lingual Methodology

2007-09-19 Thread Danjojo

Agreed, doing something database driven with server-side code would be
faster and the solution as we move to an enterprise readiness.

The task I have been asigned with is the mockup of a multi-lingual
site yet still portable, will run in any browser after being unzipped
into a folder. etc...

I was hoping to make it less "chatty" by firing the function on load
or init and then replacing all the text values in the beggining.

As opposed to firing the functions as the xmlVal attributes are
encountered...

Any hurdles I am going to encounter?

I mean if it loads in 10-20 seconds in a demo.. it will get the
"VALUE" across to the powers that be...

On Sep 19, 11:04 am, Peter Bengtsson <[EMAIL PROTECTED]> wrote:
> Note! It would be very very slow. Can't you just do in the server side
> software. Surely it has some I18N support built into the templating
> functionality.
>
>
>
>
>
> Danjojo wrote:
> > Can I create custom HTML attributes and have Jquery/DOM support in
> > IE6+ ?
>
> > Example:
> >  > xmlVal="topNavLinkHome">Home |  > xmlVal="topNavLinkLogin">Login
>
> > The idea here is that I would fire a function on load that would
> > traverse the entire HTML document doing a unique lookup everywhere it
> > finds the xmlVal attribute and replacing the elements text value (with
> > a foreign language). The lookup would access a separate XML document
> > for the foreign language values.
>
> > I know this is not 100% jquery based, but once I determine what I want
> > to do is possible. I plan to learn how to do it using my existing
> > jQuery library in the web application.
>
> > Advice appreciated.
>
> --
> Peter Bengtsson,
> workwww.fry-it.com
> homewww.peterbe.com
> hobbywww.issuetrackerproduct.com- Hide quoted text -
>
> - Show quoted text -



[jQuery] Browser Crash on SlideToggle (IE)

2007-09-19 Thread Sam Collett

I have a strange situation where the browser crashes when a
SlideToggle animation is applied. It happens with Internet Explorer 6
and 7. What makes it particularly odd is that it only happens for part
of the site.

Steps to reproduce:

Go to http://www.nelctp.nhs.uk
Click on Help in the bar at the top
Then click on SiteMap

The browser then becomes unresponsive. If you click on SiteMap on any
other pages (as long as they are not under /help/) this problem does
not occur and it slides down as intended.

Anyone able to replicate this or know why it is happening?



[jQuery] Presentation pointers

2007-09-19 Thread Christopher Jordan
Hi folks,

I'm going to be giving a talk to my local CFUG on jQuery, and specifically
using jQuery in conjunction with ColdFusion. I've been writing a tutorial on
my blog on this subject, but haven't finished it yet (it's a three-parter).
However, this talk looming in the future has lit a fire under my butt so I'm
all gung-ho now, and my talk will pretty much be my blog article
(completed). My problem now is that I've never given a presentation before.
I think I can do a pretty good job, but I'd like to get some pointers from
the community of folks who've given talks before.

Thanks,
Chris

-- 
http://cjordan.us


[jQuery] Re: Toggle working, but 2 clicks are needed ... (noob question?)

2007-09-19 Thread Glen Lipka
I usually avoid putting onClick events in the html and do it all in the JS.

Like
$("span.control a).toggle(function(){
  $(this).addClass("selected");
},function(){
  $(this).removeClass("selected");
});

Check out this demo of a similar thing.
http://www.commadot.com/jquery/slideMenu.php

I change the handle image too.

Glen

On 9/19/07, Fanck <[EMAIL PROTECTED]> wrote:
>
>
> hi,
> here's the code I use:
>
> 
> 
>  
>   image('nav/expand.png', array('class' =>
> 'expand'));?>
>   image('nav/reduce.png', array('class' =>
> 'reduce'));?>
>  
> 
> function toggleFnct(handle) {
> handle.parent().toggle(
>   function(){
>  $('img.expand').show();
>  $('img.reduce').hide();
>  $('#rss0').hide();
>   },
>   function(){
>  $('img.expand').hide();
>  $('img.reduce').show();
>  $('#rss0').show();
>   }
> );
> }
> 
>
> But using that I need to click twice to get it working. Anyone got an
> idea why?
> Thanks in advance
>
>


[jQuery] tablesorter pager error

2007-09-19 Thread Stoyan





Hello Christian,

The sorting does not work for me in the pager example :(

Wednesday, September 19, 2007, 6:13:37 PM, you wrote:




>


Sorry!

This is now resolved.

Thanks for the heads up!

/Christian


2007/9/19, Stoyan <[EMAIL PROTECTED]>: 
Anyone gets an error in the tablesortger pager example ?

http://tablesorter.com/docs/example-pager.html


missing ; before statement
urn false}}).mousedown(function(){if(config.cancelSelection){this.>
  
             






-- 
Best regards,
 Stoyan                            mailto:[EMAIL PROTECTED]





[jQuery] Re: adding custom attr on html elements?

2007-09-19 Thread Karl Swedberg
Brandon Aaron wrote an entry on DOM Expandos (custom attributes) a  
while back:
http://www.learningjquery.com/2007/03/selecting-elements-by- 
properties-and-dom-expandos


The examples use the XPath syntax, so in jQuery 1.2, you'll need to  
either add the XPath plugin or remove the "@" symbol.



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



On Sep 19, 2007, at 10:54 AM, Glen Lipka wrote:

I do that sort of thing all the time.  The validation not working  
bugs me, but I learn to live with it.

Glen

On 9/19/07, Benjamin Sterling <[EMAIL PROTECTED]>  
wrote:

Aljosa,
You can get away with doing that, not exactly sure if it will  
validate, but you can do what you are doing.



On 9/19/07, Aljosa Mohorovic < [EMAIL PROTECTED]> wrote:

if i have test

$("a.test").click(function() {
  arg1 = $(this).attr('arg1');
  arg2 = $(this).attr('arg2');
  // code using args
});

is this acceptable way of using attr or should i avoid this?




--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com





[jQuery] Toggle working, but 2 clicks are needed ... (noob question?)

2007-09-19 Thread Fanck

hi,
here's the code I use:



 
  image('nav/expand.png', array('class' =>
'expand'));?>
  image('nav/reduce.png', array('class' =>
'reduce'));?>
 

function toggleFnct(handle) {
handle.parent().toggle(
  function(){
 $('img.expand').show();
 $('img.reduce').hide();
 $('#rss0').hide();
  },
  function(){
 $('img.expand').hide();
 $('img.reduce').show();
 $('#rss0').show();
  }
);
}


But using that I need to click twice to get it working. Anyone got an
idea why?
Thanks in advance



[jQuery] Find: Looks simple, but isn't working as expected...

2007-09-19 Thread Jeffrey Herr

Narrative:
I'm trying to scrape a Wiki page within my company, extract the header
text only, then include that into the home page on our Intranet.
I thought: easy!  I load the Wiki page into separate DOM starting at
the Div containing the actual content, find all the 'h3' elements, and
for each one, extract the text and append to a Div on my home page.
Sounds simple, but for the life of me, I can't get things to work
right...
1) the find() isn't working.  When it's in, it finds nothing.
2) the empty() isn't working; the 'span'  is what's handed to me when
I remove the 'find()' filter.

Any ideas how to do what I'm trying to accomplish?  Less importantly,
what am I misunderstanding about the code shown below?

Thanks for the help-

Jeff

- - - - - - - - - - - - - -


{snip}
$(document).ready(function(){
$("#loadpage").empty() ;
var myDOM = new jQuery("") ;
myDOM.empty() ;

var mydata = myDOM.load("/jamwiki/en/TechTesting 
#content-
article") ;
mydata.find("h3").each(function(i) {
alert("Got one!" ) ;
$("#loadpage").append($(this)) ;
return true ;
} ) ;
});
{snip}

{snip}

Here's the Upcoming Tech Testing Events:
Testhello jeff!

- - - - - - - - - - - - - -

"load"ed document:

{snip}


[Edit]9/17 : Space check
We WILL be running a full 8 hours of trades in the Tech Test
environment, making sure that space exists.   HOWEVER, this WILL NOT
be a performance test, so you are welcome to continue development/
testing (ain't you lucky).   We will probably begin the trades at
5:30PM.


[Edit]9/18 :
NON-Performance test
We will again be running a NON-Performance test in the Tech
Test environment, particularly the Finalization processes.
{snip}
- - - - - - - - - - - - - -



[jQuery] Re: hiding/showing "more than 5 P"

2007-09-19 Thread Benjamin Sterling
My bad, change pStart to 5 to get 5 P

On 9/19/07, Benjamin Sterling <[EMAIL PROTECTED]> wrote:
>
> Just tested that and it works like a charm, hope it helps.
>
> On 9/19/07, Benjamin Sterling <[EMAIL PROTECTED] > wrote:
> >
> > Gian,
> > You can actually do more with less using the slice method, something
> > like below should do you:
> >
> > $(function(){
> > var pStart = 4;
> > $("#newswrapper p").slice(pStart).hide();
> >
> > $("a#sa").toggle(
> > function(){
> > $("#newswrapper p").slice(pStart).show();
> > },
> > function(){
> > $("#newswrapper p").slice(pStart).hide();
> > }
> > );
> > });
> >
> > This is untested, but should work.
> >
> > On 9/19/07, GianCarlo Mingati <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > Hi guys.
> > > I have a DIV with let's say 10 paragraph.
> > > I want to show just 5 paragraph on page load and let the users "view
> > > more" (news) by clicking a button, or a link.
> > > I ended up with these lines in 10 seconds but i can't made them
> > > shorter. Can you?
> > >
> > > pStart sets the nuber of elements to be showed.
> > > pTotal is the total amount of Ps
> > >
> > > when i click a#sa i toggle between two functions, one checks if the
> > > number of paragraph is less then 5 and show them. the other function
> > > in toggle do the rest.
> > >
> > > Can you shorten these lines please (if you got time) and show me a
> > > better way to do that?
> > > Thanks in advance, hope i've been clear enough.
> > > GC
> > >
> > > $(function(){
> > > var pStart = 4 //vuol dire 5 paragrafi, 0 incluso;
> > > var pTotal = $("#newswrapper p").length;
> > > doMore(pStart);
> > > $("a#sa").toggle(function(){
> > > doMore(pTotal);
> > > },function(){
> > > doLess(pStart);
> > > });
> > > function doMore(myparam){
> > > $("#newswrapper p").each(function(i) {
> > > if (i <= myparam){
> > > $(this).show("fast");
> > > }
> > > });
> > > }
> > > function doLess(myparam){
> > > $("#newswrapper p").each(function(i) {
> > > if (i > myparam){
> > > $(this).hide("fast");
> > > }
> > > });
> > > }
> > > });
> > >
> > >
> >
> >
> > --
> > Benjamin Sterling
> > http://www.KenzoMedia.com
> > http://www.KenzoHosting.com
>
>
>
>
> --
> Benjamin Sterling
> http://www.KenzoMedia.com
> http://www.KenzoHosting.com
>



-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Re: hiding/showing "more than 5 P"

2007-09-19 Thread Benjamin Sterling
Just tested that and it works like a charm, hope it helps.

On 9/19/07, Benjamin Sterling <[EMAIL PROTECTED]> wrote:
>
> Gian,
> You can actually do more with less using the slice method, something like
> below should do you:
>
> $(function(){
> var pStart = 4;
> $("#newswrapper p").slice(pStart).hide();
>
> $("a#sa").toggle(
> function(){
> $("#newswrapper p").slice(pStart).show();
> },
> function(){
> $("#newswrapper p").slice(pStart).hide();
> }
> );
> });
>
> This is untested, but should work.
>
> On 9/19/07, GianCarlo Mingati <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi guys.
> > I have a DIV with let's say 10 paragraph.
> > I want to show just 5 paragraph on page load and let the users "view
> > more" (news) by clicking a button, or a link.
> > I ended up with these lines in 10 seconds but i can't made them
> > shorter. Can you?
> >
> > pStart sets the nuber of elements to be showed.
> > pTotal is the total amount of Ps
> >
> > when i click a#sa i toggle between two functions, one checks if the
> > number of paragraph is less then 5 and show them. the other function
> > in toggle do the rest.
> >
> > Can you shorten these lines please (if you got time) and show me a
> > better way to do that?
> > Thanks in advance, hope i've been clear enough.
> > GC
> >
> > $(function(){
> > var pStart = 4 //vuol dire 5 paragrafi, 0 incluso;
> > var pTotal = $("#newswrapper p").length;
> > doMore(pStart);
> > $("a#sa").toggle(function(){
> > doMore(pTotal);
> > },function(){
> > doLess(pStart);
> > });
> > function doMore(myparam){
> > $("#newswrapper p").each(function(i) {
> > if (i <= myparam){
> > $(this).show("fast");
> > }
> > });
> > }
> > function doLess(myparam){
> > $("#newswrapper p").each(function(i) {
> > if (i > myparam){
> > $(this).hide("fast");
> > }
> > });
> > }
> > });
> >
> >
>
>
> --
> Benjamin Sterling
> http://www.KenzoMedia.com
> http://www.KenzoHosting.com




-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Re: get all checkboxes

2007-09-19 Thread Peter Bengtsson


$.grep(
  $('[EMAIL PROTECTED]"checkbox"]'),
  function(e) { return e.id.substr(0,3)=='my_'}
);

[EMAIL PROTECTED] wrote:


Hello,

is it possible in prototype to get all checkboxes on a page with a fixed 
id namepart like this:


ID="my_checkbox"

and i want to get all checkboxes beginning on "my_"


Virus checked by G DATA AntiVirusKit
Version: AVK 17.7901 from 19.09.2007
Virus news: www.antiviruslab.com





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


[jQuery] Re: hiding/showing "more than 5 P"

2007-09-19 Thread Benjamin Sterling
Gian,
You can actually do more with less using the slice method, something like
below should do you:

$(function(){
var pStart = 4;
$("#newswrapper p").slice(pStart).hide();

$("a#sa").toggle(
function(){
$("#newswrapper p").slice(pStart).show();
},
function(){
$("#newswrapper p").slice(pStart).hide();
}
);
});

This is untested, but should work.

On 9/19/07, GianCarlo Mingati <[EMAIL PROTECTED]> wrote:
>
>
> Hi guys.
> I have a DIV with let's say 10 paragraph.
> I want to show just 5 paragraph on page load and let the users "view
> more" (news) by clicking a button, or a link.
> I ended up with these lines in 10 seconds but i can't made them
> shorter. Can you?
>
> pStart sets the nuber of elements to be showed.
> pTotal is the total amount of Ps
>
> when i click a#sa i toggle between two functions, one checks if the
> number of paragraph is less then 5 and show them. the other function
> in toggle do the rest.
>
> Can you shorten these lines please (if you got time) and show me a
> better way to do that?
> Thanks in advance, hope i've been clear enough.
> GC
>
> $(function(){
> var pStart = 4 //vuol dire 5 paragrafi, 0 incluso;
> var pTotal = $("#newswrapper p").length;
> doMore(pStart);
> $("a#sa").toggle(function(){
> doMore(pTotal);
> },function(){
> doLess(pStart);
> });
> function doMore(myparam){
> $("#newswrapper p").each(function(i) {
> if (i <= myparam){
> $(this).show("fast");
> }
> });
> }
> function doLess(myparam){
> $("#newswrapper p").each(function(i) {
> if (i > myparam){
> $(this).hide("fast");
> }
> });
> }
> });
>
>


-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Re: include children of previous siblings conditionally

2007-09-19 Thread Karl Swedberg

On Sep 19, 2007, at 10:23 AM, Glen Lipka wrote:


You can use xPath to find the attribute stuff.
$("a[rel=foo]")


Yes, except that isn't XPath. ;-)  Without the "@", it's simple CSS2.1

XPath:  $('[EMAIL PROTECTED]')
CSS:$('a[rel=foo]')

Cheers,

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




Without testing at all...  :)
Maybe something like this?

$(this).previous().children("[rowspan]");



Glen

On 9/18/07, Tim <[EMAIL PROTECTED]> wrote:

Given the following as an example, does anyone know how I can
highlight cells r2c1 and r2c2 whenever row 3 is moused over? Maybe
something like, "add the children of the previous sibling to the
selection criteria only if they contain a rowspan attribute"?

http://www.tubenation.com/jquery/highlightable.html






  1   2   >