Re: [jQuery] Early Docs Prorotype

2006-08-09 Thread Clodelio Delfino
Thanks John...exploring it now c,)

cheers

John Resig wrote:
 Hi Everyone -

 I've been busy the past couple nights working on the new
 documentation. You can see it being generated on the fly here (this is
 also in SVN, rev 172 - look in the docs folder):
 http://john.jquery.com/jquery/docs/

 It's still very basic, pretty crude - and missing a couple functions
 (including the Ajax module) but it's getting there. The big feature
 that I'm going to work in next is going to be categorization by
 category - this way you can find all the methods related to DOM
 traversing (for example) right on one page.

 Any/all feedback is appreciated - let me know if you spot any specific
 bugs - and especially bugs with  the actual docs themselves.

 Some tech details:
 - The docs are (currently) written inline inside of the jQuery
 javascript files using a pseudo-JSDoc-like way of writingi docs.
 - This is parsed out with a simple Perl program and converted to two JSON 
 files.
 - These files are then loaded into the docs html page that you see.
 - I use a re-written version of Klaus' pager plugin and an un-touched
 copy Sam's tooltip code to help make things run smoothly.
 - I also use strictly JSON/JSONP/JSONT to get the job done - no AJAX needed 
 :-)

 All feedback is appreciated!

 --John

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


   



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


Re: [jQuery] Early Docs Prorotype

2006-08-09 Thread Dave Benjamin
If you put an overflow-y: scroll on the body, it'll keep the page from 
jumping around when the scrollbar appears. This works in recent versions 
of FireFox, though it started out as an IE-only extension.

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


[jQuery] $.get Firefox problem

2006-08-09 Thread Mohsen Saboorian
Hi,
I'm fetching a url using $.get():
$.get(url, function(xml) {
alert($(tag, xml).get(0).text);
});

xml is a simple xml tag:
tagbody/tag

IE works fine and alerts body, but FF alerts undefined.

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


Re: [jQuery] $.get Firefox problem

2006-08-09 Thread Realazy XA Chen
may add a prolog to xml file will help:?xml version=1.0 encoding=UTF-8 ?2006/8/9, Mohsen Saboorian 
[EMAIL PROTECTED]:Hi,I'm fetching a url using $.get():$.get(url, function(xml) {
alert($(tag, xml).get(0).text);});xml is a simple xml tag:tagbody/tagIE works fine and alerts body, but FF alerts undefined.___
jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/-- 
realazy.org
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.get Firefox problem

2006-08-09 Thread Mohsen Saboorian
Thank you Klaus.
Yes, my MIME was set text/xml.

1. alert($(tag, xml).get(0).text);
2. alert($(tag, xml).text());

IE: 1, 2 works
FF: only 2 works

 just putting a prolog on top will not make it xml. please check if you
 have set the correct mime type for your ajax response.

 with the extremely helpful extension firebug you can check what mime
 type the response is of.

 i don't know where the text property is from, have you tried:

 alert($(tag, xml).get(0).firstChild.data);

 or jquerish

 alert($(tag, xml).text());


 -- Klaus

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


Re: [jQuery] $.get Firefox problem

2006-08-09 Thread Mohsen Saboorian
Also this works fine for both IE and FF:
alert($(tag, xml).get(0).firstChild.data);

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


Re: [jQuery] Determine which table column was clicked

2006-08-09 Thread Dan Atkinson

Sam,

I'm experiencing the text disappearing problem in FF as well as IE, where
the text is replaced with [object Object] if the mouse moves through the
cells at speed (and ocassionally, slowly).

I tried to delay the remove() (by encasing it in a setTimeout(), in case it
wasn't checking properly, but that didn't work.
-- 
View this message in context: 
http://www.nabble.com/Determine-which-table-column-was-clicked-tf2064756.html#a5723032
Sent from the JQuery forum at Nabble.com.


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


Re: [jQuery] AJAX get() Prob. retrieving XML Dom from file system [u]

2006-08-09 Thread devsteff [c]
I've fixed the problem so that a given type of xml forces an responseXML
regardless of the response header. For me it's ok for local AJAX requests
and also for remote requests wich provide a content-type response header.

I changed:

httpData: function(r,type) {
  var ct = r.getResponseHeader(content-type);
  var xml = ( !type || type == xml )  ct  ct.indexOf(xml) =
0;
  return xml ? r.responseXML : r.responseText;
}

to:

httpData: function(r,type) {
  var ct = r.getResponseHeader(content-type);
  var xml = ( !type || type==xml ) || ( ct  ct.indexOf(xml)=0
);
  return xml ? r.responseXML : r.responseText;
}

I'm not sure how to supply a patch and I think it's better if one of the
AJAX developers cross-checks my modification. Maybe I miss something...

I'm also wondering why the .get() method with the callback function as
second parameter didn't shift the type. 

get: function( url, data, callback, type ) {
if ( data.constructor == Function ) {
callback = data;
data = null;
}

So if I omit the data parameter and the 2nd. argument is a function so that
the data become the callback function, the type is not shifted.
So you can't call get(myurl, myCallback, xml) and
get(myurl,null,myCallback,xml) results in a JS error. 
Instead you must call get(myurl,,myCallback,xml) with a empty dummy
parameter agument.
The following modification should fix this - the type parameter is also
shifted.

get: function( url, data, callback, type ) {
if ( data.constructor == Function ) {
if(callback) type = callback; //shift parameters if
data is a function
callback = data;
data = null;
}

And a last thought: Shouldn't, the post() function act in the same way as
get() with an optional data param? BTW - the documentation should someday
reflect on optional parameters.


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


Re: [jQuery] Dom creation

2006-08-09 Thread Jason Yeckel
Does not work with the latest svn but it works with 1.0a. you gave me 
the same link :) i did try a newier svn first though just to check still 
no go.

Aloyzas Rimeika wrote:
 Maybe this one will work :)
 http://www.aloyzas.lt/javascript/jquery/dom.js

 On 8/9/06, Jason Yeckel [EMAIL PROTECTED] wrote:
   
 http://www.aloyzas.lt/javascript/jquery/dom.js

 Will this be updated for the 1.0b ? or svn anytime soon?

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

 

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

   


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


[jQuery] jquery DOM Caching

2006-08-09 Thread developer
All,

I had a few question regarding DOM caching and jquery and how it  
effects overall performance.

Assumptions (based on my knowledge):

1) jquery does not cache its queries
2) In general, walking the DOM to find matching elements, classes and  
attributes does have a performance hit. I understand that their are  
speed advantages of using XPath over css selectors, etc. I will assume  
that jquery (since it is so tight) does the optimal thing when walking  
the DOM.
3)The user of jquery can speed up the DOM walk performance by  
providing more information [ie $('div.class') vs. $('.class') ]

