[jQuery] Re: Looking for a Good JavaScript Editor that Supports JQuery

2009-08-02 Thread chris thatcher
+1 Aptana.  excellent for javascript in general, comes with support for
jquery 1.3 enhanced code support.  excellent html and css editor as well.
built on eclipse framework without all the java editor bulk.

2009/8/2 cfddream <371486...@qq.com>

> Aptana?
>
> --
> Ever
> Now
> ..
>
>
>
>  -- Original --
>  *From: * "S2";
> *Date: * 2009年8月2日(星期天) 上午9:21
> *To: * "jQuery (English)";
> *Subject: * [jQuery] Looking for a Good JavaScript Editor that Supports
> JQuery
>
>
> Does anyone know of a good JavaScript editor that supports JQuery?
> Anyone sucessfully integrate JQuery into Eclipse/WTP or JSEclipse?
>



-- 
Christopher Thatcher


[jQuery] Re: jQuery i18n

2009-06-29 Thread chris thatcher
check out the data picker from jquery-ui.  It has excellent i18n.

http://jqueryui.com/demos/datepicker/#localization

On Mon, Jun 29, 2009 at 8:16 AM, Chris Ford wrote:

> Are you sure that you need to worry about i18n in your jQuery? So long as
> you haven't hardcoded any copy into your javascript or used any effects that
> presuppose a particular text direction then I would have assumed that i18n
> should be handled by your server-side code.
>
> Chris
>
> 2009/6/28 Mike 
>
>
>> Hi guys, i need to develop an aplication with i18n, so  i want to ask
>> you what do you think is the best way/plugin to accomplish i18n l10n
>> with jQuery?
>> by the way, i need to have multiple languages,so a bilingual solution
>> won't work for me :/
>>
>
>


-- 
Christopher Thatcher


[jQuery] Re: get email and send email?

2009-06-17 Thread chris thatcher
just to make things terribly confusing ;)

javascript is actually ecmascript, which can be used anywhere an
implementation of the scripting engine is available.  On the server you can
use spidermonkey (a c++ implementation from mozilla), rhino(a java
implementation also from mozilla), etc.  On the client, all browsers support
javascript, but the client-side javascript is 'enhanced' with additional
apis to manipulate the DOM, use AJAX, etc.

also all browsers (IE6/7 *cough*) make it extra difficult by deviating from
the w3c standard for the enhanced client-side api. libraries like jquery
hide these differences as well as provide elegant patterns that reduce your
general effort to write useful code.

im only saying this because if you are new to web development you may decide
to lower your barrier of entry by learning a single language, javascript,
and using it on both the client and the server.

sorry for the fog, hope the muddy water settles for you soon

thatcher

On Wed, Jun 17, 2009 at 12:49 PM, waseem sabjee wrote:

> JQuery is a JavaScript Library.
> JavaScript is a form of client side scripting.
>
> PHP is a form of server side scripting.
>
> they are not the same.
>
> JQuery is not a library for PHP, however you can use JQuery and PHP in
> combination.
>
> for example.
>  // this is a php block of code
> $y = 5;
> $x = 2 * y; // note this is a php variable x
> // we know have to export this to the JavaScript
> ?>
> 
> // this is a JavaScript block of code
> $(function() { // note the dollar sign here is not from PHP
>
> /*
>  we declare a variable in JavaScript
>  the value we are assigning to this variable is from a pre-declared php
> variable
>  then we just alert it to the user
> we are importing the php variable
> */
> var myAnswer = ;
> alert(myAnswer);
>
> });
> 
>
>
> On Wed, Jun 17, 2009 at 6:40 PM, inkexit  wrote:
>
>>
>> Thanks for all your help guys.  A recomendation is import because I'm
>> a complete noob when it comes to web programming.  FWIW, I do have a
>> lot of experince with C++ though.
>>
>> One question.  I thought jQuery was a php library?  One poster here
>> said that jQuery will only run in the client's browser, but another
>> poster said I could use php on the server side to read email.
>> Confused...
>
>
>


-- 
Christopher Thatcher


[jQuery] Re: jQuery's code first lin e (function(){・・・・・

2009-06-09 Thread chris thatcher
Its called an anonymous closure and prevents jquery from leaking variables
into the global scope.  The anonymous closure is a function that is defined
without a name.

//named functions a very common
//they are just functions assigned to a variable
var myfunction = function(){};

//the anonymous function is not assigned to a variable
//it's legal and the following lines show several legal but
//relatively useless lines of script that execute just fine but
//have no effect, they are all anonymous statements
(function(){ var foo; });
(6+1);
('hello '+'world');

//The anonymous function is a little special because
//it can be executed immediately by adding ();
//with firebug enabled the following line would print\
//'hello world' to the console
(function(){ var foo; console.log('hello world'); })();


So why go through all that trouble?  The answer is to keep the global scope
clean and uncluttered.  variable defined in the anonymous closure are
available inside that scope but not outside it, so variable
collision/confusion between libraries and your code can be avoided and
memory leaks more easily avoided as well.

//global or outer scope
(function(){
//anonymous or inner scope.
var foo = 'hello world';
})();

//true
if(foo === undefined){
   console.log('now I understand anonymous closures!');
}

Hope that helps!
Thatcher


On Tue, Jun 9, 2009 at 8:39 AM, darwin liem  wrote:

