[jQuery] jQuery Twitter Full API Plugin - Help Needed Testing

2009-08-18 Thread Eric Garside
Hey guys, I've been working on a full implementation of the twitter API through, primarily, jQuery, with a simple relay script server side for securely signing and keeping auth details. I've just finished the library, and am looking for some developers who know either the twitter API and jQuery to

[jQuery] Re: Loading jQuery without blocking

2009-08-06 Thread Eric Garside
Honestly, I'd load jQuery regularly, and use the getScript function to load the rest of the files after domready. I don't know that you're getting a big performance increase in loading the jquery library in this method, and it is causing an unknown error, which isn't an ideal thing to debug. :P U

[jQuery] Re: Remove an element but not it's content

2009-08-06 Thread Eric Garside
If you want a cleaner look, you can always just throw together a quick plugin to handle things: $.unwrap = function(){ return this.each(function(){ var el = $(this); el.before( el.html() ).remove(); }) } Then, simply call: $('a.tester').unwrap(); And it will unwrap all

[jQuery] Re: More fun with decrementing on click

2009-08-03 Thread Eric Garside
The problem is in how you're applying the decrement operator. If you put it at the end of the number, as in: number-- Then, the current number will be returned, THEN decremented. That's what's happening here. Simply put the operator before the number, so it is decremented THEN returned. $('.nu

[jQuery] Re: function running 2X

