[jQuery] Re: question about plugin programming

2008-04-19 Thread J Moore
Hi Rene, I've never quite understood the benefits to the plugin approach, when you can simply create an object that uses jquery. (I've wondered about this before on the list, but so far no one has enlightened me.) function Animator(container) { this.jC = container; // this is a jquery

[jQuery] Re: Passing variables between two functions

2008-04-12 Thread J Moore
looks good. pointX is a global variable and can be accessed by both functions. What's the problem? On Apr 11, 6:13 am, Decagrog [EMAIL PROTECTED] wrote: Hi all, I've a newbie question about variable scope...essentially i've two anonimous function and i need to retrieve a variable generated

[jQuery] Re: How do I use ColdFusion and jQuery variables for pagination?

2008-04-12 Thread J Moore
Calling a $.get() on each page change click kind of defeats the point of doing client-side paging. It will be basically be as slow as reloading an entire new page (and you have to add some UI to show that the page is 'loading...). If your db has 10,000 rows, then agreed, you won't want to dump

[jQuery] Re: Slow tabs

2008-04-09 Thread J Moore
Try creating a test page with only the js code needed for the tabs. As for keeping content hidden during loading, I like to use a css class called hidden. /* css */ .hidden { display: none; } /* html */ div class=foo hiddenI am hidden/div On Apr 8, 1:54 pm, Glen Lipka [EMAIL PROTECTED]

[jQuery] Re: what wrong in code?

2008-04-09 Thread J Moore
infinite loop? getready() calls sendsite() which calls getready() which calls sendsite()... On Apr 8, 4:06 pm, R.O.M. [EMAIL PROTECTED] wrote: This code doesn't work in all browsers exept firefox. Why and what i must to do? Trouble: when button with id=newsitesubmit was pressed there is no

[jQuery] Re: Logic issue - can jQuery help?

2008-04-03 Thread J Moore
I've used an object to 'cache' jquery instances. Works great. I've also used id strings to pack data. like div id=x45-64 where the 'x' is because id's shouldn't be numeric. And the other numbers might be your employee id or task id. I find this id method ugly, and would rather use a javascript

[jQuery] Re: callbacks calling callbacks calling callbacks ....

2008-03-09 Thread J Moore
were referring tooo, but I think he was alluding to similar situations...) Shawn J Moore wrote: Regarding your example of waiting for N records to come back, it is definitely worth it to pack all those requests into a single AJAX/JSON request. Not only are you saving the overhead

[jQuery] Re: basic Show Hide icon

2008-03-08 Thread J Moore
return false; is your friend. I find i have to add it to almost every click() and submit() event. e.g. $('#toggletandc').click(function(){ $('div.showhide,div#tandc').toggle(); return false; }); On Mar 7, 6:40 pm, SparrowDog [EMAIL PROTECTED] wrote: I am using the Basic Show Hide

[jQuery] Re: callbacks calling callbacks calling callbacks ....

2008-03-08 Thread J Moore
direction. Now I'm curious though and want to try out some things... I'll report back if I have any success... Shawn h0tzen wrote: On 5 Mrz., 15:40, J Moore [EMAIL PROTECTED] wrote: wouldn't nesting the methods work? e.g. unfortunately not as some methods have to be invoked

[jQuery] Re: help with a strategy?

2008-03-05 Thread J Moore
Much like how jquery keeps the javascript out of the HTML, it's so much cleaner to keep PHP out of the HTML as well. Have a look at the Smarty templating system for PHP. It's awesome. -j On Mar 4, 11:20 am, charlie [EMAIL PROTECTED] wrote: Hi all, the application I'm attempting to write

[jQuery] Re: Plugin Authoring Help pt 2

2008-03-05 Thread J Moore
You might find it easier to simply create objects that use jquery, instead of writing a jquery plugin. The biggest advantage is that you actually have a normal instance of an object. You can pass this instance to other objects, call other methods on it... all the usual good stuff. (jquery

[jQuery] Re: JQuery Hello world not working

2008-03-05 Thread J Moore
actually, your code doesn't display a link. it sets up an action when the link is clicked. You're missing: a href=#do something/a There might be other problems too if you aren't even seeing the alert message. Download firefox and firebug. IE isn't much help for developing javascript. -j On

[jQuery] Re: callbacks calling callbacks calling callbacks ....

2008-03-05 Thread J Moore
wouldn't nesting the methods work? e.g. script type=text/javascript $('#comp1').trigger('load.comp1', function() { $('#comp2').trigger('load.comp2', function() { $('#comp3').trigger('load.comp3', function() { if (action2()) { // do business logic...

[jQuery] Re: .html() callback?

2008-03-05 Thread J Moore
I think the OP is adding elements to the dom, and then wondering why the events for the new elements aren't working. after adding elements with .html(), you need to add the events. For example, adding an anchor: $(#header).html('a href=#yo/a').find('a').click(function() { alert('click');

[jQuery] Re: JQuery Hello world not working

2008-03-05 Thread J Moore
wow, the lag on this list is brutal. is there any way of reducing it, so people don't spend time responding to already-answered questions? On Mar 5, 9:34 am, J Moore [EMAIL PROTECTED] wrote: actually, your code doesn't display a link. it sets up an action when the link is clicked. You're

[jQuery] Re: Div Changer Using Hide And Show

2008-02-22 Thread J Moore
good tips so far. I just wanted to add that using classes and ids works well. a href=# id=blackbook class=showshow blackbook/a a href=# id=redbook class=showshow redbook/a div class=book hidden id=blackbook-contentblackbook stuff.../ div div class=book hidden id=redbook-contentredbook

[jQuery] Re: a small accessibility rant

2008-02-14 Thread J Moore
Well, a pixel could be a tiny dot or it could be 5mm. So, really, isn't saying font-size: 11px proportional too? It sounds like your friend needs a better screen magnifier. Increasing just the font size in the browser is a hack. The one build into OS X (see 'universal access' in system prefs)

[jQuery] Re: Selecting Descendents of This

2008-02-13 Thread J Moore
does this work? $(this).find('ul').toggle(); On Feb 12, 5:14 pm, studiobl [EMAIL PROTECTED] wrote: I'm having trouble selecting descendents of this So, this works to initially hide uls: $(.treeHeader ul).toggle(); But this doesn't work to toggle them: $(.treeHeader).click(function(){

[jQuery] Re: returning an object array to a JS function - doesnt work

2008-02-13 Thread J Moore
you can't return a value from an anonymous function! think about it: you call $.get() and pass in an anon function as a parameter. $.get() returns basically immediately, and then sometime later (much later) your anon function will be called. Where does the return value of anon go? Nowhere.

[jQuery] Pagination plugin (and jquery plugin instances in general)

2008-02-13 Thread J Moore
I'm using the pagination plugin at the top and bottom of a list. Works great, except that the two instances are independent. Clicking on page 3 in the one pagination instance will not change the other. I've thought of various solutions/workarounds, but they all involve getting access to the

[jQuery] Re: Animate function. Once I animate how do I er.... de... animate

2008-02-13 Thread J Moore
um, use a variable? var x = true; $(#container).click(function() { if (x) { $(#container).animate({marginTop: -=237px}, slow); } else { $(#container).animate({marginTop: 400px}, slow); } x = !x; }); On Feb 13, 3:05 pm, somedude [EMAIL PROTECTED]

[jQuery] Re: Correct way to read JSON string

2008-02-13 Thread J Moore
This isn't specific to jQuery. One way... var x = '{a:123,b:456}'; // json eval('var z='+x); z is now an object. z.a = 123, etc. -j On Feb 13, 3:47 pm, wolf [EMAIL PROTECTED] wrote: hi, what is the correct way in jQuery to decode = deserialize a JSON string? jQuery itself can obviously

[jQuery] Re: jQuery caching DOM refferences? Performance issues

2008-02-12 Thread J Moore
be improved ad that was generally where I suggested the solution and basing on Your opinion it should work. If there are any other opinions/suggestions I'd be glad to hear them. Thanks in advance Best regards! On 11 Lut, 01:55, J Moore [EMAIL PROTECTED] wrote: You can profile javascript

[jQuery] Re: IE/FF Memory Leak

2008-02-12 Thread J Moore
How are you measuring memory leaks? -j On Feb 11, 10:16 am, optimalcapacity [EMAIL PROTECTED] wrote: I am a newbie to jQuery so this may be a simple answer... My goal in this exercise is to return a specific html table block (table.DetailTable) from a dynamically generated html page which

[jQuery] Re: Using jQuery inside an ordinary function notes!

2008-02-12 Thread J Moore
(also the 'el' variable in your code is undefined.) On Feb 11, 1:28 pm, saidbakr [EMAIL PROTECTED] wrote: Hi, I think that my problem is complicated. I already done what you have told me due to the following requirement: I have another function used for doing form validation which I named

[jQuery] Re: Using jQuery inside an ordinary function notes!

2008-02-12 Thread J Moore
saidbakr, you're still not understanding how the method calls are 'asynchronous'. Read Karl's reply again. It's full of good info. adding a return true or return false to your success or error methods won't do anything. You need to add code to fully handle the response. (Basically where you are

[jQuery] Re: Slowness on IE6

2008-02-10 Thread J Moore
i don't see any jquery at the link you've given. -j On Feb 8, 3:41 pm, eltbb [EMAIL PROTECTED] wrote: Hi, I am using the jquery.treeview, and when first building a tree, on IE 6, the cpu usage goes up for a few seconds. Also whenever expanding or collapsing nodes, the cpu usage seems very

[jQuery] Re: Design question.

2008-02-10 Thread J Moore
that would minimize performance issues. I do have a specific sample in mind, but this issue is rather generic I think. Thanks for the response. I think it's a good starting point. :) Shawn J Moore wrote: A simple work around is to append a character to the id to keep them unique

[jQuery] Re: jQuery caching DOM refferences? Performance issues

2008-02-10 Thread J Moore
You can profile javascript with firebug and see total calls for different approaches and how long they take. That said, $('#id') is fast, since it is basically getElementById() a native javascript method. However, if you call $('#id') 100x, you'll see that it's faster to cache it in a variable.

[jQuery] Re: Using Literal Objects in Javascript with JQuery

2008-02-06 Thread J Moore
Yes, great screencast. (I think i learned a little portuguese too.) A question about literal objects - is it fundamentally different than using prototype? // // example 1: literal obj // var Counter = { container = $('#counter'); start: 1, init: function() { container.val(start); } }

[jQuery] Re: reusing jqmodal container

2008-02-06 Thread J Moore
Looks to me like you're missing a closing bracket, so your 2nd click method ($('a#enviar_jqm_trigger') is encapsulated in the first ($ ('a#corregir_jqm_trigger'). No? -j On Feb 5, 9:12 am, Sebastián Würtz [EMAIL PROTECTED] wrote: my script

[jQuery] Re: JQuery takes 80% of my core2Duo proc on DOM element inserts

2008-02-06 Thread J Moore
I've heard a few people mention the building an array and then using .join(''). I found that good-old-fashioned string concatenation was faster - and the syntax a bit cleaner. There's a neat test on this page. The joining arrays seems is a bit slower for me. (Firefox on OS X)

[jQuery] Re: OT: how to benchmark user hardware?

2008-01-23 Thread J Moore
First, I would try to optimize your code. Make sure that you are calling as few $() methods as possible. (e.g. build strings and set with html() instead of repeatedly calling append() or after(). Firebug can also help you profile.) But if your code is as tight as it can be, then why not a

[jQuery] Re: creating a table from an array

2008-01-19 Thread J Moore
Firebug shows you the HTML as it understands it. So if it doesn't look right, it usually means you are creating invalid HTML. The biggest problem with your example, is that you are calling append() repeatedly, and I don't think the elements are being inserted where you expect. What type of

[jQuery] Re: Callback-return into global variable

2008-01-19 Thread J Moore
Couple of thoughts: 1) $.each() is not for moving through an array. (is for doing something to each matched DOM element) try: for(item in _json) { alert('item:'+item);} 2) try defining your global as an object. e.g. var _json = {}; -jason On Jan 16, 2:17 am, Niels [EMAIL PROTECTED] wrote:

[jQuery] Re: Using getJSON...not successful

2008-01-18 Thread J Moore
to isolate the problem, make your script dump out something like: {a: hello} are you sure it's not a 404? is jquery being found? It could be lots of things... if you haven't already, install firebug (and use firefox). It will save you a lot of frustration. On Jan 18, 6:13 pm, gms [EMAIL

[jQuery] Re: Design question.

2008-01-18 Thread J Moore
A simple work around is to append a character to the id to keep them unique. But also, store the ID in the parent TR. e.g. tr id=u4 td class=empBob Smith/td tddiv class=1-Jan-2008link 1/div/td /tr Then you can get the id with $('div.1-Jan-2008').click(function() { var id =