> its javascript, it got nothing to do with jQuery.
> for example
>
> function funcname1(){ /* do something here */ }
>
> now we do something else like setTimeout to trigger the funcname1
> setTimeout("funcname1",1000); <-- this will delay until 1 second to trigger
> the function
>
> another way to call it
> setTimeout(function(){ funcname1(); },1000); <-- this will do the same.
>
> basically function is to do a code that was need to be executed as string
> yet written as normal code... at least that what i learned so far. and it
> got nothing to do with jQuery it's part of javascript. jQuery use the same
> coding rules / grammar so that programmer do not need to familiarize with
> new function as parameter calling. yup, botrh sample i show explain that it
> use the function as parameter of another function (in this case setTimeout()
> function).
>
> hope it helps
>
> Best Regards
> Darwin Liem
>
> --- On *Tue, 6/9/09, wangsuya * wrote:
>
>
> From: wangsuya 
> Subject: [jQuery] jQuery's code first line (function(){・
> To: "jQuery (English)" 
> Date: Tuesday, June 9, 2009, 3:19 AM
>
>
> Hi everyone
>
>   Know I try to study javascript using jQuery code,but first I do not
> know why jQuery start with (function(){
> What is "(" function? Why using (function(){
> start jQuery? Thanks in advance.
>
> Wang Suya
>
>
>


-- 
Christopher Thatcher


[jQuery] jQuery powering the new Library of Congress Metasearch App

2009-06-04 Thread chris thatcher
Hey jQuery Community,

I wanted to announce another feather in jQuery's hat.  The new Library of
Congress Metasearch application was quietly released today and the interface
is entirely driven with jquery and jquery-claypool.  It's a single url app
that is all ajax after that so make sure you turn off firebug unless you
want a big performance hit.

cheers to the jQ

Links:
http://www.loc.gov/
This is the general Library of Congress site.  To access the app, just use
the search box in the upper left.

http://www.loc.gov/fedsearch/metasearch/
This is the application itself.

http://www.loc.gov/fedsearch/metasearch/?cclquery=resig

-- 
Christopher Thatcher


[jQuery] Re: just a shout out

2009-05-28 Thread chris thatcher
Thanks to Jack and Rey,

I have posted several thank you's to the jquery-en list and/or the
jquery-dev list and/or individual developers for jquery.

jQuery has provided an outlet for me as a programmer as much as an artist
like a painter, etc enough.

Jack I thank you for your thank-you, and Rey I thank you for your thank-you
for thank-you's.

(Thank You All)*2
Thatcher

On Thu, May 28, 2009 at 10:46 PM, Rey Bango  wrote:

>
> Thanks Jack. These type of emails are such great motivation for the team.
>
> We really appreciate it. :)
>
> Rey...
>
>
> Jack Killpatrick wrote:
>
>>
>> I've been majorly head's-down in a jQuery-driven AIR app for the last few
>> weeks. I've been using jQuery almost daily since very early on (2+ yrs?). It
>> works great for my web apps and great for this AIR app, which is _very_
>> heavy js/jQuery.
>>
>> Great work! Thanks, kudos, etc to the jQuery and jQuery UI teams!!
>>
>> Now, back to my custom plugins and chaining events  ;-)
>>
>> - Jack
>>
>>
>>
>>


-- 
Christopher Thatcher


[jQuery] Re: Code Review: slideshow plugin using JSON

2009-05-26 Thread chris thatcher
totally behind schedule as I'm in the process of moving.  please remind me
if I don't get back to you this week some time. apologies.

On Thu, May 21, 2009 at 3:02 PM, Stefan Hayden  wrote:

>
> You have to love the public domain.
>
> Thanks again and I look forward to your feedback.
>
> Stefan
>
> On May 21, 2:49 pm, chris thatcher 
> wrote:
> > nice work stefan, i checked out the example and will look under the
> covers
> > sometime tonight.  I'm actually at the library of congress (i work here)
> so
> > it was great to see those images from our prints and photographs
> division.
> >
> >
> >
> > On Thu, May 21, 2009 at 12:01 PM, Stefan Hayden 
> wrote:
> >
> > > I was looking for a jQuery slideshow that worked the way I wanted and
> > > didn't find one. I figured you can never have too many slideshow
> > > plugins so I've tried to make my first jQuery plugin and was hoping
> > > people with a bit more jQuery experience could look it over and give
> > > some suggestions before I go around telling people about it.
> >
> > > This slideshow requires the first slide to be in the HTML and then it
> > > preloads the next image in the rotation just before showing it making
> > > the initial page load time faster. It also has previous/next and
> > > pagination interfaces and well as an option to show a animated
> > > caption.
> >
> > > plugin homepage:http://stefanhayden.com/shermanstravel_slideshow/
> > > plugin source:
> > >http://stefanhayden.com/shermanstravel_slideshow/jquery.ShermansTrave.
> ..
> >
> > > any feedback would be welcome.
> >
> > > Stefan Hayden
> >
> > --
> > Christopher Thatcher
>



-- 
Christopher Thatcher


[jQuery] Re: Code Review: slideshow plugin using JSON

2009-05-21 Thread chris thatcher
nice work stefan, i checked out the example and will look under the covers
sometime tonight.  I'm actually at the library of congress (i work here) so
it was great to see those images from our prints and photographs division.

On Thu, May 21, 2009 at 12:01 PM, Stefan Hayden  wrote:

>
> I was looking for a jQuery slideshow that worked the way I wanted and
> didn't find one. I figured you can never have too many slideshow
> plugins so I've tried to make my first jQuery plugin and was hoping
> people with a bit more jQuery experience could look it over and give
> some suggestions before I go around telling people about it.
>
> This slideshow requires the first slide to be in the HTML and then it
> preloads the next image in the rotation just before showing it making
> the initial page load time faster. It also has previous/next and
> pagination interfaces and well as an option to show a animated
> caption.
>
> plugin homepage: http://stefanhayden.com/shermanstravel_slideshow/
> plugin source:
> http://stefanhayden.com/shermanstravel_slideshow/jquery.ShermansTravel_Slideshow.js
>
> any feedback would be welcome.
>
>
> Stefan Hayden
>
>
>


-- 
Christopher Thatcher


[jQuery] Re: How to print json data, key and value

2009-05-20 Thread chris thatcher
 $.each(data, function(index, item){
  var name;
  for(name in item){ console.log(name + " = " + item[name]);}
});

On Wed, May 20, 2009 at 5:51 AM, Massimiliano Marini wrote:

>
> Hi Charlie,
>
> > I'm not good at explaining the exact terms javascript definitions for
> > "value and key" but they are javascript identifiers? change it to
> > what their values are in the array, works great
>
> what I want to do is to print the "name" and the "value" of a json
> object without knowing what the object has inside.
>
> The only thing I know is that inside the json object there are only
> [{name:value,name:value,name:value}], the object is not fixed lenght
> and the name:value are not always the same.
>
> Is it possible?
>
> --
> Massimiliano Marini 
>



-- 
Christopher Thatcher


[jQuery] Re: XSLT problem in JQuery

2009-05-19 Thread chris thatcher
of course it is based on johann burkards plugin, but just optimized for what
i needed it for.

On Tue, May 19, 2009 at 7:53 PM, chris thatcher <
thatcher.christop...@gmail.com> wrote:

> i have an active jquery-xslt project that is used in production settings.
> its setup to have the xslt precompiled once for heavy reuse, and created a
> jquery-plugin as the result.  i use it to transform xml to json.
>
> it also provides a callback for post transform, and does not autmatically
> append the result to the document.
>
> http://github.com/thatcher/jquery-xslt/tree/master
>
> it has an example, let me know if you need more help.
>
>
> On Tue, May 19, 2009 at 4:01 PM, Ricardo  wrote:
>
>>
>> There are different versions of XSLT plugins out there, I assume
>> you're using this one:
>>
>> http://johannburkard.de/blog/programming/javascript/xslt-js-version-3-0-released-xml-xslt-jquery-plugin.html
>>
>> As per that post, there is no callback available, you should modify
>> the code yourself or contact the author, he might be willing to help.
>>
>> cheers,
>> ricardo
>>
>> On May 19, 2:29 pm, Amod  wrote:
>> > Hi
>> >
>> > I am using jquery xslt plugin and the problem I am having is that when
>> > I perform xslt i.e
>> > $('#outputDiv').xslt('PPPoE.xml','PPPoE.xsl');  
>> >
>> > the browser continues execution of the lines following this line(ie
>> > xslt line) and when the execution is finished it displays the xslt
>> > result.
>> >
>> > I want that the xslt to be performed at the time of call and not at
>> > the last, since eqCol() method is called and it adjusts the height of
>> > #rightCol
>> >
>> > making the output half visible. I can set the height of #outputDiv to
>> > some fixed value but I am trying to avoid hardcoded values.
>> >
>> > if($(this).attr("href").indexOf("#")!=-1){
>> > switch($(this).attr('title')){
>> >
>> >case 'WAN' : $("#rightCol").empty();
>> > $("#rightCol").append($wanTabs);//Append the
>> tabs
>> > tabEvents(this);//Assign click events to the
>> tabs
>> > try
>> > {
>> >
>> $('#outputDiv').xslt('NM_Web_PPPoE.xml','NM_Web_PPPoE.xsl');//
>> > Perform XSLT and display in #outputDiv
>> > // I want XSLT to be finished before it reaches
>> 'break'. Have tried
>> > using timer but browser still displays
>> > // the result at the end of execution.
>> > }
>> > catch (e)
>> > {
>> > alert(e);
>> > }
>> > break;
>> >
>> > case 'OSPF':$("#rightCol").empty().append($ospfTabs);
>> > tabEvents(this);
>> > break;}
>> >
>> > function eqCol(){
>> > $("#leftCol").height("auto");
>> > $("#rightCol").height("auto");
>> > var lcol = $("#leftCol").height();
>> > var rcol = $("#rightCol").height();
>> > if(lcol>rcol){
>> > $("#rightCol").height(lcol+"px");
>> > }else{
>> > $("#leftCol").height(rcol+"px");
>> > }
>> >
>> > }
>>
>
>
>
> --
> Christopher Thatcher
>



-- 
Christopher Thatcher


[jQuery] Re: XSLT problem in JQuery

2009-05-19 Thread chris thatcher
i have an active jquery-xslt project that is used in production settings.
its setup to have the xslt precompiled once for heavy reuse, and created a
jquery-plugin as the result.  i use it to transform xml to json.

it also provides a callback for post transform, and does not autmatically
append the result to the document.

http://github.com/thatcher/jquery-xslt/tree/master

it has an example, let me know if you need more help.

On Tue, May 19, 2009 at 4:01 PM, Ricardo  wrote:

>
> There are different versions of XSLT plugins out there, I assume
> you're using this one:
>
> http://johannburkard.de/blog/programming/javascript/xslt-js-version-3-0-released-xml-xslt-jquery-plugin.html
>
> As per that post, there is no callback available, you should modify
> the code yourself or contact the author, he might be willing to help.
>
> cheers,
> ricardo
>
> On May 19, 2:29 pm, Amod  wrote:
> > Hi
> >
> > I am using jquery xslt plugin and the problem I am having is that when
> > I perform xslt i.e
> > $('#outputDiv').xslt('PPPoE.xml','PPPoE.xsl');  
> >
> > the browser continues execution of the lines following this line(ie
> > xslt line) and when the execution is finished it displays the xslt
> > result.
> >
> > I want that the xslt to be performed at the time of call and not at
> > the last, since eqCol() method is called and it adjusts the height of
> > #rightCol
> >
> > making the output half visible. I can set the height of #outputDiv to
> > some fixed value but I am trying to avoid hardcoded values.
> >
> > if($(this).attr("href").indexOf("#")!=-1){
> > switch($(this).attr('title')){
> >
> >case 'WAN' : $("#rightCol").empty();
> > $("#rightCol").append($wanTabs);//Append the tabs
> > tabEvents(this);//Assign click events to the tabs
> > try
> > {
> >
> $('#outputDiv').xslt('NM_Web_PPPoE.xml','NM_Web_PPPoE.xsl');//
> > Perform XSLT and display in #outputDiv
> > // I want XSLT to be finished before it reaches
> 'break'. Have tried
> > using timer but browser still displays
> > // the result at the end of execution.
> > }
> > catch (e)
> > {
> > alert(e);
> > }
> > break;
> >
> > case 'OSPF':$("#rightCol").empty().append($ospfTabs);
> > tabEvents(this);
> > break;}
> >
> > function eqCol(){
> > $("#leftCol").height("auto");
> > $("#rightCol").height("auto");
> > var lcol = $("#leftCol").height();
> > var rcol = $("#rightCol").height();
> > if(lcol>rcol){
> > $("#rightCol").height(lcol+"px");
> > }else{
> > $("#leftCol").height(rcol+"px");
> > }
> >
> > }
>



-- 
Christopher Thatcher


[jQuery] Re: non-recursive find?

2009-05-19 Thread chris thatcher
 Nodes_A = $("> NodeType_2, > NodeType_4", xml);
 Nodes_B = $("> NodeType_1, > NodeType_5", xml);

On Tue, May 19, 2009 at 9:16 AM, ryan.j wrote:

>
> could get NodeType_1 then get it's .siblings()?
>
>
> On May 19, 8:49 am, Ari  wrote:
> > Hi,
> > I parse XML with JQuery and my XML looks like this:
> >
> > 
> > 
> > 
> >
> >
> > 
> >
> >
> >
> >
> > 
> >
> > I need to group first level of nodes by their types according certain
> > rules. So I have now something like this:
> > Nodes_A = $(xml).children().find("NodeType_2,NodeType_4");
> > Nodes_B = $(xml).children().find("NodeType_1,NodeType_5");
> >
> > The problem is that find is recursive and I only need the first level.
> > Is there a way to do this with JQuery?
> >
> > I'll appreciate any help,
> > Ari
>


 Nodes_A = $("> NodeType_2, > NodeType_4", xml);
 Nodes_B = $("> NodeType_1, > NodeType_5", xml);

-- 
Christopher Thatcher


[jQuery] Re: Events - Live -v- Livequery

2009-05-18 Thread chris thatcher
fascinating, i didn't even know you could do that...

On Mon, May 18, 2009 at 11:56 AM, Brandon Aaron wrote:

>
> Only Live Query supports calling a function when an element is matched
> (or unmatched). If you need this functionality, then you'll need to
> stick with Live Query.
>
> --
> Brandon Aaron
>
>
> On Mon, May 18, 2009 at 9:58 AM, Meander365 
> wrote:
> >
> > Hi all,
> >
> > I normally do this with livequery:
> >
> >$('.mylink').livequery(function(event) {
> >$(this).mycustomFunction();
> >});
> >
> > So any new .mylink's on a page would also be bound with my custom
> > function.
> >
> > How can I do this with the new LIVE event?  or is it even possible?
> >
> > Thanks in advance!
> >
> >
>



-- 
Christopher Thatcher


[jQuery] Re: The jQuery Prototype Object and Working with Others' jQuery Plug-Ins

2009-05-07 Thread chris thatcher
blah my keyboard had is heavy and i hit send before i meant to.  continuing
for roddy inline

On Thu, May 7, 2009 at 8:06 PM, chris thatcher <
thatcher.christop...@gmail.com> wrote:

> roddy, nice to meet you.  reponse is inline
>
> On Thu, May 7, 2009 at 7:31 PM, kiusau  wrote:
>
>>
>> QUESTION ONE:  When is use of the jQuery prototype object appropriate,
>> and when is it not?
>
>
> i am not a jquery core or ui developer so this response must be taken with
> a grain of salt.
>
> it is appropriate for the static jQuery namespace when the function is
> either 'generally useful' or 'highly reusable in instance context where the
> context is a dom node'
>
> for the latter case ('highly reusable in instance context where the context
> is a dom node') i am way over-specific; however, the jquery core has
> basically cornered this market.  the core dev team is highly aware of basic
> issues and most everything you could think of is already there.
>
> 'polluting' the core namespace is the responsiblity of plugins.  the term
> 'pollution' is used to mean only that every name you put on the namespace
> has the probability of conflicting in the future if it doesn't already
> exist.
>
> if you make sure a name doesn't already exist on the jquery namespace, and
> if you think the new property (which may be a function, object, array,
> simple type, or a hetergeneous object/array/function jquery-like collection)
> is useful enough to be in the core library, please feel free to ask the
> jquery-dev list
>

the chances are they will point to a thread that exists already and/or they
will question the concept by usually
1) pointing to an existing solution
2) providing context for why the question is still open
3) ask you to create a ticket to fix it
4) tell you it's a perfect use of the plug-in architecture an point you to a
great reernce for how to publish it correctly

>
>
>> BACKGROUND:  I am still trying very hard to identify the error that is
>> prohibiting me from incorporating a jQuery plug-in into my site in a
>> manner similar to the way that the author of the plug-in has
>> incorporated it into his.  Although I have sought consultation with
>> the author, he appears uninterested in working with me.
>
> post a link.  you did below and i'm just about to look at it; however, it
'should' be the first thing you post.  reduce the problem to a simple
example and post the url.  the community will help you in most cases in just
a few minutes.   on the other hand if you post something analogous to 'I
HAVE A MAJOR PROBLEM!!! CAN YOU HELP??? NOW!!!
2...@#$%!#&#$%&%^%$$*$...@#%257

well chances are

no

the reason is we need you to help us help you. if you want the most basic
question answered please use this list:
jquery-ment...@googlegroups.com



>>
>> My still fledgling knowledge of jQuery tells me that the author of the
>> plug-in and my implementation of his plug-in are constructed
>> differently.  Whereas I use jQuery's prototype property to reference
>> my method and then assign my method anonymously to my HTML document as
>> follows: $().myJQMethod().  The author of the plug-in does something
>> very different.
>>
>> Please compare the isolated code that I have extracted from the
>> author's plug-in and my implementation of it.  Links to the source
>> pages have been included.
>>
>>
>> CONSTRUCT A (The jQ_Impromptu Plug-In):
>>
>> (function($) {
>>$.prompt = function(message, options) {
>> })(jQuery);
>>
>> SOURCE:
>> http://homepage.mac.com/moogoonghwa/Imagine_Prototype/JavaScript/jQ_Impromptu-2.5.js
>>
>>
>>
>> CONSTRUCT B (My implementation of the jQ_Impromptu Plug-In)
>>
>> (function($) {
>>$.fn.getBrowserInformation = function() {
>> })(jQuery);
>>
>> SOURCE:
>> http://homepage.mac.com/moogoonghwa/Imagine_Prototype/JavaScript/jQ_browserIdentification.js
>>
>>
>> QUESTION TWO:  Although I am able to implement the author's method, it
>> is not performing as it should.  When the alert box appears with focus
>> the hosting HTML page is suppose to show through with dimmed opacity.
>> My implementation does not achieve this effect.  Firebug has alerted
>> to me to the following breakpoint, but I am poorly unable to interpret
>> it.
>>
>> jQuery.cache[ id ][ name ] :
>>
>> Could someone help?
>>
>> SOURCE HTML:
>> http://homepage.mac.com/moogoonghwa/Imagine_Prototype/Content/
>>
>> Roddy
>>
>>
>
>
> --
> Christopher Thatcher
>



-- 
Christopher Thatcher


[jQuery] Re: The jQuery Prototype Object and Working with Others' jQuery Plug-Ins

2009-05-07 Thread chris thatcher
roddy, nice to meet you.  reponse is inline

On Thu, May 7, 2009 at 7:31 PM, kiusau  wrote:

>
> QUESTION ONE:  When is use of the jQuery prototype object appropriate,
> and when is it not?


i am not a jquery core or ui developer so this response must be taken with a
grain of salt.

it is appropriate for the static jQuery namespace when the function is
either 'generally useful' or 'highly reusable in instance context where the
context is a dom node'

for the latter case ('highly reusable in instance context where the context
is a dom node') i am way over-specific; however, the jquery core has
basically cornered this market.  the core dev team is highly aware of basic
issues and most everything you could think of is already there.

'polluting' the core namespace is the responsiblity of plugins.  the term
'pollution' is used to mean only that every name you put on the namespace
has the probability of conflicting in the future if it doesn't already
exist.

if you make sure a name doesn't already exist on the jquery namespace, and
if you think the new property (which may be a function, object, array,
simple type, or a hetergeneous object/array/function jquery-like collection)
is useful enough to be in the core library, please feel free to ask the
jquery-dev list ()

>
> BACKGROUND:  I am still trying very hard to identify the error that is
> prohibiting me from incorporating a jQuery plug-in into my site in a
> manner similar to the way that the author of the plug-in has
> incorporated it into his.  Although I have sought consultation with
> the author, he appears uninterested in working with me.
>
> My still fledgling knowledge of jQuery tells me that the author of the
> plug-in and my implementation of his plug-in are constructed
> differently.  Whereas I use jQuery's prototype property to reference
> my method and then assign my method anonymously to my HTML document as
> follows: $().myJQMethod().  The author of the plug-in does something
> very different.
>
> Please compare the isolated code that I have extracted from the
> author's plug-in and my implementation of it.  Links to the source
> pages have been included.
>
>
> CONSTRUCT A (The jQ_Impromptu Plug-In):
>
> (function($) {
>$.prompt = function(message, options) {
> })(jQuery);
>
> SOURCE:
> http://homepage.mac.com/moogoonghwa/Imagine_Prototype/JavaScript/jQ_Impromptu-2.5.js
>
>
>
> CONSTRUCT B (My implementation of the jQ_Impromptu Plug-In)
>
> (function($) {
>$.fn.getBrowserInformation = function() {
> })(jQuery);
>
> SOURCE:
> http://homepage.mac.com/moogoonghwa/Imagine_Prototype/JavaScript/jQ_browserIdentification.js
>
>
> QUESTION TWO:  Although I am able to implement the author's method, it
> is not performing as it should.  When the alert box appears with focus
> the hosting HTML page is suppose to show through with dimmed opacity.
> My implementation does not achieve this effect.  Firebug has alerted
> to me to the following breakpoint, but I am poorly unable to interpret
> it.
>
> jQuery.cache[ id ][ name ] :
>
> Could someone help?
>
> SOURCE HTML:
> http://homepage.mac.com/moogoonghwa/Imagine_Prototype/Content/
>
> Roddy
>
>


-- 
Christopher Thatcher


[jQuery] Re: Parsing XML and appending to an array?

2009-05-07 Thread chris thatcher
i think what you want is $('image', responsexml).each()

otherwise you are asking for each response element of which there is only
one.

On Thu, May 7, 2009 at 4:47 PM, Alan at DSI  wrote:

>
> I'm new to jQuery and what I am trying to do is take the XML response
> below and obtain the src attribute from each image. I then want to
> append that value to an array which can be used later. Now my issue is
> when it gets to
>
> Code:
>
> $('response', returnedXMLResponse).each(function(){ ... }
>
> it only iterates to the first row in the XML document and gives me
> 001.jpg when I output tmpImageSrc to console. It won't cycle through
> the rest of the image tags as the alert only appears once with a value
> of 0. What am I missing? Am I not using the proper .each? How can I
> build my array from the XML response?
>
> XML:
>
> 
> 
>
>
>
>
>
>
> 
>
> jQuery:
>
> 
>var imageList = [];
>var i = 0;
>$(document).ready(function(){
>// Get data and parse it into an array
>$.ajax({
>url: 'xmlResponse.xml',
>type: 'GET',
>dataType: 'xml',
>success: function(returnedXMLResponse){
>console.log(returnedXMLResponse);
>$('response', returnedXMLResponse).each(function()
> {
>var tmpImageSrc = $(this).find("image").attr
> ("src");
>console.log(tmpImageSrc);
>imageList.push(tmpImageSrc);
>alert(i);
>i++;
>})
>}  // End Success
>}); // End AJAX
>//console.log(imageList);
>});
> 
>



-- 
Christopher Thatcher


[jQuery] Re: The jQuery Object, Namespaces, and Program Modules -- Connecting the Dots Between jQuery and Javascript

2009-05-06 Thread chris thatcher
5) learn to depend on firebug.  its an extension to firefox as a plugin and
even though safari 4 beta , ie8, and opera 10 all have built-in debugging
environments, firebug is still the best.  i have a feeling it will be built
into firefox soon too.  you can inspect the live dom, any elements compiled
css hierarchy ( including showing what was overrided based on weight of
selector ), network activity including headers of ajax calls and responses,
dom properties of seleted elements, a logging hook, a full-fledged
(better-than-visual-studio-by-miles ide for debugging step-by-step if you
need to) etc

 http://getfirebug.com/

On Wed, May 6, 2009 at 6:13 PM, kiusau  wrote:

>
> On May 6, 10:34 am, dhtml  wrote:
>
> > var time = new (function(x){
> >   this.timeStamp = +new Date;
> >   this.end = new Date(x); // Invalid Date.
> > })(Infinity);
>
> How do you explain that both time.timeStamp and time.end are returned
> without error in the following:
>
> var time = new (function(x){
>this.timeStamp = + new Date;
>this.end = new Date(x); // Invalid Date.
> })(1241646503107);
> alert(time.timeStamp);
> alert(time.end);
>
> but the following results when no integer is entered:
>
> 1) (time) // invalid date, with no error
> 2) () // invalid date with no error
> 3) (time.timeStamp) // error
> 4) (time()) // error
>
> REFERENCE:
> http://homepage.mac.com/moogoonghwa/practice/JavaScript/js_parentheticalOperator.html
>
>
>
>


-- 
Christopher Thatcher


[jQuery] Re: The jQuery Object, Namespaces, and Program Modules -- Connecting the Dots Between jQuery and Javascript

2009-05-05 Thread chris thatcher
i would recommend studying jquery.collections by ariel flesler.

http://flesler.blogspot.com/2008/01/jquerycollection.html

i recommend this for several reasons:

1) it's a plugin - understanding plugins is part of the core architectural
pattern.

2) it mimicks jquery's core architecture - a collection is a jquery-ish
object. so you will understand why the jquery object is both a static object
with it's own methods, and how those are reused on the jquery instance,
which an array-like object with its own scope of
functions like the jquery