2009-07-29 Thread Eric Garside
Pretty sure its because the event is bubbling up. Try: $('#cardcharges td').click(function(){ alert('execute once'); return false; }); On Jul 29, 2:38 pm, marksimon wrote: > no stupid ideas here, but changing to $(#cardcharges td).click( didn't > fix the problem. > > On Jul 29, 11:22 am, András

[jQuery] Re: Using data(name,value) to store additional information

2009-07-28 Thread Eric Garside
You could also do it with non-styling classes, as an alternative to locating them. $('div:first').data('foo', 'bar').addClass('foo'); $('.foo'); On Jul 28, 3:15 pm, Basdub wrote: > Thanks, that should do the trick. > > On Jul 23, 10:44 pm, Karl Swedberg wrote: > > > > > One way to retrieve th

[jQuery] Re: JQuery and XHTML in Firefox

2009-07-28 Thread Eric Garside
Can you give a sample of the output? How different is the result of the transform from valid xhtml? On Jul 28, 2:55 pm, ScottSEA wrote: > On Jul 28, 9:55 am, ScottSEA wrote: > > > Until recently, I was humming along happily with my jQuery and HTML... > > life was good.  Sadly, the Powers That B

[jQuery] Re: JQuery and XHTML in Firefox

2009-07-28 Thread Eric Garside
What doctype / mimetype are you specifying. If you're doing xhtml+xml, I'm pretty sure if you remove the "+xml" portion, things will play nicely again. On Jul 28, 12:55 pm, ScottSEA wrote: > Until recently, I was humming along happily with my jQuery and HTML... > life was good.  Sadly, the Power

[jQuery] Re: Using replaceWith on a instead of a causes text to be deleted

2009-07-28 Thread Eric Garside
The W3C has a list of valid self-closing tags, div of which is not one of them (for the sake of compatibility, I think). http://www.w3schools.com/xhtml/xhtml_ref_byfunc.asp Only the following tags should be self closed: On Jul 28, 11:30 am, "thorasm...@gmail.com" wrote: > Not sure whe

[jQuery] Re: consistently unable to get return false to work, why?

2009-07-28 Thread Eric Garside
Try starting off with a simplifying your selectors and the code in general? .live(), in this case, isn't going to provide you much benefit, as you're binding it to an element based on an ID, which means there will only ever be a single element which this function triggers for. Try something like:

[jQuery] Re: Make width of inner div equal outer

2009-07-23 Thread Eric Garside
$('.secondLevel').css('width', $('#header').width()); On Jul 23, 1:16 pm, Paul Collins wrote: > Hi all, > I've got a problem with IE6 and I need to basically find the width of the > "header" DIV and make the "secondLevel" DIV match it. So, I guess I need to > target IE6 specifically in the code.

[jQuery] Re: Looking for some help converting this to jquery

2009-07-23 Thread Eric Garside
function setButtonClass(){ $(':submit,:reset,:button').each(function(){ var el = $(this), val = el.val(), word = (val.split(/[^A-Z\W]/).length/2) + val.length; el.addClass( word >= 12 ? 'mb' : (word > 4 ? 'sb' : (word > 0 ? 'b' : '')) ); }) }

[jQuery] Re: Binding of object

2009-07-21 Thread Eric Garside
In what situation in your code would more than a single event be bound to the element? On Jul 21, 11:22 am, Liam Potter wrote: > Well the way you do it would really do anything, it will just unbind, > then run the function again as it is chained? > > > > sken wrote: > > Would make sense but i th

[jQuery] Re: error jquery-1.3.2.js(line 3633)

2009-07-06 Thread Eric Garside
Well, firebug shouldn't have cared as much as IE would, because of a comma inside the list of params in your POST. The last element in an object can't have a comma. Also, could you post the HTML? On Jul 6, 8:49 am, Mark wrote: > I have 3 drop down menu's where is post the value's bij a button.c

[jQuery] Re: Traversing not

2009-06-30 Thread Eric Garside
Please provide the markup you're using that works for anchors and not imgs. On Jun 30, 8:58 am, Luciano wrote: > I'm trying to use the function Not (): > > when I run the command on the TAG "A" and works > $ (this). find ( "a"). not ( '[href ^="/"]'). attr ( "target", "") > > when I run the

[jQuery] Re: check/uncheck all checkboxes with specific id

2009-06-30 Thread Eric Garside
Is there a particular reason you couldn't use classes to do this? Instead of the markup you provided, something like: Then: // Use the :checkbox instead of the old method you're using $(':checkbox.chkEvent').each(funciton(){ var el = $(this); el.attr('checked', el.is(':checked') ? ''

[jQuery] Re: Protect images

2009-06-26 Thread Eric Garside
Just as an FYI, you do know that if the user can see the image on your website, it's already on their computer. Not to mention, anything you do that's purely a javascript fix can be avoided by merely turning off javascript. It's essentially a fool's errand to attempt to do this. On Jun 26, 11:27 

[jQuery] Re: call a method outside a jquery object

2009-06-26 Thread Eric Garside
Long story short, you can't do what you're trying to do. You have some massive scoping issues. first, anything within you document.ready function (as defined by $(funciton(){..});) that gets declared in there is accessible only inside that function itself. Now, I'm not sure what you're actually t

[jQuery] Re: Optimize object random generator

2009-06-26 Thread Eric Garside
I put together a plugin to handle this kind of thing that does okay in most browsers, called replicator. Give that a shot and see if it helps making your life any easier. http://eric.garside.name/docs.html?p=replicator On Jun 26, 10:11 am, chronotype wrote: > Hello, > > i've created a function

[jQuery] Re: extract data from this JSON encode using jQuery

2009-06-26 Thread Eric Garside
Well, lets assume you're getting the JSON you described from the following ajax call: $.post('/path/to/json.php', {params: 'go here, if you need them'}, function(data){ // "data" contains that JSON object you described // Also, I'm assuming your select box looks something like this: //

[jQuery] Re: Problem with double submit of and form

2009-06-26 Thread Eric Garside
Your code is confusing. Why do you have the script tag wrapped inside of the form element? Why do you have two script tags a couple tags away from each other instead of inside your header definition? Your script is chock full of errors. Here's a couple of suggestions: 1. Move both of your script

[jQuery] Re: how to ask questions

2009-06-26 Thread Eric Garside
If you need a place to host code for demonstration (because you're working offline, or need to expose only a fragment of code you can't get working), you have the BEST chance of getting an answer by posting your code on http://jsbin.com and dropping in a link. When people come in and post hundreds

[jQuery] Re: calling functions between multiple document ready events

2009-05-29 Thread Eric Garside
It's a simple scoping problem. Anything you create inside an anonymous function will be accessible only within the function. If you need something to be accessible between the anon. functions, simply move it into a higher scope, like the global namespace (eh, not idea) or the jQuery namespace (bet

[jQuery] Re: use jQuery object of parent in an iframe

2009-05-29 Thread Eric Garside
Hi Beni, I've thrown together a pretty nifty plugin for handling this exact thing. (Neat problem to work on. :D ) Anyway, the plugin can be found here: http://snipplr.com/view/15393/inheritjs--jquery-sharing-between-parents-and-iframes/ There's a live proof-of-concept demo available here: http:

[jQuery] Re: Detect version of internet explorer using jquery

2009-05-27 Thread Eric Garside
The jQuery.browser object got depreciated rather recently in favour of feature detection. It would probably be easier for future maintainability if you were to code around detecting what different browser versions don't support, then writing in conditionals for handling the lack of that feature. C

[jQuery] [New Plugin] jQuery Generic Pagination

2009-05-26 Thread Eric Garside
I figured I'd drop a message out to the board about a new plugin I've finished documenting and released, called Pagination. It's a small, relatively simple jQuery plugin which makes rendering and managing Pagination controls very easy. It automatically generates groupable controls, which can be th

[jQuery] Re: Catch Errors from External Libraries

2009-05-07 Thread Eric Garside
Try using a try-catch block around the scriptaculous code? There's really no other way that I'm aware of to capture a javascript error and continue processing. Though, depending on how crucial the module is, you may consider using something else. 3 frameworks, 2 major ones, on a site at the same

[jQuery] Re: Custom JSON sanitizing during $.ajax

2009-05-07 Thread Eric Garside
Yea, that should fix the problem, return is a reserved word in javascript On May 7, 4:22 pm, Matt Critchlow wrote: > try changing your parameter in the success method to something other > than return and see what happens.. > > On May 7, 10:40 am, Eli Perelman wrote: > > > Hello All, > > > I am

[jQuery] Re: recursive dom walker

2009-05-06 Thread Eric Garside
? > > Thanks > andy > > On May 6, 3:13 pm, Eric Garside wrote: > > > Your "recurse" function is not a method of the jQuery.fn object, so it > > can't work on elements. > > > The line: > > > $.recurse = function(options) { > > &

[jQuery] Re: refresh image?

2009-05-06 Thread Eric Garside
For reference, this php should properly force no-cache: Just be sure to replace $mime with the correct type for the image (jpg, gif, whatever you're sending) header('Content-Type: ' . $mime); header('Cache-Control: no-cache'); header('Pragma: no-cache'); On May 6, 2:30 pm, Ricardo wrote: > On

[jQuery] Re: recursive dom walker

2009-05-06 Thread Eric Garside
Your "recurse" function is not a method of the jQuery.fn object, so it can't work on elements. The line: $.recurse = function(options) { should be $.fn.recurse = function(options) { On May 6, 9:00 am, AndyCramb wrote: > I am trying to write a plugin that will eventually match a specific > st

[jQuery] Re: Is it possiblwe to use "this" in slection

2009-05-06 Thread Eric Garside
Yes, you can. "this" refers to the HTMLElement in the context of an event handler. Though, your syntax is a bit wonky, should be: $('#slickbox' + this.id).toggle(400); On May 6, 4:13 am, Christos wrote: > Hi all, > > I wanted to ask whether we can use "this" for selecting in jquery. > What i wa

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

2009-05-05 Thread Eric Garside
I'll give it a shot explaining, feel free to correct me if I'm off. :) Basically, the jQuery core is broken up into three major pieces: * The Sizzle Selector Library * The jQuery Cache * The jQuery Namespace The selector library, and code associated with implementing it, provides jQuery with a w

[jQuery] Re: Serialize jQuery Objects ?

2009-04-29 Thread Eric Garside
Why not assign a set of IDs to the elements you want to export? That will allow jQuery to quickly recache the elements. On Apr 29, 11:41 am, tjholowaychuk wrote: > Hello, I wrote a library which records / plays back DOM events with a > faux cursor, its working great looks just like the real thin

[jQuery] Re: fadein thumbnails when loaded

2009-04-28 Thread Eric Garside
ileref!="undefined") } On Apr 28, 7:26 am, Rick Faircloth wrote: > >> In the you can do this: > >> document.documentElement.className = > 'js'; > >> Then you can set styles for elements as descendants of .js. > > Karl...will you explain a li

[jQuery] Re: fadein thumbnails when loaded

2009-04-27 Thread Eric Garside
> A) the images very quickly load then disapper. I dont want to hide the images > in css incase people have js diasbled. You're out of luck, then. DOMReady will trigger after the images and html has loaded, so unless you hide them with CSS, there's no way to prevent the flash, afaik. > B) all th