In the past, I have used a hash (ie the DOM cache) to store DOM  
elements after they are fetched one time. More often than not, I do  
these inital DOM walks once the DOM has been loaded (the  
$(document).ready ). From that point forward, I can use the hash to  
retrieve the actual DOM objects and pass them to jquery. This avoids  
DOM walks on every jquery usage.

Questions:

1) Do browsers implement a DOM cache for you?
2) Has any thought been given to a plugin or a modification to jquery  
to cache the DOM objects resulting from queries for laster use?
An high level implementation would be:
- The hash key could be the query (ie div.class or whatever jquery  
expression you pass to $())
- The value would be the DOM object.
When a query is made, the cache would be checked first, if it is  
there, it is used. If it is not there, it could be retrieved (DOM  
walk) and then also stored in the cache.
- You would have to allow for an overide of the cache in case you  
added to the DOM since last query.

Please let me know your thoughts and feedback. In addition, don't be  
afraid to tell me if I am completely off base!!

Thanks,
Jeff

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


[jQuery] Horiz. Menu with the DOM

2006-08-09 Thread Acuff, Daniel (Comm Lines, PAC)
Title: Horiz. Menu with the DOM






Anyone know how to test if the mouse is over an ID area?

In this function I have the sub-menu close if I leave the parent-menu tab. That of course closes the sub menu if I move down on to it. How do I test if I move into that area it is ok leave the sub menu visable?

Thanks in advance!


function hideChild(source) {

 var changeSource = document.getElementById(source);

 // if cursor in the area of ID homeMenu then DO NOT hide the div

 changeSource.className = disNone;

}




*
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information.  If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited.  If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*


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


Re: [jQuery] $.get Firefox problem

2006-08-09 Thread John Resig
 Also this works fine for both IE and FF:
 alert($(tag, xml).get(0).firstChild.data);

When accessing the text value of XML elements you should always use
.nodeValue - that works the most reliably from browser to browser.
This is why doing the jQuery .text() works in both browsers.

--John

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


Re: [jQuery] JQuery, Safari and show()

2006-08-09 Thread Karl Swedberg
On Aug 9, 2006, at 3:28 PM, Frank Manno wrote:

 css: #myDiv{ display; none }
 js: $(#myDiv).show();

 The div does not get displayed... It works fine in FF.  It does work,
 however, when removing the display: none style.  Any ideas on how to
 get this working in Safari?


Not tested, but there are two possibilities that I can think of.

1.
css:
/* #myDiv{ display; none } -- comment out this line */
js:
$(document).ready(function() {
$(#myDiv).hide();
});

2.
css:
#myDiv{ display; none; }
js:
$(#myDiv).css(display,block);


___
Karl Swedberg
www.englishrules.com


On Aug 9, 2006, at 3:28 PM, Frank Manno wrote:

 Hey all,

 I've tried searching the discussion arcives to no avail... I'm running
 into an issue on Safari 2.0.4 where setting a DIV to display: none
 in the CSS causes the show() method to not work.

 here's an example:

 css: #myDiv{ display; none }
 js: $(#myDiv).show();

 The div does not get displayed... It works fine in FF.  It does work,
 however, when removing the display: none style.  Any ideas on how to
 get this working in Safari?


 Thanks in advance,
 Frank

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


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


Re: [jQuery] Horiz. Menu with the DOM

2006-08-09 Thread Fil
 Just found the only disadvantage to that is that now the sub-menu width
 *must* be the same width as the parent-menu. Otherwise the sub-div makes
 the parent-div grow too. Don't like that effect/bug on horiz. menus.

This is dealt with in the famous suckerfish menu. see jquery.blog it has
just benn jqueried (jquerized ?)

-- Fil


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


Re: [jQuery] Horiz. Menu with the DOM

2006-08-09 Thread Acuff, Daniel (Comm Lines, PAC)
Ok thanks! I was just starting to notice if I put absolute positioning on the 
sub-menus then they can be whatever width..
I will take a look.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Fil
Sent: Wednesday, August 09, 2006 5:07 PM
To: jQuery Discussion.
Subject: Re: [jQuery] Horiz. Menu with the DOM


 Just found the only disadvantage to that is that now the sub-menu width
 *must* be the same width as the parent-menu. Otherwise the sub-div makes
 the parent-div grow too. Don't like that effect/bug on horiz. menus.

This is dealt with in the famous suckerfish menu. see jquery.blog it has
just benn jqueried (jquerized ?)

-- Fil


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


*
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information.  If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited.  If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*


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