3) it may teach you how to use namespace (or named closure)

jquery uses this anonymous function pattern heavily.  so do good plugins.


jQuery.noConflict();
//anonymous function executed at load time
(function($){
//$ is jQuery
})(jQuery);//semi colon should be included
//$ is not jQuery


you can create the same pattern with a plugin that uses an additional
namesapce to prevent pollution on the jquery namespace:


jQuery.noConflict();
//anonymous function executed at load time
(function($, _){
//$ is jQuery
//_ is MyNamespace
})(jQuery, MyNamespace);//semi colon should be included
//$ is not jQuery


On Tue, May 5, 2009 at 11:40 PM, Matt Kruse  wrote:

>
> On May 5, 5:36 pm, kiusau  wrote:
> > It helps enormously, as well as everything that came before it.
>
> Glad it helped. Anyone can feel free to paraphrase what I wrote and
> wiki it if you wish ;)
>
> > What
> > alert($) returns, however, is the following:
> > function (selector, context) {
> > return new (jQuery.fn.init)(selector, context);
> > }
>
> In some browsers.
>
> > I also
> > understand that methods and properties are pretty much treated the
> > same by the object in which they are contained.
>
> Yes, methods are always object properties.
>
> > What I do not
> > understand is why jQuery.fn.init is not written as jQuery.fn.init()
> > where init() is a method of the jQuery.fn prototype object.
>
> First, I do notice that FF alerts what you have written, yet IE does
> not. Doesn't matter how they are represented internally, though,
> because they are the same thing. In the actual source, the code is:
>
> function( selector, context ) {
>  // The jQuery object is actually just the init constructor
> 'enhanced'
>   return new jQuery.fn.init( selector, context );
> }
>
> Since
>  jQuery.fn.init === (jQuery.fn.init)
> then either representation means the same thing.
>
> Now, as for why "init" is a property of the jQuery.fn (aka
> jQuery.prototype) object and then its prototype set to jQuery.fn
> itself, I don't know. Seems like an odd coding decision to me, but
> perhaps there is some reasoning behind it? I would be curious to know.
> Separating out the init() method to just a stand-alone constructor
> function called jQuery() works fine and would seem cleaner.
>
> Any other questions? :)
>
> Matt Kruse
>



-- 
Christopher Thatcher


[jQuery] jquery-claypool