[jQuery] Re: How to get css object of one element?

2009-04-27 Thread Eric Garside
Using the jQuery object as an array ($('.selector')[0]) returns the HTMLElement. Using jQuery's "eq" function returns the jQuery object of the HTMLElement at that position: $('a').eq(0).css('color'); On Apr 27, 3:38 pm, Ngoc Bui wrote: > Hi all, > > I wonder how to get css object of ONE single

[jQuery] Re: Safari 3.2.1 and $.ajax POST doesn't work

2009-04-27 Thread Eric Garside
Your not actually submitting the form by ajax. What's going on: $.ajax({ type: 'post', url: 'somurl.php'}); Is submitting an empty post. jQuery doesn't autodetect that you're submitting a form without a plugin, afaik. Why does it look like it's working? Because, when the user submits the form,

[jQuery] Re: Lavalamp Trouble

2009-04-23 Thread Eric Garside
Class is not defined var TableKit = Class.create(); tablekit.js (line 30) On Apr 23, 1:36 am, MauiMan2 wrote: > Can anybody find quicker than I can why it’s not working on my blog? > > http://ocmexfood.blogspot.com/(the orange nav near the top) > > I’m pretty sure I have all the elements in corr

[jQuery] Re: JSON datastore

2009-04-22 Thread Eric Garside
Check out the jStore plugin. It's designed to handle client-side storage on all modern browsers. http://code.google.com/p/jquery-jstore On Apr 22, 11:10 pm, shavin wrote: > Is there anything similar to dojo's datastore in jQuery? I wish to try > build an elementary kind of a single-page self-sav

[jQuery] Re: Cross server check if a pdf file exists

2009-04-22 Thread Eric Garside
If you have access to PHP, I'd just throw up a script on your local server to request the headers of files on any server, and then just call that from your own domain using regular ajax calls, instead of jsonp. Jsonp doesn't actually make an ajax call, it includes a javascript file on the page, wh

[jQuery] Re: Modifying jQuery to decrease file size.

2009-04-22 Thread Eric Garside
If you're really that concerned about transfers from your own server, you could always just use google's Ajax APIs and include it dynamically from google's servers rather than your own. http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js On Apr 22, 4:10 pm, Ricardo wrote: > You can

[jQuery] Re: jQuery countdown with simple percentage bar display?

2009-04-22 Thread Eric Garside
I've got a clock plugin which can do countdown timers, called epiClock. http://code.google.com/p/epiclock With a pretty simple rendering function (covered in the docs here: http://eric.garside.name/docs.html?p=epiclock ), you should be able to hook it into a progress bar, or merely display a coun

[jQuery] Re: JQuery.isReady property

2009-04-16 Thread Eric Garside
The jQuery isReady property was designed to do exactly what you're trying to accomplish. If you call: $(function(){}); before the DOMReady, it will trigger the function once it occurs. If you call it after the DOMReady, it will trigger immediately. The isReady property exists so, when it's false,

[jQuery] Re: Data() method, just changing value of one hash element

2009-04-16 Thread Eric Garside
Try: $j.data(item, 'attributes').WarehouseKey = $j('#< %=ItemWarehouseList.ClientId%>').val(); On Apr 16, 8:12 am, "Richard D. Worth" wrote: > On Wed, Apr 15, 2009 at 1:50 AM, Dhana wrote: > > > I am using the jQuery Data method to store data for dynamically > > created elements.  Everything w

[jQuery] Re: Ajax request -- passing additional paramters to success method

2009-04-15 Thread Eric Garside
$.ajax({ type: "GET", dataType: "json", url: tUrl, success: function(data){ GotNewData(data, 'custom string'); }, error: GetDataError, complete: AjaxRequestComplete }); On Apr 15, 4:53 pm, Nic Hubbard wrote: > I am interested in this as well.  

[jQuery] Re: Plugin does not bind to jQuery object

2009-04-15 Thread Eric Garside
is thrown. If I flip the order of > those two, two exceptions are thrown, one for the missing jQuery > object, and another for the validate method. > > Ignore the reference to "validate.js" in the , that's not being > used here. > > Thomas > > On Apr 15, 4

[jQuery] Re: Plugin does not bind to jQuery object

2009-04-15 Thread Eric Garside
It's the order of your includes. In the first page, you're including the validation plugin before you're including jQuery. The result is that, when validation attempts to enter itself into the jQuery namespace, jQuery is "undefined", so it just dies within it's enclosure. On Apr 15, 4:30 pm, Thom

[jQuery] Re: jQuery sessions (persisting data across pages)

2009-04-15 Thread Eric Garside
Depending on the user's browser version, you could use some of the new client-side storage. I've got a plugin called jStore which was designed to do just this. Maybe it'll get you where you're going? http://eric.garside.name/docs.html?p=jstore On Apr 15, 3:10 pm, gibble wrote: > That's what I f

[jQuery] Re: Adding incremental numbered classes to divs

2009-04-14 Thread Eric Garside
I just finished documentation on a new plugin I think might help you in this situation. Check out: http://eric.garside.name/docs.html?p=replicator On Apr 13, 11:04 pm, Brain Lava wrote: > Thanks everyone!  You've definitely made some great points for me to > consider.  I'm really new to scriptin

[jQuery] Re: how to call 1 function from many buttons by passing parameters