2009-05-05 Thread chris thatcher
Announcing  jQuery-Claypool (http://docs.jquery.com/Plugins/Claypool)

jquery-claypool is a small, concise, fast, railable javascript application
framework,
built as a jquery-plugin that provides all the usual important patterns for
large, long-lived client-side apps, server-side apps, or something
strangely,
beautifully in the middle.

like django, rails, and spring but built for jquery.  jquery-claypool
provides
a powerful routing framework, simple scanners for nearly-zero configuration,
highly
optimized category logging, aspect oriented filters, automagically managed
inversion
of control, single point of entry, swappable environments and minimal
requirement mvc.
and if all of those big words don't scare you away, jquery-claypool will
make your
life simpler, cheaper, and most importantly lazier. cheers to lazy.

jquery-claypool is both a client (browser) and server-side framework that
fits in
a compressed, gzipped file that is smaller than jquery itself.  we can
achieve
this by simply allowing you to use whatever model and view plugins you love
the most,
while simultaneously letting you write controllers the same way you would
write event
handler without jquery-claypool.  i.e. there is no notion of framework
required
extension patterns.  you decide how you like to write and we just wire it up
cleanly and
most importantly, transparently.

dependencies

* works with jquery 1.2.6 and 1.3.2(client)
* requires livequery (soon we will add live())

 Download / fork / watch jquery-claypool at github

http://github.com/thatcher/jquery-claypool/tree/master

Join the discussion group / mailing list at Google Groups:

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

Report any bugs you find on the bug tracker

http://claypooljs.lighthouseapp.com/

Documentation is being constructed at jquery plugins

http://docs.jquery.com/Plugins/Claypool

* Small, 14K gzipped.
* MIT/GPL Style License.
* Scales memory effeciency.
* Powered by jQuery.

jquery-claypool comes with template projects to get you rolling in minutes.

Client Example Project
http://github.com/thatcher/jquery-claypool-client/zipball/master
http://github.com/thatcher/jquery-claypool-client/tarball/master

Server Example Project (see it being used at http://www.claypooljs.com )
http://github.com/thatcher/jquery-claypool-server/zipball/master
http://github.com/thatcher/jquery-claypool-server/tarball/master


-- 
Christopher Thatcher
http://www.claypooljs.com


[jQuery] Re: Welcome

2009-02-23 Thread chris thatcher
Apologies for the cross post.  It's a one time event to try to get the list
rolling.  If you are interested in participating please join us at

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

Thanks
Thatcher

On Mon, Feb 23, 2009 at 11:00 PM, Thatcher
wrote:

> Welcome to the jQuery Mentors list!
>
> We are trying to create a 'big-brother' program to provide a channel
> for advanced plug-in developers to provide the critical insights and
> constructive criticism new developers who have projects in incubation
> stages prepare for the process of release, development iteration, and
> community support.
>
> Thank you for your participation in this community, and for helping to
> raise the next generation of jQuery plug-in developers.
>
> Thatcher




-- 
Christopher Thatcher


[jQuery] plugin mentors

2009-02-23 Thread chris thatcher
I was wondering if there was any interest I could stir up in the experienced
plugin developer community to participate in volunteering to act as mentors
for less experienced plugin developers get projects ready for release by
providing constructive criticism and feedback about what work a plugin needs
before it's release.

I'd personally be very grateful for some mentoring so I can get my project
out to the community without making common mistakes.

-- 
Christopher Thatcher


[jQuery] Re: [jquery-dev] Re: XPath for objects

2008-11-01 Thread chris thatcher
I posted a very bare bones project on github, jquery.jsonpath uses
jquery.collection(Ariel Flesler flesler.blogspot.com), json2.js (JSON.org),
and Stefan Goessner (goessner.net) jsonpath to provide a simple jquery-like
selector engine for large javascript objects.  I'd like it to become a
useful foundation for plugins that are 'template-centric', eg i18n,
capitalize, title, lorem ipsum, etc. Seems useful to me and very jquery-like
thanks to jquery.collections.

Cheers

On Thu, Oct 30, 2008 at 10:10 AM, chris thatcher <
[EMAIL PROTECTED]> wrote:

> Becuase e4x has limited support in browsers, (firefox has awesome support
> for it) I had started a plugin that used jsonpath (
> http://goessner.net/articles/JsonPath/) and jquery.collection (
> http://flesler.blogspot.com/2008/01/jquerycollection.html) together to
> provide a jquery-like way to query large js objects.  The project got dusty,
> mainly because it tried to cram too much functionality into it and it became
> unwieldy.
>
> I'm going to take it off the shelf for a few hours this morning and hack it
> down into a more useful core.  My personal goal for creating it is to use it
> in templates and allow jquery-like plugins to add functionality to it.
>
> If your curious I'll create a github project and post the code up there.
>
> Thatcher
>
>
> On Thu, Oct 30, 2008 at 9:55 AM, John Resig <[EMAIL PROTECTED]> wrote:
>
>>
>> It sounds like what you're looking for is something like E4X:
>> http://en.wikipedia.org/wiki/E4X
>>
>> Unfortunately it doesn't have very good browser support so it isn't
>> used very frequently.
>>
>> --John
>>
>>
>>
>> On Thu, Oct 30, 2008 at 3:32 AM, Elijah Insua <[EMAIL PROTECTED]> wrote:
>> > First Post!~
>> >
>> > What do you think about using the xpath engine for querying object
>> > structures?
>> > To my understanding the 'only' way to actually run xpath/xquery
>> > functionality on
>> > xml is to first convert it into an object.  Why not convert it into a
>> > standard object
>> > that can be queried generically?
>> >
>> > -- Elijah
>> >
>> > >
>> >
>>
>> >>
>>
>
>
> --
> Christopher Thatcher
>



-- 
Christopher Thatcher


[jQuery] Re: gzip

2008-10-29 Thread chris thatcher
generally you dont actually gzip the js files, you enable gzip compression
on the server and it does it automatically setting the appropriate headers
on the http response so that the client knows to un-gzip.


On Wed, Oct 29, 2008 at 3:02 PM, dmlees <[EMAIL PROTECTED]> wrote:

>
> I gzipped the latest jquery min file on a Mac OSX 10.4.11 and set the
> link to the script in the head using the gzipped file. It worked fine
> in Firefox 3, but did not work in Safari. Does anyone know how to make
> a Mac gzipped javascript file work in Safari and still work in the
> other browsers?
>



-- 
Christopher Thatcher


[jQuery] Re: closing tag bug in jQuery 1.2.6?

2008-10-29 Thread chris thatcher
Hey Jay, I remember having some confusion about the span tag at some point.
the html specs do significantly limit the types of tags that can be used
inside it and browsers will do unexpected things if you try.  definitely
look at the w3c site to get some more specifics.

On Wed, Oct 29, 2008 at 12:04 PM, Jay <[EMAIL PROTECTED]> wrote:

>
> On Oct 29, 10:46 am, "John Resig" <[EMAIL PROTECTED]> wrote:
> > I'm fairly certain that's incorrect syntax (putting a div inside a
> > span - especially one that's self-closing). The browser will
> > automatically force the div outside the span.
>
> Why does it work as I expected if the tag is not self closing? If it's
> forced outside the behaviour should be identical in either case.
>
> I'll go read up on what the span tag is supposed to do. It seems valid
> to me that
> if I wanted to apply format attributes to a bunch of elements I could
> surround it
> with a span.
>
> I'm really begginning to think I should go back to assembler
> programming. It was simpler.
>
>


-- 
Christopher Thatcher


[jQuery] Re: Proposal: new method for determining variables without value

2008-10-22 Thread chris thatcher
you should cc the jquery-dev list for this idea as well, to ensure those
developers see it.

thatcher

On Wed, Oct 22, 2008 at 7:34 PM, pd <[EMAIL PROTECTED]> wrote:

>
> Hi All
>
> This idea by James Edwards seems like a winner and an ideal candidate
> for a new jQuery core utility method:
>
> http://www.sitepoint.com/blogs/2008/10/16/techy-treasures-1/
>
> Obviously his choice of name conflicts with the jQuery .empty() method
> however another name could be used such as:
>
> hasValue()
>
> This method would simply return a boolean response.
>
> What does everyone think?
>
> pd




-- 
Christopher Thatcher


[jQuery] Re: $.each help for radio button validation

2008-10-22 Thread chris thatcher
It would help to see a specific example, or link to an example.  My
immediate response would be to make sure you can select each group
individually, by wrapping it with a div or something and selecting the div,
not all the radio buttons at once.  that way you can handle each group one
at a time and append the message one at a time as well.

eg




..etc







..etc



//select all the 'groups'
$('div.myRadioGroups').each(fucntion(){
//make sure at least one is selected
if( ! $('input:radio:selected', this).length > 0){
  //write a message
  $('p.message', this).text("Please select at least one!");
}
});

Thatcher
On Wed, Oct 22, 2008 at 3:57 PM, Steve <[EMAIL PROTECTED]> wrote:

>
> Hi Everyone,
>
> I'm new at this and can't figure out how to use the $.each properly.
> Let me try to explain more about my Quiz project:
>
> 1. I have a dynamic set of Radio Buttons that are grouped.
> 2. I want to validate that at least 1 is checked per group.
> 3. If a radio button is not checked in a group, i want to display a
> message under that radio buttons that says "please choose".
>
> So i think i'm pretty close, here's my approach please chime and help
> if you can:
> 1. get all Radio Buttons into a jQuery object collection.
> 2. Loop through the Radio Buttons, get the Group Name's and put them
> in an Array.
> 3. Another Loop checking if the Group has a Radio Button Checked.
> 4. If none are checked then I append an asterisk *
>
> My problem is it appends it to all the Radio Buttons.
>
> Thanks!
>
>
>
>


-- 
Christopher Thatcher


[jQuery] Re: BlockUI Plugin - FadeIn?

2008-10-21 Thread chris thatcher
Shouldn't the effect still block immediately though the opacity is being
modified as an animation?

On Tue, Oct 21, 2008 at 12:22 PM, MorningZ <[EMAIL PROTECTED]> wrote:

>
> Around line 199 in the js file is where the block layers "show"...
> play around with those options and you should be able to get the
> effect you are after
>
> although i will note that your idea doesn't make much sense, as you'll
> be giving your end user that much time to be able to click something
> else.. rendering the functionality of the block useless
>
>
> On Oct 21, 10:52 am, Kilik <[EMAIL PROTECTED]> wrote:
> > Is there a way to get the 'Modal Dialog' feature of this plugin to
> > fade in? It already fade outs by default when the dialog is canceled.
> >
> > -Thx
>



-- 
Christopher Thatcher


[jQuery] Re: dot separated id

2008-10-17 Thread chris thatcher
I agree that a spec is a spec.  The problem is rigidly adhering to it will
break to rest of the specs that work along side the html specs to produce
the intended result in the presentation layer.  I too had to change the way
I assigned id's to accommodate css and js that used css selectors.  If
anyone wants to use periods, they should feel free, but I doubt the css and
javascript communities will feel obligated to accommodate them.  No offense
meant whatsoever, I had the same issue.

On Fri, Oct 17, 2008 at 2:55 PM, Jeffrey Kretz <[EMAIL PROTECTED]>wrote:

>
> It's not useful to claim that the specs are faulty.  Until they change,
> dots
> in IDs are legal and valid.
>
> JK
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of ricardobeat
> Sent: Friday, October 17, 2008 10:21 AM
> To: jQuery (English)
> Subject: [jQuery] Re: dot separated id
>
>
> Yeah, that's a fault in the specs. XHTML specs also allow dots in IDs:
>
> 'only strings matching the pattern [A-Za-z][A-Za-z0-9:_.-]* should be
> used.'  - http://www.w3.org/TR/xhtml1/#C_8
>
> But that causes problems for CSS too:
>
> 
> 
>
> #tom.cat { which one are you referring to? }
>
> - ricardo
>
> On Oct 16, 7:41 pm, "Mauricio \(Maujor\) Samy Silva"
> <[EMAIL PROTECTED]> wrote:
> > Specs at  link pointed out says:
> >  ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
> followed
> > by any number of letters, digits ([0-9]), hyphens ("-"), underscores
> ("_"),
> > colons (":"), and periods (".").
> >
> > Aren't dots and periods the same?
> >
> >
>
> 
> -
> >
> > double backslashes are the short term fix, but remember for the long
> > term that dots are illegal in ID's and will cause your page to not
> > validate.
> >
> > seehttp://www.w3.org/TR/html401/types.html#type-namefor reference.
> >
> > -micah
>
>


-- 
Christopher Thatcher


[jQuery] Re: JS Question: How does this jQuery idiom work?

2008-10-15 Thread chris thatcher
It's very important becuase the symbol $ is used by other javascript
libraries and it can cause a conflict if you use it outside of the anonymous
function.

For example another sloppy library might have a global definition

var $ = function(){
   alert('Not Cool Man!');
};

then if you tried to use jQuery

$("#mycoolapp").coolPlugin().beCool();

and yould get the alert, 'Not Cool Man!'

But jQuery doesnt stand for such sloppy nonsense so we do:

jQuery.noConflict();

and write our plugin still using $ like so:

(function($){
   $.fn.coolPlugin = function(){
 //do cool stuff and feel free to use $ and know
 // it means jQuery and not the lame alert function
 //declared globally by sloppy library X
   }
})(jQuery);

On Wed, Oct 15, 2008 at 9:09 AM, Mike Alsup <[EMAIL PROTECTED]> wrote:

>
> > Plugins are supposed to use this:
> >
> > (function($) {
> > // Plugin code
> >
> > }) (jQuery)
> >
> > I know what it does (allows the use of $ within the script), but how
> > does it actually work? Is it somehow casting the function object as
> > the jQuery object? It always seemed odd to me, and I haven't seen this
> > idiom elsewhere.
>
> Consider this bit of code:
>
> // declare a function that accepts an argument
> var myFn = function(myParam) {
>// inside here I can use myParam freely
> };
> // call the function and pass an argument
> myFn(3);
>
>
> Now, change what you call the parameter name and what you pass to the
> function
>
> var myFn = function($) {
>// inside here I can use $ freely
> };
> // call the function and pass jQuery as the argument
> myFn(jQuery);
>
>
> Now do it all in one step, as an anonymous function:
>
> (function($) {
>// inside here I can use myParam freely
> })(jQuery);
>
>
>
>
>


-- 
Christopher Thatcher


[jQuery] Re: blockUI conflicts

2008-10-10 Thread chris thatcher
its part of jquery ui.

http://ui.jquery.com/

When you go to the download builder you should only need the dialog
component and the effects components (to do the fancy opening magic in the
example i posted)

On Fri, Oct 10, 2008 at 7:59 PM, 700lbGorilla <[EMAIL PROTECTED]> wrote:

>
> That a separate plugin or it in the jquery base code?
>



-- 
Christopher Thatcher


[jQuery] Re: blockUI conflicts

2008-10-09 Thread chris thatcher
Im not sure about the specific answer to your question but I can recommend
an alternative solution.

I use Richard D. Worths oh so excellent $.ui.dialog plugin to achieve a very
simple version of the litebox effect.  its from the jquery ui team.

it goes alittle something like this:

  $("#window").dialog($.extend(this.dialogOptions||{}, {
modal: true,
resizable:false,
height: $(document).height(),
width: $(document).width(),
overlay: {
opacity: 0.2,
background: "black"
}
}));
//initialize jcarousel here

//simple animation to present overlay
$("#window").show("clip", {
direction: "horizontal"
}, 1000);
where your html is something like:



   


Thatcher


On Thu, Oct 9, 2008 at 10:29 PM, 700lbGorilla <[EMAIL PROTECTED]> wrote:

>
> Does anyone know if blockUI has conflicts displaying either
> jcarousellite or jcarousel galleries? I'm using the jcarousel lite and
> it works fine, but if I try to use blockUI to display it, the carousel
> doesn't display. All I was trying to do was display a carousel in a
> litebox type way. I wanted to do it this way so the user could scroll
> to the pic he wants instead of hitting the next buttons and going
> through each image.
>



-- 
Christopher Thatcher


[jQuery] Re: just started using jQuery today

2008-10-08 Thread chris thatcher
Welcome!

On Wed, Oct 8, 2008 at 4:40 AM, BB <[EMAIL PROTECTED]> wrote:

>
> Yes, because it is not in the $(document).ready(function() { ... });,
> so it would be executed before the dom is ready.
> so just write the $("a").click(function(){ ... }); in the $
> (document).ready(function() { ... });.
>
> $(document).ready(function() {
>  $("a").click(function(){
>alert("clicked!");
>return false;
>  });
> });
>
> On 8 Okt., 05:05, nobuhiko_toguchi <[EMAIL PROTECTED]> wrote:
> > I was following the training, and .. stucked on the very begining of
> > the page.
> >
> > 
> > 
> > 
> > 
> > $(document).ready(function(){
> > alert("hello");
> > });
> > $("a").click(function(event){
> > alert("Thanks for visiting!");
> > event.preventDefault();
> > });
> > 
> > 
> > 
> >   http://jquery.com/";>jQuery
> > 
> > 
> >
> > The message "hello" appear when the page is opened, but nothing
> > happens when I click the link.
>



-- 
Christopher Thatcher


[jQuery] Re: Processing.js Google Group Now Formed!

2008-10-07 Thread chris thatcher
Sure Rey I actually moved it there a couple days ago, sorry about that.

On Tue, Oct 7, 2008 at 12:20 PM, Rey Bango <[EMAIL PROTECTED]> wrote:

>
> Hi Chris,
>
> Great explanation. Would you mind though moving this over to the Processing
> Google group?
>
> I'm trying to keep things on-topic.
>
> Thanks,
>
> Rey...
>
> chris thatcher wrote:
>
>> Processing.js ( http://github.com/jeresig/processing-js/ ) is written by
>> John Resig and is a port of the Processing language (
>> http://processing.org ) developed at MIT that uses the Html Canvas (
>> http://en.wikipedia.org/wiki/Canvas_(HTML_element)<http://en.wikipedia.org/wiki/Canvas_%28HTML_element%29>)
>>
>> It is a very sexy 2D drawing API that allows developers to create rich
>> visualizations, and via excanvas.js, is supported by all browsers (needs
>> some work based on my experience).
>>
>> I spent a few hours on the train and wrote a 75 line routine to produce
>> Heat Maps on top of Google Maps, it can be used to render beautiful charts,
>> manipulate images, etc, etc.
>> It's a big win for the javascript community and John's skills show clearly
>> in it's simplicity and it's completeness.
>>
>> Thatcher
>>
>> On Sat, Oct 4, 2008 at 9:26 PM, Rick Faircloth <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote:
>>
>>
>>Ok...I'll ask...what is "Processing.js" about?
>>
>>Rick
>>
>>chris thatcher wrote:
>>
>>I started using processing.js also, I'll definitely join this
>> group!
>>
>>Thatcher
>>
>>On Sat, Oct 4, 2008 at 7:16 PM, F1LT3R <[EMAIL PROTECTED]
>><mailto:[EMAIL PROTECTED]>
>><mailto:[EMAIL PROTECTED]
>>
>><mailto:[EMAIL PROTECTED]>>> wrote:
>>
>>
>>   Hey Joe,
>>
>>   I love using Processing so I am glad you started this group
>>and I will
>>   definitely be subscribing.
>>   You have a question? I have been digging around in the
>>Processing.js
>>   for a while now and am quite familiar with the Java Processing
>>   language, so maybe I could help?
>>
>>   Thanks,
>>
>>   Al
>>
>>
>>
>>   On Sep 24, 1:36 pm, Joe <[EMAIL PROTECTED]
>><mailto:[EMAIL PROTECTED]>
>>   <mailto:[EMAIL PROTECTED]
>><mailto:[EMAIL PROTECTED]>>> wrote:
>>   > Head here:
>>   >
>>   > http://groups.google.com/group/processingjs
>>   >
>>   > And discuss!  I already have one question and don't want to
>>post it
>>   > here on the jQuery board so I figured I'd go ahead and
>>create the
>>   > group.
>>   >
>>   > Cheers.
>>   >
>>   > Joe
>>
>>
>>
>>
>>--Christopher Thatcher
>>
>>
>>
>>
>>
>> --
>> Christopher Thatcher
>>
>


-- 
Christopher Thatcher


[jQuery] Re: Processing.js Google Group Now Formed!

2008-10-04 Thread chris thatcher
Processing.js ( http://github.com/jeresig/processing-js/ ) is written by
John Resig and is a port of the Processing language (
http://processing.org) developed at MIT that uses the Html Canvas (
http://en.wikipedia.org/wiki/Canvas_(HTML_element) )

It is a very sexy 2D drawing API that allows developers to create rich
visualizations, and via excanvas.js, is supported by all browsers (needs
some work based on my experience).

I spent a few hours on the train and wrote a 75 line routine to produce Heat
Maps on top of Google Maps, it can be used to render beautiful charts,
manipulate images, etc, etc.

It's a big win for the javascript community and John's skills show clearly
in it's simplicity and it's completeness.

Thatcher

On Sat, Oct 4, 2008 at 9:26 PM, Rick Faircloth <[EMAIL PROTECTED]>wrote:

>
> Ok...I'll ask...what is "Processing.js" about?
>
> Rick
>
> chris thatcher wrote:
>
>> I started using processing.js also, I'll definitely join this group!
>>
>> Thatcher
>>
>> On Sat, Oct 4, 2008 at 7:16 PM, F1LT3R <[EMAIL PROTECTED] > [EMAIL PROTECTED]>> wrote:
>>
>>
>>Hey Joe,
>>
>>I love using Processing so I am glad you started this group and I will
>>definitely be subscribing.
>>You have a question? I have been digging around in the Processing.js
>>for a while now and am quite familiar with the Java Processing
>>language, so maybe I could help?
>>
>>Thanks,
>>
>>Al
>>
>>
>>
>>On Sep 24, 1:36 pm, Joe <[EMAIL PROTECTED]
>><mailto:[EMAIL PROTECTED]>> wrote:
>>> Head here:
>>>
>>> http://groups.google.com/group/processingjs
>>>
>>> And discuss!  I already have one question and don't want to post it
>>> here on the jQuery board so I figured I'd go ahead and create the
>>> group.
>>>
>>> Cheers.
>>>
>>> Joe
>>
>>
>>
>>
>> --
>> Christopher Thatcher
>>
>
>


-- 
Christopher Thatcher


[jQuery] Re: Processing.js Google Group Now Formed!

2008-10-04 Thread chris thatcher
I started using processing.js also, I'll definitely join this group!

Thatcher

On Sat, Oct 4, 2008 at 7:16 PM, F1LT3R <[EMAIL PROTECTED]> wrote:

>
> Hey Joe,
>
> I love using Processing so I am glad you started this group and I will
> definitely be subscribing.
> You have a question? I have been digging around in the Processing.js
> for a while now and am quite familiar with the Java Processing
> language, so maybe I could help?
>
> Thanks,
>
> Al
>
>
>
> On Sep 24, 1:36 pm, Joe <[EMAIL PROTECTED]> wrote:
> > Head here:
> >
> > http://groups.google.com/group/processingjs
> >
> > And discuss!  I already have one question and don't want to post it
> > here on the jQuery board so I figured I'd go ahead and create the
> > group.
> >
> > Cheers.
> >
> > Joe
>



-- 
Christopher Thatcher


[jQuery] Re: Is anyone using jQuery + Jaxer?

2008-09-22 Thread chris thatcher
I really think it's just a little ahead of it's time.  I dont get too much
time to tinker but found myself spending too much time figuring out how to
use the IDE they develop instead of just coding with it.  If I have a second
chance I'll go straight to the server and ignore the development tools.

Thatcher

On Mon, Sep 22, 2008 at 7:42 PM, MorningZ <[EMAIL PROTECTED]> wrote:

>
> I've gotten so much to the point where I think "jQuery" for everything
> nowadays, I like the framework that much and really feel like I've got
> my programming and patterns down pat enough that I am faster/more-
> complete with anything I have been coding this year
>
> With that said, I'm *really* intrigued by Aptana's "Jaxer" product
> (http://aptana.com/jaxer/), but there seems to be little excitement/
> progress about it.
>
> Even so, anyone in this group toying around with it at all?
>
>


-- 
Christopher Thatcher


[jQuery] Re: Washington DC jQuery Meetup - lunch and learn jQuery UI at the Library of Congress

2008-09-16 Thread chris thatcher
Ed Summers...  I know him!  In fact I like him too!   I worked with Ed and
the OSI team to create the World Digital Library Prototype (and used jQuery
in fact).

I have to be in New York for that date but please give OSI my kindest
regards and let them know I wish I could join you all.

PS I also used jQuery with another project at LOC which is in UX testing now
and have recently been contracted for a third.  Wish I could take all the
credit but jQuery really was the key.

Thatcher

On Tue, Sep 16, 2008 at 10:31 AM, Richard D. Worth <[EMAIL PROTECTED]>wrote:

> Washington DC Developers,
>
> I'm speaking about jQuery and jQuery UI to some developers at the Library
> of Congress this Thursday at lunch. They were nice enough to open it up for
> anyone to attend. If you're interested, see the details below and shoot an
> email to Ed Summers so they have an idea of numbers. Thanks.
>
> Talk: jQuery and jQuery UI
> Synopsis: Will be similar to talks I gave recently at the Rich Web
> Experience. See
> http://www.therichwebexperience.com/conference/washing_dc/sessions.html#speaker18860
>
> Date & Time:
> Thursday, September 18, 2008
> 12:30-1:30pm (we have the room until 2, if you want to chat for a bit)
>
> Location:
> LA-G06, Adams Building
> Library of Congress
> Washington, D.C.
>
> Directions:
> Adams Building is located at 2nd St SE
> between Independence Ave & East Capitol Streets
> a block from the Capitol South Metro
>
> RSVP:
> Ed Summers
> < ed.summers AT gmail DOT com >
>
> - Richard
>
> Richard D. Worth
> http://rdworth.org/
>
>


-- 
Christopher Thatcher


[jQuery] getScript + google-maps = page locks up ?

2008-09-11 Thread chris thatcher
Well I lied a little but it's $.ajax ith the datatype set to script:
 var _this = this;
 var url = "http://maps.google.com/maps";;
 var data = {
   file:"api",
   v:2,

key:"ABQIjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ"
 };
 $.ajax({
type: "get",
dataType: "script",
url: url,
data:  data,
success: function(){
_this.debug("Loaded provider script %s.", url);
//Do stuff
},
error: function(xhr, status, e){
_this.warn("Failed to load base layer required
scripts.");
}
});

So everthing is fine and the script loads and I get to the successfull
callback in firebug.  However, the first line fails because an error is
thown and indeed if I put 'watch' _this in the firebug watch panel, I see
this message:

ReferenceError: __scope__ is not defined

The page keeps spinning saying it loading maps.google.com but I can see the
scripts are loaded in firebug.  One other interesting wierdness is that the
dom disappears, meaning the screen goes blank white and I can't see any info
in the firebug html window.

Any thoughts?! I lost all day to this one...

Thanks
-- 
Christopher Thatcher


[jQuery] Re: New Google Browser announced

2008-09-03 Thread chris thatcher
I hope it's enough for microsoft to retire ie6, but frankly I worry a little
bit about the gas giant that google is becoming.  I can't see any reason
they couldn't simply have given some funding to mozilla and kept providing
their services as is, except... to hone their tracking of my browser
behavior to improve advertisement placement. Firefox is still my sweet
heart, and we're going steady.

On Wed, Sep 3, 2008 at 6:17 AM, Diego A. <[EMAIL PROTECTED]> wrote:

> I love it! No non-sense web browsing.
> I'll still keep firefox for development of course, but I'll definitelly
> recommend it for general use.
>
> 2008/9/2 Giovanni Battista Lenoci <[EMAIL PROTECTED]>
>
>
>> Is out! :-)
>>
>> --
>> gianiaz.net - web solutions
>> p.le bertacchi 66, 23100 sondrio (so) - italy
>> +39 347 7196482
>>
>
>
>
> --
> Cheers,
> Diego A.
>



-- 
Christopher Thatcher


[jQuery] Re: Getting a fragment of ajax html and writing to the page

2008-08-20 Thread chris thatcher
I think you just need to supply the context to the query like so:

var popupContent = $('#foo', popupData);

Thatcher

On Wed, Aug 20, 2008 at 1:25 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

>
> Hi, can anyone tell me how I can get part of a web page downloaded
> with $.get()? I thought it would be easy but ohhh no :( Here's a
> snippet:
>
> $("[EMAIL PROTECTED]").click(function()
> {
>$.get($(this).attr("href"), function(popUpData)
>{
>var popupContent = $();
>$.modal(popupContent );
>});
>return false;
> });
>
> At '', I basically want to find the contents of a div in popUpData
> with an ID of foo as a string I can pass to a modal pop-up. The web
> page fetched is HTML 4.01 Strict.
>
> Thanks for any help,
>
> Richard
>
> P.s. $.modal is: http://www.ericmmartin.com/projects/simplemodal/
>



-- 
Christopher Thatcher


[jQuery] Re: JTemplates site gone ?!

2008-07-18 Thread chris thatcher
Gosh I was just there recently, seems strange indeed.  I have a very recent
zip of the source if you need it.  I also use jtemplates a lot.  Hmm...  so
hopefully it's just that they forget to renew the domain name or failed to
pay the bill for hosting.  In the worst case I'm willing to try to help host
a download and/or pick up the pieces and start maintaining it moving
forward.

Let me know.  I definitely am a big fan of this templating plugin for
jquery.

Thatcher

On Fri, Jul 18, 2008 at 6:17 AM, Half-Dead <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> Seems like http://jtemplates.tpython.com dropped of the face of the
> earth since a week or 2.
>
> Anyone know if it just moved, is comming back or anything at all?
> Cause i really need to get my hands on the doc/samples ..just in case.
>
>
> Btw, jtemplates is a very nice plugin to abstract the UI. I'm
> currently using it sucessfully with jquery on a site with up to 25K
> simultaneous users chatting away :)
>
>
> Thank's for any info!
> Robert
>



-- 
Christopher Thatcher


[jQuery] Re: Feedback for new plugin idea: ui.querybuilder

2008-07-18 Thread chris thatcher
Are you familiar with OpenSearch?  I bring it up because the OpenSearch has
already provided some of the semantics to help generalize the search issue.
At some point I had built a client with jquery for opensearch + atom and
opensearch-suggest + json, but can't share it because it was part of some
work I did for the Library of Congress.  If you really want to make a
generally useful plugin to address search/query etc, I'd really recommend
you look at the opensearch protocol to at least understand what
generalizations they've already made.

I'd be happy to provide a sounding board and help 're'-create a jquery
opensearch plugin if that's the direction you decide to go in.

Thatcher

On Fri, Jul 18, 2008 at 11:11 AM, Keith Hughitt <[EMAIL PROTECTED]>
wrote:

>
> Hi all,
>
> I've started designing a jQuery UI plugin for building complex search
> queries in a visual fashion, and wanted to see what people though, or
> if people had any suggestions. Once the plugin is finished, anyone is
> welcome to use it of course. I also posted this message in the jQuery
> UI group, but I thought I'd post it here as well for those who aren't
> members of the UI group.
>
> I. Overview
>
> The goal of the plugin is to create a UI component for piecing
> together complex multi-component search queries and a simple and
> visual way. The plugin will allow the user to select some set of
> desired "search criterion," and then when then submit a query when
> ready (the rest of the logic thereafter is out of the realm of this
> plugin, and will be handled by the developer).
>
> To handle this, the plugin will be broken into three components:
> Inactive, active, and current search criterion. The inactive and
> active criterion are lists of criterion (will come back to exactly
> what these are later) that either have or have not been applied, and
> the current search criterion is a single criterion currently in
> "focus." Although the  Developer will have control over where these
> various components sit, one simple setup would be to have a single
> container split horizontally into the three components:
>
> (See Gimp mock-up at
> http://i61.photobucket.com/albums/h78/hughitt1/uiquerybuilderannotated.png
> )
>
> II. Use case:
>
> 1. When the application initially loads, and the inactive search
> criterion section is populated with a list of criterion the user can
> use to search by. The current section displays a single search
> criterion (the most useful one to begin with), possibly with
> thumbnails for each choice. The inactive section is empty to begin
> with.
>
> 2. The user clicks "option 2" and the filter moves from "current" ->
> "active" (possibly with some animation), and a new filter from the
> inactive section moves to "current."
>
> 3. User selects again and there are now two "active" search criterion.
> The current search criterion isn't something the user cares about so
> they click on one of the other inactive filters and it is swapped with
> the current one.
>
> 4. This process continues until the user is satisfied with the chosen
> parameters. The "inactive" list may be updated dynamically with new
> search criterion that are relevant to some criterion already chosen.
>
> 5. (Optionally) If the developer has access to a method that returns
> only the *number* of results for a given query, then this value can be
> queried each time the user adjusts the query and displayed on screen.
>
> 6. The user hits "search" and some function provided by the developer
> pieces together the active search criterion to produce and query
> string and sends it off.
>
>
> III. Some useful methods to have:
>
> addCriterion
> removeCriterion
> activateCriterion
> deactivateCriterion
> swapCurrent
> updateAvailableCriterion
> updateNumResults
> submitQuery
>
> Event handlers could be available for each action (adding, removing,
> swapping, etc.) to give the developer further control.
>
>
> IV. How to represent a search criterion?
>
> There are many different ways you could handle this. While I would
> like the keep the plugin very general, and  make as few assumptions as
> possible, I also want the plugin to handle most of the work. So far,
> what I'm thinking would be best would be to pass around
> "SearchCriterion" objects which have the following properties:
>
> name: int
> type  : string
> description: string
> choices: array
> selected: (int, string, date, etc).
> priority: int
> requires: array
> provides: array
>
> I don't know if I will implement all of these, but using this
> structure will make things pretty straight-forward for the plugin.
>
> -"name" would act as both a display name for the search criterion, and
> possibly also as a unique ID.
> -"type" would allow specifying what to display when the filter is the
> current one displayed: text only, thumbnails and text, a datepicker,
> or a daterange picker.
> - "description": for tooltips
> - "choices": available choices to display (special case: dates and
> date ranges)
> - "s

[jQuery] Re: Submitting entire webpage for server-side XSLT parsing

2008-07-17 Thread chris thatcher
Still an interesting question, sorry I didn't reply.  Its obviously easy to
hold a dom on the server and serialize it all to the client as a
continuation of state.  It's not so easy on the client as some things may
hidden from you by the browsers internal state implement since it's not
transparent.

So what your saying is that you where able to serialize the entire document
after modification locally?  What method(s) did you use to provide the
entire dom serialization ? What do you mean you convert the input elements
to text?

Just curious, and related to some other stuff I'm working on.  I hadn't
gotten to client-side dom serialization so I'm very curious.

Thanks,
Thatcher

On Thu, Jul 17, 2008 at 11:15 AM, Mdj <[EMAIL PROTECTED]> wrote

>
> On Jul 17, 11:24 am, Mdj <[EMAIL PROTECTED]> wrote:
>
> > input fields are not updated if I just return $("body").html(). Is
> > there a general way to return the entire updated DOM?
>
> Nevermind, I just convert the input elements to text after edit.
>
> /Morten
>



-- 
Christopher Thatcher


[jQuery] Re: NEW: XML to JSON Plugin

2008-07-16 Thread chris thatcher
FORMAT:
Yeah I agree the {}/[] issue complex and after going another round with
xotree I have to say I really like the 'force_array' map it optionally
allows.  That said the asArray() solution works and I might like it even
better once I'm using it becuase I'm totlly Lazy ;)

ATTRIBUTES:
if you want to encourage dot notation for attributes, the best thing to do
is look at what is legal for js names but not for xml names and basically
your left with '$'.  The bigger issue occurs with the use of ':' in xml
names is legal but obviously not for js and in fact an xml name can even
start with ':' or '_' as well.  The underscore isn't an issue but if you
want a quick replace method to go from attribute xml to js name and back the
easiest way may be

xml attribute name to js name
1 prefix by '$' to denote an attribute
2 replace all ':' with '$'

js name to xml attribute name
1 remove prefix '$'.
2 replace all '$' with ':'

This keeps it clean for the simple no-namespaced xml, but still lets us
namespace dorks keep using namespaces and still access our attributes.

eg no namespace
foo.bar.$goop

eg namespaced
foo.bar.$svg$goop

What do you think?

OVERALL:
I agree with your approach and coming from a heavy xml background and still
using stuff like this for wierd/ugly/legacy xml means I need to not loose
info.  I say make the simplest cases very elegant like you've already
described and I'll help make sure that the critical xml info is still
identifiable so we can round-trip non-lossy.

MIXED CONTENT
I generally don't think tools like this are very useful for mixed content
like  bar  pooh  but I was curious if you
wanted to try to address this or just note it as unsupported.

Thatcher
On Wed, Jul 16, 2008 at 5:27 AM, Diego <[EMAIL PROTECTED]> wrote:

>
> Hi Chris,
>
> FORMAT:
> I set the 'simple mode' (arrays only when necessary) as default
> because it suited my usage of the plugin. I completely see the
> argument of always using arrays so the format of the output is always
> known (ie.: in arrays), but I do have a reservation about that. I
> think in most cases the user will know what the XML structure and
> defaulting the plugin to 'simple mode' will result in a neater and
> more intuitive interface: "response.result" instead of
> "response[0].result[0].text".
>
> As for nodes which are expected to be arrays, there's no reason why -
> along with our .find utility method - we can't have an asArray()
> method that will, if necesssary, convert the node into an array. This
> saves having to parse a pre-defined format and also avoids any lazy
> programming - ie.: only do something when you need it.
>
> ATTRIBUTES:
> At the moment, I purposely built the plugin to treat text nodes and
> attributes exactly the same, meaning your example xml and my example
> xml would end up as the same json. The idea of prefixing all
> attributes @ is great, but @ is not a valid js variable character and
> could only be accessed via person.hair['@colour'] instead of
> person.hair.colour. So it might be worth considering an alternative
> which does not involve any extra characters
>
> OVERALL:
> My focus really has been on usability. I've gone out of my way to
> 'hide' the technicalities of the XML and keep the JSON as simple as
> possible. I agree it will have to get a little more complex if we're
> going to implement this additional functionality and support json to
> xml conversion, but it would be great if we can find a way to do
> both
>
> Cheers,
> Diego A.
>
>
> On Jul 16, 3:17 am, "chris thatcher" <[EMAIL PROTECTED]>
> wrote:
> > On Tue, Jul 15, 2008 at 4:01 PM, Diego A. <[EMAIL PROTECTED]> wrote:
> > > Hi Chris,
> >
> > > AJAX:
> > >> Yeah actually I think it's normally sufficient to let the user use
> jquery
> > >> ajax as usual but just provide easy functions to unmarshal/marshal
> into the
> > >> format they need where ever they need it.  It reduces the size of the
> plugin
> > >> and I've sort of found most ajax-convenience functions in plugins
> aren't
> > >> exactly what I need so I end up not using them anyway.  Not always
> true
> > >> though and if you think there some benefit I really don't feel very
> strongly
> > >> either way (just playing devils advocate.)
> >
> > > We need not re-invent the wheel. I think it would be fair to assume
> users
> > > of this plugin will have a certain amount of experience and would be
> quite
> > > ca

[jQuery] Re: NEW: XML to JSON Plugin

2008-07-16 Thread chris thatcher
Oh and now that I'm reading my response I forgot to mention these characters
in xml names, '-' (minus) and '.' (dot).  Obviously not legal tender in the
js arena.  The only thing I can think of here is to not map to a legal js
name and force the associative array usage, eg via foo['bar-goop']

Ugh
Thatcher

On Wed, Jul 16, 2008 at 9:46 AM, chris thatcher <
[EMAIL PROTECTED]> wrote:

> FORMAT:
> Yeah I agree the {}/[] issue complex and after going another round with
> xotree I have to say I really like the 'force_array' map it optionally
> allows.  That said the asArray() solution works and I might like it even
> better once I'm using it becuase I'm totlly Lazy ;)
>
> ATTRIBUTES:
> if you want to encourage dot notation for attributes, the best thing to do
> is look at what is legal for js names but not for xml names and basically
> your left with '$'.  The bigger issue occurs with the use of ':' in xml
> names is legal but obviously not for js and in fact an xml name can even
> start with ':' or '_' as well.  The underscore isn't an issue but if you
> want a quick replace method to go from attribute xml to js name and back the
> easiest way may be
>
> xml attribute name to js name
> 1 prefix by '$' to denote an attribute
> 2 replace all ':' with '$'
>
> js name to xml attribute name
> 1 remove prefix '$'.
> 2 replace all '$' with ':'
>
> This keeps it clean for the simple no-namespaced xml, but still lets us
> namespace dorks keep using namespaces and still access our attributes.
>
> eg no namespace
> foo.bar.$goop
>
> eg namespaced
> foo.bar.$svg$goop
>
> What do you think?
>
> OVERALL:
> I agree with your approach and coming from a heavy xml background and still
> using stuff like this for wierd/ugly/legacy xml means I need to not loose
> info.  I say make the simplest cases very elegant like you've already
> described and I'll help make sure that the critical xml info is still
> identifiable so we can round-trip non-lossy.
>
> MIXED CONTENT
> I generally don't think tools like this are very useful for mixed content
> like  bar  pooh  but I was curious if you
> wanted to try to address this or just note it as unsupported.
>
> Thatcher
>
> On Wed, Jul 16, 2008 at 5:27 AM, Diego <[EMAIL PROTECTED]> wrote:
>
>>
>> Hi Chris,
>>
>> FORMAT:
>> I set the 'simple mode' (arrays only when necessary) as default
>> because it suited my usage of the plugin. I completely see the
>> argument of always using arrays so the format of the output is always
>> known (ie.: in arrays), but I do have a reservation about that. I
>> think in most cases the user will know what the XML structure and
>> defaulting the plugin to 'simple mode' will result in a neater and
>> more intuitive interface: "response.result" instead of
>> "response[0].result[0].text".
>>
>> As for nodes which are expected to be arrays, there's no reason why -
>> along with our .find utility method - we can't have an asArray()
>> method that will, if necesssary, convert the node into an array. This
>> saves having to parse a pre-defined format and also avoids any lazy
>> programming - ie.: only do something when you need it.
>>
>> ATTRIBUTES:
>> At the moment, I purposely built the plugin to treat text nodes and
>> attributes exactly the same, meaning your example xml and my example
>> xml would end up as the same json. The idea of prefixing all
>> attributes @ is great, but @ is not a valid js variable character and
>> could only be accessed via person.hair['@colour'] instead of
>> person.hair.colour. So it might be worth considering an alternative
>> which does not involve any extra characters
>>
>> OVERALL:
>> My focus really has been on usability. I've gone out of my way to
>> 'hide' the technicalities of the XML and keep the JSON as simple as
>> possible. I agree it will have to get a little more complex if we're
>> going to implement this additional functionality and support json to
>> xml conversion, but it would be great if we can find a way to do
>> both
>>
>> Cheers,
>> Diego A.
>>
>>
>> On Jul 16, 3:17 am, "chris thatcher" <[EMAIL PROTECTED]>
>> wrote:
>> > On Tue, Jul 15, 2008 at 4:01 PM, Diego A. <[EMAIL PROTECTED]> wrote:
>> > > Hi Chris,
>> >
>> > > AJAX:
>> > >> Yeah actually I think it's normally 

[jQuery] Re: NEW: XML to JSON Plugin

2008-07-15 Thread chris thatcher
On Tue, Jul 15, 2008 at 4:01 PM, Diego A. <[EMAIL PROTECTED]> wrote:

> Hi Chris,
>
> AJAX:
>> Yeah actually I think it's normally sufficient to let the user use jquery
>> ajax as usual but just provide easy functions to unmarshal/marshal into the
>> format they need where ever they need it.  It reduces the size of the plugin
>> and I've sort of found most ajax-convenience functions in plugins aren't
>> exactly what I need so I end up not using them anyway.  Not always true
>> though and if you think there some benefit I really don't feel very strongly
>> either way (just playing devils advocate.)
>>
>
> We need not re-invent the wheel. I think it would be fair to assume users
> of this plugin will have a certain amount of experience and would be quite
> capable (and would probably prefer) to write their own ajax calls, like
> this...
> $.get(url2xml, function(response){
>  var json = $.xml2json(response);
>  // do stuff
> });
>

>
> Having said that, it would be very easy to assume that an ajax call is
> required when a function is sent in one of the parameters, for example:
> $.xml2json(url2xml, function(json){
>  // do stuff
> });
> ... which doesn't really save (or cost) much time (or code) but it provides
> a simple little hook for Ajax calls. :-D
>
+1


>
> FORMAT:
>> Where it really became an issue in a production environment was that I
>> always had to test every 'element' to see if i needed to treat it as an
>> array or object.  And every time I started to rely on it being an {} or [],
>> there was some corner case that came up gave me the other and the code
>> broke.  This is especially true in templates.
>>
>
> OK, my current implementation allows you to choose between 2 formats:
> simple - arrays when necessary
> extended - always use arrays
> ...isn't that enough to solve the problem of not knowing what to expect? In
> your case for example, just use extended mode and you're good to go. I just
> can't see a scenario where the user of this plubing would insist of choosing
> specific formatting options for different 'branches'... Am I being
> un-reasonble?
>
I didnt realize there was that option. it is sufficient though I'd argue
from the perspective of the user the latter is simple and the former not so
much..   looking forward to you later comments I'm wondering if it wouldnt
be a big win to make it all array all the time. it would definitely fit
better in terms of making it jive with a jquery feel.

>
> Serialization/De-serialization:
>
> I see what you're saying and it seems great. I'd have to figure out how to
> make this work, but I have had an idea which might just do the job. In the
> documentation, I wrote a script that goes through the json object and
> represents it in HTML. That same script could be used to create a 'map' of
> the json structure. This map could be an array OR maybe even better, a
> simple string with the path ("reference") to every node in the structure.
> Something like this:
>
> Consider this XML:
> 
>  
>   RED
>   WHITE
>   24 INCH
>  
>  
>   BROWN
>   50 INCH
>  
> 
>
> Which would result in the following map...
> JSON MAP: [
>  "kitchen", "kitchen.dishwasher", "kitchen.fridge", "kitchen.telly",
>   "lounge", "lounge.sofa", "lounge.telly"
> ]
>
> That way we could come up with some xpath-like markup to search through
> nodes just like you suggested...
> json.find('dishwasher') // gives us array with nodes kitchen.dishwasher
> json.find('dvd') // gives us an empty array
> json.find('telly') // gives us array with nodes kitchen.telly and
> lounge.telly.
>
> $.each(json.find('telly'), function(i, node){
>  // 1st - kitchen.telly node
>  // 2nd - lounge.telly node
> });
>
> How does that sound???
>
This is pretty much what I'm thinking but I want to point out none of your
examples use attributes and as a long time xml advocate if I wrote a similar
example it would look like:

 
 


We can't advocate sensible xml but can you see how this saves big bandwidth
and maps more cleanly to json?  Again not really an implementation issue but
might as make sure we know how to represent attribute.  Though I'm also a
big user of namespaces I'd say treat them like common attributes an let the
developer cope with meaning.

I think we could really get some high performance by building the Map you
talk about and implement find as a pure RegExp.  I like the way you are
keeping it simple an jquery ish.



> Cheers,
> Diego A.

[jQuery] Re: NEW: XML to JSON Plugin

2008-07-15 Thread chris thatcher
On Tue, Jul 15, 2008 at 10:18 AM, Diego <[EMAIL PROTECTED]> wrote:

>
> Hi Chris,
>
> I'd be glad to work on this with you. Unfortunately, I'm completely
> tied up with a couple of other projects for the next few days. I won't
> have a chance to work on the next version, but I'll let I know as soon
> as I make some changes.

Same boat here so we can organize a little then push forward.


>
>
> AJAX:
> Although I released this as a jQuery plugin, it doesn't actually make
> any use of jQuery functionality, other than the $.each function. But
> as you suggested, it does make sense to integrate it with jQuery a bit
> further and to include ajax.
>
Yeah actually I think it's normally sufficient to let the user use jquery
ajax as usual but just provide easy functions to unmarshal/marshal into the
format they need where ever they need it.  It reduces the size of the plugin
and I've sort of found most ajax-convenience functions in plugins aren't
exactly what I need so I end up not using them anyway.  Not always true
though and if you think there some benefit I really don't feel very strongly
either way (just playing devils advocate.)


> FORMAT:
> As far as formatting is concerned, I understand that you'd like the
> output to follow a certain format, but is this really something that
> is worth working on? Isn't what I've got at the moment enough, ie.:
> use arrays only when necessary OR always use arrays. Is there really a
> need to specify which nodes should be arrays and which shouldn't?

Where it really became an issue in a production environment was that I
always had to test every 'element' to see if i needed to treat it as an
array or object.  And every time I started to rely on it being an {} or [],
there was some corner case that came up gave me the other and the code
broke.  This is especially true in templates.

>
>
> Serialization/De-serialization:
> I like the idea (like the firefox about:config page), but what affect
> would this have on memory? ie.: by doing this, wouldn't we essentially
> double memory usage by storing every value in data['a.b.c'] as well as
> data.a.b.c?
>
They are actually different objects so you'ld have myJsonObject.a.b.c and
myRejosnObject['a.b.c'].  Normally how I use it is I only use json form in
code, but marshal to/from the rejson  when serializing to/from sqlite, and
marshal to/from the xml form when serializing to/from the server. But this
was just my use case.  In general the idea is that only one form is present
in memory at a time, but it's easy to move between them when I need to.  So
if I wanted to provide a nice table to edit an object, I could retreive that
object as rejson from the db and I'd just leave it in the same form or if it
came as xml from the server I'd marshal directly to rejson, skip json, and
delete the xml footprint.  In the end I think the marshalling performance is
what we focus on and let the user decide when they need delete objects.

Just some thoughts.  I'll try to clean up some older example code.  I also
think it might be worth thinking about how Ariels jquery.collections and
something like jspath could be used to provide some more jquery-like,
e4x-ish approach so we could have

var data = jqE4X(xml);//basically marshals to json
jqE4X('a..c', data).each(function(){
  //etc gives us an array of all decendants 'c' of data.a
});

Or is this not at all what you have in mind?

Thatcher


> Again, thank you for your interest in this project. I look forward to
> your reply...
>
> Cheers,
> Diego A.
>
> On Jul 8, 12:11 am, "chris thatcher" <[EMAIL PROTECTED]>
> wrote:
> > yeah it would be great to see it ported to a jQuery plugin in combination
> > with your work and then you could actually use jQuery ajax and it would
> be
> > cleaner.  I've used it a lot and for me the big thing is the ability to
> easy
> > set what elements are treated as array's even if only one is present
> > (because it keeps the code using it simpler, less cases), and specifying
> the
> > attribute prefix (I use '@') because I can basically use e4x like syntax.
> >
> > I also made a modification to xotree locally to allow a flat
> > serialization/deserialization so that the item becomes a list of
> name/value
> > objects, the name being the 'javascript path' eg '[EMAIL PROTECTED]' and
> the
> > value is the simple value.  This was extremely useful for fast
> development
> > with GoogleGears because I could have a generic table for all objects and
> > use the powerful 'name LIKE' queries to find objects stored in the db.
> >
> > I'd love to h

[jQuery] Re: NEW: XML to JSON Plugin

2008-07-07 Thread chris thatcher
yeah it would be great to see it ported to a jQuery plugin in combination
with your work and then you could actually use jQuery ajax and it would be
cleaner.  I've used it a lot and for me the big thing is the ability to easy
set what elements are treated as array's even if only one is present
(because it keeps the code using it simpler, less cases), and specifying the
attribute prefix (I use '@') because I can basically use e4x like syntax.

I also made a modification to xotree locally to allow a flat
serialization/deserialization so that the item becomes a list of name/value
objects, the name being the 'javascript path' eg '[EMAIL PROTECTED]' and the
value is the simple value.  This was extremely useful for fast development
with GoogleGears because I could have a generic table for all objects and
use the powerful 'name LIKE' queries to find objects stored in the db.

I'd love to help you develop this or give feedback because it would also
help promote some mvc stuff I'm build for the jQ community.

Thatcher

On Mon, Jul 7, 2008 at 6:59 PM, Diego <[EMAIL PROTECTED]> wrote:

>
> Hi Chris,
>
> I hadn't seen xotree before, but I found it...
> http://www.kawa.net/works/js/xml/objtree-e.html
> ...and looking at the examples, it seems to behave exactly like my
> plugin but it's more flexible with options and built-in ajax support.
>
> It's definitelly a good base for future development of my plugin...
>
> Cheers,
> Diego A.
>
> On Jul 7, 8:10 pm, "chris thatcher" <[EMAIL PROTECTED]>
> wrote:
> > Have you looked at xotree.js ?  Nice work.
> >
> >
> >
> > On Mon, Jul 7, 2008 at 10:30 AM, Alexsandro_xpt <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hi Diego,
> >
> > > I mean ( 1 )
> >
> > > I Know, but would be something like that Diego > > name> already great. :)
> >
> > > Nice plugin.!!
> >
> > > On 5 jul, 00:06, Diego <[EMAIL PROTECTED]> wrote:
> > > > Hi Alexsandro,
> >
> > > > Do you mean
> > > > (1)"convert the generate JSON back to XML"?
> > > > OR...
> > > > (2)"define a javascript object and convert it to XML"?
> >
> > > > If (1):
> > > > I initially built this plugin for my personal use (for my
> > > > "convenience") so I could easily process XML data. Because of that, I
> > > > didn't bother to differentiate between attributes / nodes. ie.:
> > > > Diego
> > > > ...gives the same output as this...
> > > > 
> > > > ...so it would be impossible to "reverse the conversion".
> >
> > > > If (2):
> > > > This is quite easy. And actually, it would be pretty similar to the
> > > > code I wrote to show the JSON structure in HTML (Under Examples >
> > > > Basic/Extended Structure)
> >
> > > > I will write this when I get a chance, but I'd rather wait for the
> > > > feedback on this plugin to work out the best way to do it...
> >
> > > > Cheers,
> > > > Diego
> >
> > > > Alexsandro_xpt wrote:
> > > > > Very good!!!
> >
> > > > > Are possible to do reverse?
> >
> > > > > --
> > > > > Alexsandro
> > > > >www.alexsandro.com.br
> >
> > > > > On 4 jul, 12:34, Diego <[EMAIL PROTECTED]> wrote:
> > > > > > I wrote this a few months but didn't have the time to share it.
> Now
> > > > > > that I've re-done the documentation for 2 of my plugins I thought
> I'd
> > > > > > give it a few hours, knock some examples together and share it
> with
> > > > > > the whole world (ok, maybe just a few people).
> >
> > > > > > Basic example:
> > > > > > var xml = 'Hello world';
> > > > > > var json = $.xml2json(xml);
> > > > > > alert(json.message); // shows "Hello world"
> >
> > > > > > Ajax example:
> > > > > > var file = 'data/hello.xml'; //Hello
> world > > > > > xml>
> > > > > > $.get(file, function(xml){
> > > > > > �var json = $.xml2json(xml);
> > > > > > �alert(json.message);
> >
> > > > > > });
> >
> > > > > > See the documentation page for more examples and demos.
> > > > > > XML to JSON Plugin -http://fyneworks.com/jquery/xml-to-json/
> >
> > > > > > As always, feedback is welcome!
> >
> > > > > > Cheers,
> > > > > > Diego
> >
> > --
> > Christopher Thatcher
>



-- 
Christopher Thatcher


[jQuery] Re: NEW: XML to JSON Plugin

2008-07-07 Thread chris thatcher
Have you looked at xotree.js ?  Nice work.

On Mon, Jul 7, 2008 at 10:30 AM, Alexsandro_xpt <[EMAIL PROTECTED]> wrote:

>
> Hi Diego,
>
> I mean ( 1 )
>
> I Know, but would be something like that Diego name> already great. :)
>
>
> Nice plugin.!!
>
>
>
> On 5 jul, 00:06, Diego <[EMAIL PROTECTED]> wrote:
> > Hi Alexsandro,
> >
> > Do you mean
> > (1)"convert the generate JSON back to XML"?
> > OR...
> > (2)"define a javascript object and convert it to XML"?
> >
> > If (1):
> > I initially built this plugin for my personal use (for my
> > "convenience") so I could easily process XML data. Because of that, I
> > didn't bother to differentiate between attributes / nodes. ie.:
> > Diego
> > ...gives the same output as this...
> > 
> > ...so it would be impossible to "reverse the conversion".
> >
> > If (2):
> > This is quite easy. And actually, it would be pretty similar to the
> > code I wrote to show the JSON structure in HTML (Under Examples >
> > Basic/Extended Structure)
> >
> > I will write this when I get a chance, but I'd rather wait for the
> > feedback on this plugin to work out the best way to do it...
> >
> > Cheers,
> > Diego
> >
> > Alexsandro_xpt wrote:
> > > Very good!!!
> >
> > > Are possible to do reverse?
> >
> > > --
> > > Alexsandro
> > >www.alexsandro.com.br
> >
> > > On 4 jul, 12:34, Diego <[EMAIL PROTECTED]> wrote:
> > > > I wrote this a few months but didn't have the time to share it. Now
> > > > that I've re-done the documentation for 2 of my plugins I thought I'd
> > > > give it a few hours, knock some examples together and share it with
> > > > the whole world (ok, maybe just a few people).
> >
> > > > Basic example:
> > > > var xml = 'Hello world';
> > > > var json = $.xml2json(xml);
> > > > alert(json.message); // shows "Hello world"
> >
> > > > Ajax example:
> > > > var file = 'data/hello.xml'; //Hello world > > > xml>
> > > > $.get(file, function(xml){
> > > > �var json = $.xml2json(xml);
> > > > �alert(json.message);
> >
> > > > });
> >
> > > > See the documentation page for more examples and demos.
> > > > XML to JSON Plugin -http://fyneworks.com/jquery/xml-to-json/
> >
> > > > As always, feedback is welcome!
> >
> > > > Cheers,
> > > > Diego
>



-- 
Christopher Thatcher


[jQuery] Re: Shadowbox 2.0rc1

2008-07-02 Thread chris thatcher
I'm not advocating Shadowbox because I have nothing to do with it's
development, but I have been studying it and I think it's probably worth 20
buckaroos if your developing a commercial site (otherwise it's free!)

Thatcher

On Wed, Jul 2, 2008 at 4:18 AM, Gordon <[EMAIL PROTECTED]> wrote:

>
> I was having a few problems with the first shadowbox and was
> interested to see if there were additions that would get me around
> them, but it seems the license has changed and I don't think I can get
> my employer to fork out for a license as money is currently very
> tight.
>
> On Jul 1, 5:44 pm, "Michael J. I. Jackson" <[EMAIL PROTECTED]>
> wrote:
> > If you're using the Shadowbox jQuery plugin, it has been updated. The
> > new version features increased flexibility and stability for various
> > media types. It also includes much better support for i18n and
> > skinning. Just wanted to let you know in case you are using it.
>



-- 
Christopher Thatcher


[jQuery] Re: expr in $("", expr) not as expected

2008-07-02 Thread chris thatcher
Hi Rob, It's an easy issue to confuse at first so don't worry.  the expr
parameter is treated as a top level context and the query you're using,
'div', is actually saying 'find any descendant divs UNDER the top level
context'.  Now to help you figure out what query might possible to discern
one of the divs we could probably use a filter or something but I'd have to
know what you're criteria are.  Hope this gets you started.

Thatcher

On Wed, Jul 2, 2008 at 7:57 AM, [rob desbois] <[EMAIL PROTECTED]> wrote:

>
> Hi, have a feeling this may be a silly question but here goes..
>
> Test output from Firebug's console is below to explain my issue.
>
> I select an array of divs by their parent:
> >>> divs = $("#sidebar > div").get()
> [div#sidebar-search-tabcont, div#sidebar-events-tabcont]
>
> I then want to find a particular one:
> >>> $("div", divs)
> Object length=0 prevObject=Object jquery=1.2.6
>
>
> Given that the 'expr' parameter to $(...) contains an array of divs,
> why is using the selector "div" not returning anything from that?? Am
> I misunderstanding expr?
>
> Confused...
> --rob
>



-- 
Christopher Thatcher


[jQuery] Re: Don't redirect on form submit

2008-06-29 Thread chris thatcher
yup, that should do it!

On Sun, Jun 29, 2008 at 3:58 PM, Sid <[EMAIL PROTECTED]> wrote:

>
> Another point, how do I bind it since my form is loaded into the div?
>
> Will this work
>
> $('#myForm').livequery(function() {
> $(this).bind('submit', function () {
> ...
>     ...
> });
> })
>
> On Jun 29, 8:18 am, "chris thatcher" <[EMAIL PROTECTED]>
> wrote:
> > Hi Sid,
> >
> > The really important thing is that you'll need to 'hijax' the form and
> make
> > sure you provent the default behavior of the browser.  jQuery makes this
> > terribly easy.
> >
> > jQuery("#myform").bind('submit', function(event){
> >  //stops browser from submitting the form
> >  //and redirecting.
> >  event.preventDefault();
> >  //use jquery form plugin to submit via ajax here or do it by hand
> >
> > });
> >
> > Thatcher
> >
> >
> >
> > On Sat, Jun 28, 2008 at 10:59 PM, Bil Corry <[EMAIL PROTECTED]> wrote:
> >
> > > Sid wrote on 6/28/2008 8:31 PM:
> >
> > >> What I basically want to achieve is that on clicking the submit
> > >> button, the data is posted to the php file without any noticeable
> > >> difference happening to my page. The response etc will be taken care
> > >> of by my code. Any ideas?
> >
> > > If you submit the request via XHR, then the page can remain the same
> (with
> > > the div refreshed) while the data is sent to the server.  Just note
> that if
> > > your site is entirely driven from a single page using XHR, then I hear
> you
> > > should be careful of memory leaks; not sure how relevant that advice is
> > > anymore with the newer browsers.
> >
> > > - Bil
> >
> > --
> > Christopher Thatcher
>



-- 
Christopher Thatcher


[jQuery] Re: Jquery and using regex in selectors

2008-06-29 Thread chris thatcher
Actually jQuery supports a subset of of regular expression-like filters.
Check out:

http://docs.jquery.com/Selectors

and look at the 'Attribute Filters'

This would achieve the case you need with

jQuery("input[name*='name']")

Thatcher

On Sun, Jun 29, 2008 at 1:31 AM, Ramanathan RV <[EMAIL PROTECTED]>
wrote:

> How about allowing regex in jquery selectors?
> For instance $("input[name="*name"])
> to select
> 
> 
>
> Typically in forms, most of the components are bundles. Like Names,
> Addresses, etc. One use case that I could think of is setting validators on
> all these fields would be easier with support for regex.
>
> --
> Thanks
> Ram




-- 
Christopher Thatcher


[jQuery] Re: Don't redirect on form submit

2008-06-29 Thread chris thatcher
Hi Sid,

The really important thing is that you'll need to 'hijax' the form and make
sure you provent the default behavior of the browser.  jQuery makes this
terribly easy.

jQuery("#myform").bind('submit', function(event){
 //stops browser from submitting the form
 //and redirecting.
 event.preventDefault();
 //use jquery form plugin to submit via ajax here or do it by hand
});

Thatcher

On Sat, Jun 28, 2008 at 10:59 PM, Bil Corry <[EMAIL PROTECTED]> wrote:

>
> Sid wrote on 6/28/2008 8:31 PM:
>
>> What I basically want to achieve is that on clicking the submit
>> button, the data is posted to the php file without any noticeable
>> difference happening to my page. The response etc will be taken care
>> of by my code. Any ideas?
>>
>
> If you submit the request via XHR, then the page can remain the same (with
> the div refreshed) while the data is sent to the server.  Just note that if
> your site is entirely driven from a single page using XHR, then I hear you
> should be careful of memory leaks; not sure how relevant that advice is
> anymore with the newer browsers.
>
> - Bil
>
>


-- 
Christopher Thatcher


[jQuery] Re: jtemplates performance

2008-06-27 Thread chris thatcher
Hi Andiih, I had one more thought.  I don't usually setTemplateURL abd
ibstead use setTemplateElement and have the template locally in a hidden
text area.  I was wondering if it might be the difference because of the
network communication that occurs in your case.  Might be worth a try to see
if thats the extra time drain.

Also JavaScriptTemplates from trimpath is a really great template engine as
well and really not too different syntatically than jTemplate so you should
be able to modify your templates relatively easily to use them if that what
you decide to do.

On Fri, Jun 27, 2008 at 5:53 AM, Andiih <[EMAIL PROTECTED]> wrote:

>
> Machine A
> FF3 xml to json 1380, Template Processing 619
> IE6 xml to json 1782, Template Processing 22593
>
> Machine B
> IE7 xml to json 765, Template Processing 8579
> FF2 xml to json 2094, Template Processing 1492
> FF3 Beta xml to json 1151, Template Processing 1054
>
> Machine C
> IE 7 Xml to json 1187, Template Processing 9344
> FF 2 Xml to json 3281, Template Processing 1328
>
> OK - its the tempaltes.  Will try the other template engine above...or
> perhaps I should consider xml/xsl and skip the json step ? I think I
> saw a jQuery xls processor somewhere...
>
> On Jun 27, 12:03 am, "chris thatcher" <[EMAIL PROTECTED]>
> wrote:
> > I think you are measuring the combined time. Try this:
> >
> > var xmltojson_start = new Date().getTime();
> > ret = $.xmlToJSON(responseXML);
> > var xmltojson_stop = new Date().getTime();
> >
> > var template_start = new Date().getTime();
> > $('#output2').processTemplate(ret);
> > var template_stop = new Date().getTime();
> > alert(""+
> >   "\n\tXml to Json: " + (xmltojson_stop - xmltojson_start) +
> >   "\n\tTemplate Processing: " + (template_stop - template_start)
> +
> > "\n");
> >
> >
> >
> > On Thu, Jun 26, 2008 at 4:36 PM, Andiih <[EMAIL PROTECTED]> wrote:
> >
> > > Jack, I'll take a look
> > > Chris, I *think* the timing code I've added in my sample above is only
> > > timing the template step ?
> >
> > > I've had the opportunity to try this out this afternoon on a number of
> > > machines in the organization, and noted a couple of things...
> > > Its quick in FF3 (which I didn't expect given what I have been
> > > reading)
> > > Its *usually* a lot slower in IE than FF, but some machines are the
> > > opposite.
> >
> > > So, I need to revise the question : what browser configuration
> > > changes, plugins, settings etc might make a *huge* difference to inter-
> > > browser performance ?
> >
> > > I'll see if JavaScriptTemplates looks like I can integrate it, and re-
> > > test.
> >
> > > TIA
> >
> > > Andrew
> >
> > > On Jun 26, 6:02 pm, "chris thatcher" <[EMAIL PROTECTED]>
> > > wrote:
> > > > Andiih, just curious becuase I use jtemplates and havent seen that
> issue,
> > > > though can you verify that the slow code is not 'xmlToJSON'.  I have
> seen
> > > > the marshalling process take up a lot of time in IE when the xml is
> > > > substantial in size .
> >
> > > > Thatcher
> >
> > > > On Thu, Jun 26, 2008 at 12:30 PM, Jack Killpatrick <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > I don't know how it compares as far as speed, but you might want to
> try
> > > > > this:
> >
> > > > >http://code.google.com/p/trimpath/wiki/JavaScriptTemplates
> >
> > > > > We've been using it for more than a year on many of our projects,
> > > including
> > > > > some with large table row outputs, and it's worked for us.
> >
> > > > > - Jack
> >
> > > > > Andiih wrote:
> >
> > > > >> I am using jTemplates (jquery-jtemplates.js) to render a large xml
> > > > >> response by running xmlToJSON then processTemplate.  Although the
> code
> > > > >> works fine, and performance in FF2.0 is acceptable (2672ms) on my
> test
> > > > >> system, I am getting a result of 9827ms when running in IE7.  Is
> there
> > > > >> a known performance issue with jtemplates ?  Are other templte
> modules
> > > > >> better ?
> >
> > > > >> (p.s. the real world code uses jQuery Form plugin and web
> services,
> > > > >> but the sample below reproduces the issue)
> >
> > > > >> Code, and template follow.
> >
> > > > > ... snip...
> >
> > > > --
> > > > Christopher Thatcher
> >
> > --
> > Christopher Thatcher
>



-- 
Christopher Thatcher


[jQuery] Re: jtemplates performance

2008-06-26 Thread chris thatcher
I think you are measuring the combined time. Try this:

var xmltojson_start = new Date().getTime();
ret = $.xmlToJSON(responseXML);
var xmltojson_stop = new Date().getTime();

var template_start = new Date().getTime();
$('#output2').processTemplate(ret);
var template_stop = new Date().getTime();
alert(""+
  "\n\tXml to Json: " + (xmltojson_stop - xmltojson_start) +
  "\n\tTemplate Processing: " + (template_stop - template_start) +
"\n");


On Thu, Jun 26, 2008 at 4:36 PM, Andiih <[EMAIL PROTECTED]> wrote:

>
> Jack, I'll take a look
> Chris, I *think* the timing code I've added in my sample above is only
> timing the template step ?
>
> I've had the opportunity to try this out this afternoon on a number of
> machines in the organization, and noted a couple of things...
> Its quick in FF3 (which I didn't expect given what I have been
> reading)
> Its *usually* a lot slower in IE than FF, but some machines are the
> opposite.
>
> So, I need to revise the question : what browser configuration
> changes, plugins, settings etc might make a *huge* difference to inter-
> browser performance ?
>
> I'll see if JavaScriptTemplates looks like I can integrate it, and re-
> test.
>
> TIA
>
> Andrew
>
>
> On Jun 26, 6:02 pm, "chris thatcher" <[EMAIL PROTECTED]>
> wrote:
> > Andiih, just curious becuase I use jtemplates and havent seen that issue,
> > though can you verify that the slow code is not 'xmlToJSON'.  I have seen
> > the marshalling process take up a lot of time in IE when the xml is
> > substantial in size .
> >
> > Thatcher
> >
> >
> >
> > On Thu, Jun 26, 2008 at 12:30 PM, Jack Killpatrick <[EMAIL PROTECTED]>
> wrote:
> >
> > > I don't know how it compares as far as speed, but you might want to try
> > > this:
> >
> > >http://code.google.com/p/trimpath/wiki/JavaScriptTemplates
> >
> > > We've been using it for more than a year on many of our projects,
> including
> > > some with large table row outputs, and it's worked for us.
> >
> > > - Jack
> >
> > > Andiih wrote:
> >
> > >> I am using jTemplates (jquery-jtemplates.js) to render a large xml
> > >> response by running xmlToJSON then processTemplate.  Although the code
> > >> works fine, and performance in FF2.0 is acceptable (2672ms) on my test
> > >> system, I am getting a result of 9827ms when running in IE7.  Is there
> > >> a known performance issue with jtemplates ?  Are other templte modules
> > >> better ?
> >
> > >> (p.s. the real world code uses jQuery Form plugin and web services,
> > >> but the sample below reproduces the issue)
> >
> > >> Code, and template follow.
> >
> > > ... snip...
> >
> > --
> > Christopher Thatcher
>



-- 
Christopher Thatcher


[jQuery] Re: QUnit, jqUnit, and rhino

2008-06-26 Thread chris thatcher
Wow this is good news.  I've been mucking up env.js for awhile now locally
and was afraid I wouldn't see it go where I hope it will.

John you mentioned the other platforms you want it to be used on and I think
this would be ideal.  One thing that is currently preventing that is that
the basic window code, which essentially emulates the browsers behavior and
provides the standard global functions and objects available in browsers, is
mixed with Java specific code.  If env.js has these provided by the
container, eg rhino jar + 'implementation of xmlhttprequest jar', then
env.js could stay generic across all the implementations.  It's a little
more work but inverts the control so env.js could be used by
javascript/spidermonkey  to emulate the browser as well.  This doesnt really
help perl/python but might keep the patterns clearer.

So I guess what I'm asking is, for the javascript 'env.js' is it worth it to
abstract so the same script could be used across javascript engines?  A
simple way to achieve this is to use 'providers' which are just aliases to
implementations:
- in env.js -
window.XMLHttpRequest = Env.XMLHttpRequest;

- in rhino.env.js -
Rhino = {
XMLHttpRequest = function()...
};
EnvProvider.XMLHttpRequest = RhinoEnv.XMLHttpRequest;

allows you to include a second script, say 'rhino.env.js' , to keep env.js
reusable in spidermonkey?

Thatcher

On Thu, Jun 26, 2008 at 11:00 AM, fuzziman <[EMAIL PROTECTED]> wrote:

>
>
> So excited to see that you are actively working on this John! :-)
>
> I can see you've been concentrating on document parsing behavior, while
> I've
> just been looking at "automated testing in rhino". From my testing
> perspective, I made a couple of patches:
> - in test(), wrapping fn() and the next lines in try/catch/fail, so tests
> don't fail silently but get logged
> - as part of testrunner's results() method, quit with error code if there
> was a failure, so ant build can stop if a failure occurred.
>
> I also patched another bug (I'm not sure whether you experience this bug
> too..)
> $.get callback wasn't being called.
> I tracked it down to the setInterval/clearInterval code.
> 2 problems:
> - the very first setInterval returns 0, which evaluates to false in jquery,
> and so timer will never be stopped, because in jquery you doif (ival)
> - as soon as stop() is called, the entire rhino engine stops! not sure
> why. stop() is deprecated anyway. easy workaround though, I changed it
> to use the standard java runnable stop pattern of checking a local variable
> and returning:
>
>
> //--
>// Timers
>
>var timers = [{}];
>
>window.setTimeout = function(fn, time){
>var num;
>return num = setInterval(function(){
>fn();
>clearInterval(num);
>}, time);
>};
>
>window.setInterval = function(fn, time){
>var num = timers.length;
>var isRunning = true;
>var timerObj = {
>thread: new java.lang.Thread(new
> java.lang.Runnable({
>run: function(){
>while (isRunning){
>
>  java.lang.Thread.currentThread().sleep(time);
>fn();
>}
>}
>})),
>stop: function() {isRunning = false;}
>};
>timers[num] = timerObj;
>timers[num].thread.start();
>
>return num;
>};
>
>window.clearInterval = function(num){
>if ( timers[num] ) {
>timers[num].stop();
>delete timers[num];
>}
>};
>
> //--
>
> If you like, I can keep posting my findings on this thread as I find them.
> Once again, good to see you working on env.js, its amazing!
> Keep up the good work John!
>
>
>
>
>
> John Resig wrote:
> >
> > I'm working on this (well, trying to get more of the jQuery test suite
> > to pass). I've broken it out into a separate project here:
> > http://github.com/jeresig/env-js/tree/master
> >
>
> --
> View this message in context:
> http://www.nabble.com/jQuery-test-suite-and-jsUnit-compatibility-tp15882865s27240p18136064.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.
>
>


-- 
Christopher Thatcher


[jQuery] Re: jtemplates performance

2008-06-26 Thread chris thatcher
Andiih, just curious becuase I use jtemplates and havent seen that issue,
though can you verify that the slow code is not 'xmlToJSON'.  I have seen
the marshalling process take up a lot of time in IE when the xml is
substantial in size .

Thatcher

On Thu, Jun 26, 2008 at 12:30 PM, Jack Killpatrick <[EMAIL PROTECTED]> wrote:

>
> I don't know how it compares as far as speed, but you might want to try
> this:
>
> http://code.google.com/p/trimpath/wiki/JavaScriptTemplates
>
> We've been using it for more than a year on many of our projects, including
> some with large table row outputs, and it's worked for us.
>
> - Jack
>
> Andiih wrote:
>
>> I am using jTemplates (jquery-jtemplates.js) to render a large xml
>> response by running xmlToJSON then processTemplate.  Although the code
>> works fine, and performance in FF2.0 is acceptable (2672ms) on my test
>> system, I am getting a result of 9827ms when running in IE7.  Is there
>> a known performance issue with jtemplates ?  Are other templte modules
>> better ?
>>
>> (p.s. the real world code uses jQuery Form plugin and web services,
>> but the sample below reproduces the issue)
>>
>> Code, and template follow.
>>
>>
>>
> ... snip...
>
>


-- 
Christopher Thatcher


[jQuery] Re: Welcome to Ariel Flesler

2008-05-13 Thread chris thatcher
I knew when I saw Ariel's plugins and outside work that he'd be on the team
eventually.

Congratulations.

On Tue, May 13, 2008 at 4:30 PM, John Resig <[EMAIL PROTECTED]> wrote:

>
> Everyone -
>
> I'd like to take this opportunity to welcome Ariel Flesler to the
> jQuery Dev Team. He's put a ton of work in on the upcoming jQuery
> 1.2.4 release, in addition to releasing numerous plugins. His
> contributions have been quite valuable and it's an honor to have him
> aboard.
>
> His site:
> http://flesler.blogspot.com/
>
> His Twitter Account:
> http://twitter.com/flesler
>
> --John
>
> (Note: Thanks to Ariel's help, the 1.2.4 release should be arriving
> within the next day or two - pending any final patches.)
>



-- 
Christopher Thatcher