2009-04-13 Thread Eric Garside
Take a look at the jQuery UI Accordion plugin. http://ui.jquery.com On Apr 13, 6:30 am, HISSAM wrote: > Hey I'm new to JQuery > > I have 5 divs > At a time only 1 div should be expanded the others must be hidden > > I'm using the show and hide function > But I want to function parameterised to

[jQuery] Re: Get var out of ajax scope

2009-04-09 Thread Eric Garside
could check to see if the variable is null, but > > what does it do > > then? Try again later? How much later? > > > What's more likely to be needed is that the complete() > > function *calls* that > > other code as a function. Then you know the data is > > a

[jQuery] Re: Managing scripts in AJAX applications

2009-04-09 Thread Eric Garside
I put together a pretty basic DOMBuilder tool for this purpose, called HSJN (HTML Snippet Javascript Notation). You can view/get the source here: http://code.google.com/p/hsjn It gives you the ability to specify jQuery chains within it's syntax, and will parse it out into dom nodes you can insert

[jQuery] Re: JQuery Payload

2009-04-09 Thread Eric Garside
As long as you specify the daa type as "html", it should work automatically. >From the docs: dataTypeString Default: Intelligent Guess (xml or html) The type of data that you're expecting back from the server. If none is specified, jQuery will intelligently pass either responseXML or re

[jQuery] Re: Get var out of ajax scope

2009-04-09 Thread Eric Garside
Well, you've got two basic options. You can do a straightforward global variable like Hector suggested, or you can create and use a custom storage object in the jQuery namespace. Try adding to your code: $.__customStorage = {}; $.get({ url: 'some.page.php', complete: function(data){ $._

[jQuery] Re: Adding incremental numbered classes to divs

2009-04-09 Thread Eric Garside
What's the advantage of assigning the identifier to the class? Like, how are you using it once you create the classes. I'm assuming there's an easier solution, especially if you're doing it dynamically. On Apr 9, 2:54 pm, Brain Lava wrote: > Thanks Ralph!  I'll give that a try :) > > On Apr 9, 1

[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-07 Thread Eric Garside
Yes. You can add methods to any function, but ideally, if you're calling sub functions, you should use $.myPlugin as an object, rather than a function. (function($){ $.myPlugin = { myMethod: function(){ alert('called'); } } })(jQuery); $.myPlugin.myMethod(); On Apr 7, 12:03 pm, Geu

[jQuery] Re: first child

2009-04-07 Thread Eric Garside
I think I understand what you want. Try this: $('#content :first-child')[0].tagName.toLowerCase(); // Will return "a" if it's an anchor, "div" for a div, "img" for an image tag, etc. On Apr 7, 12:37 pm, "Mauricio \(Maujor\) Samy Silva" wrote: > > var $el = xx.is('h2'); //if it indeed matches

[jQuery] Re: get reference to nested appended element

2009-04-07 Thread Eric Garside
parent.append(""); var table = $('table table', parent); Be sure to close your inner tag. IE doesn't like when you try and generate fragments of code, iirc. On Apr 7, 12:28 pm, "Jonathan Sharp, Out West Media" wrote: > Another approach you can take is: > > var table = $(' id="rt0">') >      

[jQuery] Re: How do I access global variables for id's, etc.?

2009-04-07 Thread Eric Garside
What are you actually trying to achieve here? Through all the code posted, I'm still a bit unclear on the actual goal you're trying to achieve. On Apr 7, 3:20 pm, Jonathan wrote: > I know global variables seem convenient but they are really quite > evil. Once your project grows to even a moderat

[jQuery] Re: Debugging jQuery in Firebug

2009-04-07 Thread Eric Garside
I've also got a nice wrapper method for jQuery to interface directly with the firebug plugin. Check here for the snippet: http://snipplr.com/view/10358/jquery-to-firebug-logging/ On Apr 7, 7:22 am, Chuck Harmston wrote: > There are a few cool methods for debugging Javascript in Firebug: > >    -

[jQuery] Re: dont waste ur time with this it dont work

2009-04-06 Thread Eric Garside
7;Examine my teachings critically, as a gold assayer would test gold. If you > > find they make sense, conform to your experience, and don't harm yourself or > > others, only then should you accept them.' > > > [image: Inactive hide details for Eric Garside ---04/06/

[jQuery] Re: dont waste ur time with this it dont work

2009-04-06 Thread Eric Garside
ols Developer, Global Solutions, ibm.com > Phone:  1-828-355-5544 > E-mail:  mjlaw...@us.ibm.com > > 'Examine my teachings critically, as a gold assayer would test gold. If you > find they make sense, conform to your experience, and don't harm yourself &

[jQuery] Re: dont waste ur time with this it dont work

2009-04-06 Thread Eric Garside
Do you have a test page you can show? jQuery does, indeed, work. And well at that. We can help you fix your problems, but please don't come onto the list and post inflammatory nonsense. :) On Apr 6, 11:19 am, brian wrote: > Wow, thanks for the tip! I'm sure all of the other tens of thousands > o

[jQuery] Re: Selectively load js files

2009-04-03 Thread Eric Garside
If you get the developer build, each of the files is separated out into a: ui.core.js, ui.draggable.js, etc format. If you want to add a bit of spice: $.uinclude = function(){ var scripts = ['core'], counter, loaded = 0; scripts.push.apply(this, arguments); counter = scripts.length;

[jQuery] Re: Excluding some children in a selector

2009-04-02 Thread Eric Garside
$('button', $('#world tr').click(function(){ // Do stuff for #world tr onclick })).click(function(e){ e.stopImmediatePropagation(); return true; }); On Apr 2, 4:14 pm, Thierry wrote: > I have the following structure for tr: > > >     >     >     >       >     > > > I also

[jQuery] Re: A general Javascript question: duplicate IDs in a document?

2009-03-31 Thread Eric Garside
Right, but the problems with that approach is inefficiency. It's more efficient to grab the entire set of elements via $('.event-phase') and comparing their "rel" attribute than it is to throw a loop around $ ('.event-phase-' + i); I use ref/rel for the same basic semantic ideas behind their ascr

[jQuery] Re: A general Javascript question: duplicate IDs in a document?

2009-03-31 Thread Eric Garside
is that you're polluting the DOM with invalid > markup.  Rel is not a valid attribute of the div tag. > > andy > > -Original Message- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of Eric Garside > Sent: Tuesday, March 31,

[jQuery] Re: A general Javascript question: duplicate IDs in a document?

2009-03-31 Thread Eric Garside
A best practice I've adopted is to utilize classes and ref/rel attributes on dom elements for situations like you're describing. Instead of On Mar 31, 12:31 pm, brian wrote: > An ID should be unique. That's why it's callled an ID (IDentifier). > Repeating an ID in a page will cause

[jQuery] Re: handler is undefined error

2009-03-30 Thread Eric Garside
Could you give a bit more information? I'm not exactly understanding what your issue is. On Mar 30, 4:38 am, Macsig wrote: > Update: > > looks like the issue is related to the function hover: if I change it > with click I don't get the error but I want to use hover instead click > > Thanks for a

[jQuery] Re: Catch "generic" events

2009-03-30 Thread Eric Garside
Nope. You have to specify the type of event you want to bind. On Mar 30, 8:04 am, julio wrote: > Hi, > > in my code I use typically something like this to catch events in DOM > elements: > > $wnd.$(document).bind('click', function(event) {...} > $wnd.$(document).bind('mouseover', function(event)

[jQuery] Re: bind to front of event stack

2009-03-27 Thread Eric Garside
into the stack, it bumps the event it's replacing to the end. > That is, if I insert it at position 0, and then unbind it, the event > firing order is now 2,3,4,1. Same if I insert it into position one, > events are then restored to 1,3,4,2. > > Michael > > On Mar 27, 4:38

[jQuery] Re: bind to front of event stack

2009-03-27 Thread Eric Garside
I've come up with a little plugin that will allow you to bind any event (including custom ones) into a specified position in the event stack. http://snipplr.com/view/13515/jstack--jquery-event-stack-management/ The plugin is currently very basic and only allows you to insert a new event into a c

[jQuery] Re: Collect all IDs in a DOM & then act on specific ones

2009-03-27 Thread Eric Garside
You would probably have better luck assigning non-styling classes to the elements to search on instead of doing the regex check. So instead of finding all tags with id="edit-field-*", find all tags with the "edit-field" class On Mar 27, 4:30 pm, NapkinLinks wrote: > Thanks James! > > On Mar 27,

[jQuery] Re: bind to front of event stack

2009-03-27 Thread Eric Garside
I'm not sure if there's an easy method to alter the event stack in jQuery, but I can think of a pretty straightforward workaround, providing you bind the "forcestop" function as the first event handler. $('#myTestEl').bind('click.forcestop', function(e){ var el = $(this), force = el.data('forc

[jQuery] Re: looping through json and adding dom elements (options)

2009-03-25 Thread Eric Garside
Ice, I just recently released a plugin that might suit your needs. It's basically a way to transmit HTML as JSON for this exact kind of thing. Check out: code.google.com/p/hsjn Taking the case you gave, if you change the JSON your returning to: [['option', {value: 1}, 'Physics'],['option', {val

[jQuery] Re: modify pagination plugin to support ability to input page

2009-03-24 Thread Eric Garside
Claudes, I put together a pretty straightforward little Pagination plugin. I don't have a download package or documentation up yet, but you can fetch the jquery.pagination.js plugin from here: svn checkout http://jquery-curator.googlecode.com/svn/trunk/ jquery- curator-read-only var paginators =

[jQuery] Re: Changing the ID of a cloned table row

2009-03-24 Thread Eric Garside
Do you have a live example of the code? Karl's stuff works fine for me, so I suspect it has something to do with other scripts on your page. On Mar 24, 12:56 pm, Karl Swedberg wrote: > On Mar 24, 2009, at 11:44 AM, rivkadr wrote: > > > > > The add table row is being added with: > > > Add > > New

[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?

2009-03-24 Thread Eric Garside
he to change now, with the risk breaking innumerable plugins and > pages. > > On Mar 23, 10:58 pm, Eric Garside wrote: > > > If you'd prefer shortcut functionality, try: > > > $.isInArray = function(arr){ return $.inArray(arr) > -1 ? true : > > false

[jQuery] New jQuery DomBuilder with Chain Functionality and JSON Style

2009-03-24 Thread Eric Garside
I just released a first milestone of HSJN, the "Html Snippet Javascript Notation" system for storing HTML snippets in a JSON-esque format. The parser is a straightforward jQuery DOM Builder, with support for custom attributes, styles, and neatest of all, jQuery chains. (Yup, you can put jQuery fun

[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?

2009-03-23 Thread Eric Garside
;, > > maybe if it was named something more inline with what it returns (like > > for instance, "indexOf") makes more sense, but none the less the > > function kills two birds with one stone > > > On Mar 23, 4:19 pm, Eric Garside wrote: > > > > Hones

[jQuery] Re: Regex Help for CSS Selector type deal

2009-03-23 Thread Eric Garside
tring'.match(/(\.|#)[a-zA-Z_-]+/g); > > --Karl > > > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Mar 20, 2009, at 11:32 AM, Eric Garside wrote: > > > > > I need to come up with a regex, or find some way to leverage Sizzle > > (wh

[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?

2009-03-23 Thread Eric Garside
Honestly, inArray and arrayPosition are equally intuitive to me. If the value has a position in the array, then it is, by definition, in the array. inArray returning the array position is a similar check, but with a more robust ouput. Again, as MorningZ said, you can simply check it's value using

[jQuery] Re: jquery toggle class, I needed to switch class....

2009-03-23 Thread Eric Garside
Or: jQuery.fn.switchClass( a, b ){ var t = this.hasClass(a); this.addClass( t ? b : a ).removeClass( t ? a : b ); } On Mar 23, 12:35 pm, "T.J. Crowder" wrote: > Hi, > > You're creating (or worse, overwriting) global variables 'remove' and > 'add' there (because you haven't given the 'var'

[jQuery] Re: How Easy To Implement RPC Between jQuery And PHP

2009-03-23 Thread Eric Garside
There are a few. The $.ajax methods will end up doing 90% of your work. I'll show you a pretty quick process demonstrating checking if an email address is registered. First, the PHP servlet page, check-email.php: mysql_num_rows( mysql_query( 'SELECT * FROM `user_emails` WHERE `email` = "'. $_REQ

[jQuery] Re: Click event is not captured by jQuery after the link to click is rendered by AJAX through jQuery

2009-03-23 Thread Eric Garside
It's because jQuery operates on the elements which already exist. Lets say for instance: Loads this page into div#ajax-content: When you first render the page, you're grabbing anything that exists. So: jQ1 = jQuery('.ajax-clickery'); // .length = 1 jQ2 = jQuery('.ajax-clickery-two'); // .l

[jQuery] Re: $("#id").attr("ondblclick", "New Value"); is not work in all browser.

2009-03-23 Thread Eric Garside
This is a horrible way to do what you're attempting. First, you should probably not be useing the inline events when you have jQuery readily accessible to you. Second, you should never, ever, ever, ever, ever write a callback using inline styling onclick handling. Third, you should really put all

[jQuery] Re: Rotating CSS classes each 5 sec

2009-03-23 Thread Eric Garside
just need a very easy stuff done, have 5 css classes i want rotated in a > div each 5 seconds, just an array, the classes can be definied inside the js > file. > > --- > Alexandru Dinulescu > Web Developer > (X)HTML/CSS Specialist > Expert Guarantee Certified Develo

[jQuery] Re: height of hidden element

2009-03-21 Thread Eric Garside
The only way I can think of is to "hide" the element by moving it off the page. So instead of using "display:none", use "position: absolute; left: -99px" So something like this semi-pseudocode: .compatible-hider { position: absolute; left: -99px } .content-bloc { background: url('

[jQuery] Re: Rotating CSS classes each 5 sec

2009-03-21 Thread Eric Garside
Try something like the following: And the js: $(function(){ function rotateClass(){ var el = $(this), classes = el.data('classes'), cur = el.data ('current-class'), next = cur++; if (next+1 > classes.length) next = 0; el.removeClass(classes[ cur ]).addClass(classes[ next ]

[jQuery] Re: Preventing link clicks before document.ready();

2009-03-21 Thread Eric Garside
There is a much simpler solution, I think. I'm not positive, but try: $('a').live('click.halt', function(){return false}); $(function(){ ... $('a').die('click.halt'); }); The theory being that the live event will bind the click pause as the enter the dom, then removing the pause when you'v

[jQuery] Re: Widgets stops working after i cache dom and render again.

2009-03-21 Thread Eric Garside
If you don't do: $('#selector').clone(true); Then none of your event handlers will be copied over. Additionally, when you clone the dom and reuse it, you lose any of the .data() elements jquery places in it. You should, instead of copying the dom then rendering it, simply hide the content when

[jQuery] Re: How do you iterate across elements with the same class name?

2009-03-20 Thread Eric Garside
Take a look at this page I threw up on jsbin: http://jsbin.com/uzecu/edit It uses a neat little random color generator I found years ago bound to an event. Seems pretty quick, too. The javascript: $(function(){ $('.colour') .bind('randomizeColor', function(){ this.style.background = (Math.

[jQuery] Regex Help for CSS Selector type deal

2009-03-20 Thread Eric Garside
I need to come up with a regex, or find some way to leverage Sizzle (which I'm not familiar with) to do a pretty simple task. Given strings like: div#some-complex-id.myClass.ui-state-disabled or p.myClass#someId.otherClass or p .myClass .otherClass .ui-state-disabled #myId I'd like, through one

[jQuery] Re: findValue

2009-03-19 Thread Eric Garside
Also, pretty sure you just did it for development purposes, but you probably shouldn't use an alert in an autocomplete context. :P On Mar 19, 3:32 pm, ricardobeat wrote: > I guess the problem is this line: > > var ac = $("#operator")[0].autocompleter.findValue(); > > $(..)[0] gives you the first

[jQuery] Re: Using PHP templates and jQuery, browser load problems

2009-03-19 Thread Eric Garside
Also, for reference, this is how your request are processed. 1. HTTP request from user for page.php 2. PHP parses the page 3. PHP includes header.php, PHP parses that page 4. PHP includes "lets say" content.php, PHP parses that page 5. PHP includes footer.php, PHP parses that page 6. The final HT

[jQuery] Re: Look for

2009-03-17 Thread Eric Garside
As an aside, you can use a different syntax for .find() which last I knew was a bit faster and less characters: $(this).find('.someclass') is equivilent to: $('.someclass', $(this)) On Mar 17, 8:58 pm, "so.phis.ti.kat" wrote: > Thanks for the tip. I started to use FF's console to see more det

[jQuery] Re: how to prevent user input while the page is loading

2009-03-17 Thread Eric Garside
You could use css to "display:hide" the form users could submit from. Do you have a live example? It would help a bunch. On Mar 17, 8:54 pm, Adwin Wijaya wrote: > I have page that rely heavily on jquery for doing calculation. > > I need to prevent user to enter before the page finished loading

[jQuery] Re: JavaScript Loading Question

2009-03-17 Thread Eric Garside
Also, as an aside, I'm not sure the browser handles Javascript last, just asynchronously. If you have: I'm pretty sure it will fetch your css first, then wait on the JS, then load the next CSS file. On Mar 17, 8:40 pm, MonkeyBall2010 wrote: > OK, this did the trick, thanks! > > On Mar 16,

[jQuery] Re: Simple alert inside each(function.... not working

2009-03-17 Thread Eric Garside
The problem here appears to be the change jQuery made with 1.3.2 with how it determines visibility. http://jsbin.com/omavi/edit That link is a quick demonstration of how it works. A "visible" object to jquery is determined by if it takes up space in the page, and has nothing to do with the css p

  1   2   3   >