That overuseful little $
Folks, My day job is writing server code for CircleShare (http:// circleshare.com). CircleShare is built on the lift web framework (http://liftweb.net) I'm also the lead committer for the lift project. When the lift project started to look around for a default JavaScript library, we were pointed to jQuery. I looked at jQuery and instantly fell in love... and when I say love, I mean LOVE. jQuery feels so right in a functional programming web framework (lift is built on Scala.) I immediately replaced
Serious problem with trigger() and ASP.NET client side validation
When manually triggering a "change" event on a text box which has ASP.NET client-side validation, Internet Explorer will generate a Javascript error. It works fine in FireFox. I'll explain the reason: in the jQuery code, the trigger() function contains the following: (line 1730 in the uncompressed .js file) ================== // Handle triggering native .onfoo handlers if ( !fn && element["on"+type] && element["on"+type].apply( element, data ) === false ) val = false; ================== This causes
selector question
I have two tables exactly the same layout but with different cell content. The first row is used as a "title". I used this in another page (with a single table) and though it would the same in the page with two tables. //---------------------------------------------------------- // - Click title row to toggle the remaing table rows. //---------------------------------------------------------- var $f = $("table tr:first"); $f.click(function() { $(this).siblings().toggle(); }); This only works for
Possible slideToggle "scroll" bug - please confirm
I was creating a example for our SDK using jQuery showing dynamic creating of CSS and .toggle(), like so: // set height/scroll bar $("#msgBody").height("200px"); $("#msgBody").css("overflow-y", "scroll"); // add header click to toggle body $("#msgHeader").click(function() { $("#msgBody").toggle(); }); In the example, I was showing a progressive example of first showing how to hide/show a container and then I showed how to change styles. In this case, to fit the container within the current window
Issue with slideToggle in IE7
I am using slideToggle to create an accordion effect on a list of downloads. It works perfectly in FF, Opera, Safari and IE6. But, in IE7 the table content inside the second level disappears. It is visible during the sliding animation, just not after it stops. When I open the content of the <li> with only one level below the two level <li> the content starts showing up piece by piece. Here is an example of my code below. Sorry I don't have a live demo. My function looks like this: <script type="text/javascript">
metadata plugin
-actual code: if ( !/^{/.test( data ) ) //doesn't work in Firefox 1.0x, not supported I know but.. data = "{" + data + "}"; eval("data = " + data); //breaks if packed with variable shrinking -proposed patch: if ( data.indexOf( '{' )<0 ) data = "{" + data + "}"; data = eval("(" + data + ")"); Thank you! -will
$(document).ready()
hello, I would like to specify the order of the function in order to be executed. for instance $(document).ready( function() { // cleanup(); }, 100 ); // executed at the end $(document).ready( function() { init(); }, 0 ); // executed at first $(document).ready( function() { // normal code } ); // executed by default at position 1 $(document).ready( function() { // normal code } ); // executed by default at position 1 $(document).ready( function() { // normal code } ); // executed by default at position
How to make custom component
Hi All I am using Jquery .in this i am using div id="some thing" and in Jquery $("some thing") if i changed in div id="another" i have to change inside Jquery $("another") also if i want develope one custom component if i use that component no need to change every time. now my problem is how to develope custom component. i got idean but i did't know exact answer. so if you got any idea please help me Thanks&Regards SivaRaju
new ready technique fails with IE?
I recently tried to upgrade the jQuery from 1.1.3.1 to 1.2.1 (svn version rev 3578). In one of the project, it was going fine, but on the other project on IE it fails with the following error message (no script error, but browser error): "Internet Explorer cannot open the Internet site http://foo.com/. Operation aborted" The culprit is not traceable as there is no script error. But, by checking the temporary (cache) folder, I seem to figure it out that it could be the problem with the doScroll ready
proposed ready patch (SVN3654)
John, this is a proposed improvement patch to the "ready" function in current SVN 3654. http://javascript.nwbox.com/IEContentLoaded/jquery-3654-ready.patch it will modify/add the following: - do not hide js errors to developers by moving the user callback out of the try/catch block (important) if callback has errors we may get endless intervals - implement a "document.onreadystatechange" event for IE that parallels the timeout in case page/binaries are already cached (or for example when no images)
What do you think about this idea?
Hi. I have an idea, may be you decide, that it's useful. It's about request to JavaScript. I mean that if you want to post some parameters to javascript on some xhtml you can't do this because of philosophy of HTTP and URL. If you use GET request every time server will answer, but it will generate new content if you didn't request this page with this parameters before. I mean that if you will request for http://somedomain/some.php?modification=3 browser will put into the cash. And if yiu request
How do I disable the table cell handle in Firefox Midas editor?
Hi guys, I know this is a jquery group, and my question has nothing to do with jquery per se, but I know there are a lot of javascript experts here, and I couldn't find the answer anywhere else. So please help me. I'm currently working a wysiwyg editor program, and I want to get rid of the little handles around selected table cell in firefox, I know that's possible. Does anyone know how to do it?
Solution for Opera's deviant implementation for DOMContentLoaded
Hello all, I've been using jQuery(document).ready() as my workhorse event handler to enable unobtrusive GUI improvement, but have been stumped recently by testing things in Opera. While Gecko- and WebKit-based browser wait for stylesheets to be loaded before firing DOMContentLoaded events, Opera fires the event as soon as the HTML is parsed. The result is not only errors while reading CSS properties (since stylesheets might be loaded when the event fires or not, depending on the speed of individual
ready() failing in IE
I'm not ready to file this as a bug yet (I want to build a testcase), but I'm finding a lot of my ready() functions failing in IE (6 and 7) after upgrading from 1.1.1 to 1.1.3.1. I'd come across this in 1.1.1, but it's much more frequent now. In 4 out of 5 page refreshes the CSS queries don't find any matches, even simple ones like $('#myId'). setTimeout is a magic bullet workaround: $(function(){ setTimeout(myInit, 0); }); If it makes a difference, these pages are served from the next room over
calling val on a select box does an error: tmp not defined
Hi, with the jquery from svn (rev 3463), calling val on a select box shows an error: tmp not defined. Do you have any idea ? Cheers, Sylvain
Using jQuery as a Chiron module
I've been working on an XHR module loader for the last year and have been looking into integrating jQuery. I'm hoping to be able to use jQuery without modification. However, since jQuery explicitly augments the window object instead of implicitly through the global context object, a small change would be necessary to make this possible. I've attached a patch which should have no impact on the functionality of the library core as it stands, but would permit jQuery to be used as a "Chiron" module with
Poor's man cache
I looking for a recommened javascript method for a simple cache. This for my new plugin ajax calls. I got it working as follows but I would like to know if there is better way: function myJQueryPluginFunction(..) { var cfg = { ... cacheEnabled: true, cacheMaxSize: 50, // 50 items for cache ... } ... var cache = { length: 0; }; // prior to ajax call, check the cache using tag id var tagId = $(this).attr("id"); if (cfg.cacheEnabled && tagId && cache[tagId]) { doShow(cache[tagId]); } else { // perform
thickbox problem in IE 6... (solution)
Although I don't know that this is the correct group to post this in, I ended up finding the bug in thickbox that caused the plugin div not to center. This is the e-mail I sent to Cody Lindley... The thickbox is awesome by the way, but there is a small bug in it which I'm sure you've heard of. The thickbox does not center on the screen in some versions of IE 6. By now you've probably figured out what was wrong with it but just in case you or anyone else have not I'm sending you the solution that
possible bug in event code
I was getting a memory leak in IE when I was attaching more than one event handler to an element. So the following code would cause a leak: $('#adiv').click(function () { }). dblclick(function () { }). unbind(). remove(); After some debugging I suspect that jQuery.event.add has a bug in it. The code for 1.2.1 on line 1611 var handle = jQuery.data(element, "handle", function () { should instead be var handle = jQuery.data(element, "handle") || jQuery.data(element, "handle", function () { It looks
Custom Software Development
iTechArt Group - Custom Software Development and Offshore outsourcing Company http://www.itechart.com/ Offshore custom software development company iTechArt - Web site and Content Management Solutions development, CMS consulting: Ektron, Drupal and DotNetNuke iTechArt Group provides high quality custom software development services and offshore software development. On December 2006, iTechArt Group became an authorized Microsoft Certified Partner. This means that our company has been recognized by
New site Amserv Auto
http://www.amservauto.ee/front.html Uses several plugins, including Innerfade, ThickBox Reloaded, Flash and Masked Input. -- Mika Tuupola http://www.appelsiini.net/
AND in expressions?
Hi, I'm using jQuery's expression language to define dependencies in my validation plugin. For example, to specify that a field is required only when some checkbox is checked, you'll write: rules: { name: { required: "#checkbox:checked" } } Using the comma seperator it is possible to specify OR rules, eg. "#required:checked, #optional:checked" returns "true" if either or those two is checked. So far I haven't found a way to specify AND logic, eg. "#required:checked & #optional:checked" isn't supported.
Whither ScriptDoc?
I've searched the main, docs, and dev GGroups, but I haven't been able to find a thread on this: if there was one but I just missed it, then please direct me there. I was just trying to find the line of reasoning behind removing the ScriptDoc-esque comments from the jQuery codebase. Having the wiki docs are super when approaching the library as a user, but the wiki becomes less efficient for me when trying to navigate the internal code workings. Obviously, I can read the code to figure out what's
Framework Performace
Hi there I have been using both JQuery and Prototype/Scriptaculous on various projects for a while now. I was wondering if anyone knew of which was quicker in terms of performance. I know there are many things that could impact performance and I am not after a like for like comparison but I was just wondering if anyone had any experiences with which framework performs better ? The reason I'm asking is because I'm rebuilding a site with medium / high traffic and I'd like to choose the right framework
Bug in dimensions innerHeight/Width and outerHeight/Width
Hi, I was just doing a little work on my jScrollPane plugin and updated it to use the latest version of jQuery. Since jQuery now contains offset I thought I'd update to the latest dimensions as well so I didn't have duplication of that method. First thing I noticed was that the newest version of dimensions on it's project page ( http://jquery.com/plugins/project/dimensions ) seems pretty old (comparing it to the ChangeLog.txt in svn). So I started using the version in svn (alongside jquery-1.2.1.min.js).
server-side jQuery
Hello, I have been trying out the code from http://ejohn.org/blog/bringing-the-browser-to-the-server/ as a solution for doing server side javascript with dom parsing/ manipulation. The sample code works fine 1. load("env.js"); 2. window.location = "http://alistapart.com/"; 3. window.onload = function(){ 4. load("dist/jquery.js"); 5. print("Newest A List Apart Posts:"); 6. $("h4.title").each(function(){ 7. print(" - " + this.textContent); 8. }); 9. }; but if i change window.location to other urls
flashing content on slide patch
I put together a patch for this bug http://dev.jquery.com/ticket/1726 And tested it against the original test cases provided here http://groups.google.com/group/jquery-dev/browse_thread/thread/85c2d334fae35d85 As it was pointed out to me later in the ticket this appears to be a bug in IE6/7 for both quirksmode and transitional but not strict mode, but the change I'm proposing effects all browsers. A test could be added to make it IE only but it doesn't seem to be necessary from my limited tests.
GetScript and cache
GetScript is adding "?_=1191575273130" at end of requested script, quite sure it is to prevent getting it from cache. Shouldn't that only be done if "cache: false" was addded, is there such an option for GetScript? Thank you! -will
IE Binding Slow
jQuery is binding very slow when we have over 500 to 1000+ elements. It can take as much as 15 to 30 seconds and sometimes IE will issue a popup error saying "cannot connect" to the URL. When you press OK, a PAGE NOT FOUND is issued. This is not seen with FireFox where the binding can be at .75 to 1.2 secs. I was using cluetip here, but I was able to isolate it down to just: var $list = $('a.basic'); $list.hover( function() { $(this).css({cursor: 'wait'});}, function() { $(this).css({cursor: 'default'});}
jQuery.fn.collect
I think I saw the method, I'm not sure if it was in prototype, mootools or some other framework... That I think it's a very common task to perform, and it's pretty short to make it a plugin... it's to map over the matched elements and collect an attribute from each. I checked prototype, but it's collect method is equal to jQuery's map, so I don't know. The method would be like this: $.fn.collect = function( attr ){ return this.map(function(){ return this[attr]; }); }; I was thinking maybe it could
$.each + strings
I found out something interesting tonight. I learned that $.each on a string produces an undefined character: $.each( mask, function(i,c){ //in IE c is undefined, but in other browsers it's actually a character }); I'm guessing it's because IE won't allow mask[i] but only mask.charAt(i). Was $.each intended to loop over strings? I'm not sure if it's a bug, so I just thought I'd point this out. My fix was to say "c=c||mask.charAt(i);" immediately inside of my loop function. I also noticed similar
patch for odd behavior in animated toggles
This is a patch for http://dev.jquery.com/ticket/1751 optbase might have been a better name than optall in hindsight. Also it's possible that the fix could help other animation problems since it isn't limited to the toggle area. David
patch for checkboxes getting reset
I'm not sure what the process is so I'll take Brandon up on his idea to post patches here for comment until I'm told otherwise. There was a bug a while back about checkboxes getting reset in IE when using animated fx so I debugged it and came up with this patch that fixed the test case. http://dev.jquery.com/ticket/1095 Thoughts and comments are welcome, of course. :) David
ajaxStart and ajaxStop issues in Firefox
I have a system using JQuery 1.1.3 and it has an ajaxStart and ajaxStop function for a div id "ajax-loader" to show whenever ajax stuff is being done. This works smoothly in all browsers. I just upgraded to JQuery 1.2.1 and it works smoothly in all browsers except firefox where I get roughly a 2 second lag when these functions are called. If i comment out the ajaxStart/Stop functions the lag is gone. Anyone know what the issue here is?
Possible Bug: Problem with loaded content
Hi, I'm having trouble with content I'm loading into a div tag from an external HTML file. After the content loads, any clicks of HTML content which contains any possibly selectable code doesn't run. I have: $(document).ready(function(){ $("a").click(function() { var url = $(this).attr("href"); $('.forward').load(url); return false; }); .forward div now contains HTML from the href of the clicked element, however when any link is clicked in the new HTML content, the function in ready is never run.
jQuery.Listen
Hi, I added the first release of my new plugin and I'd appreciate some feedback. The idea with this is plugin is to register selectors with handlers to events (mostly like query live), but this one handles the events using event delegation. Obviously some events can't be handled this way. Perfomance is very important to me here, because some events fire repeatedly. The example has a table that can be enlarged endlessly. In my PC, performance was good even with many many cells. IE got a a bit slow
IDs with Colons
I can't seem to get jQuery to select an element with an id with a colon in it. For example: given <div id="test:id">Test</div> $('#test:id') and $('div[@id="test:id"]') both return no results. However, if I add "test:id" as the 'name' attribute instead of the 'id', I can select it fine. According to http://www.w3.org/TR/html401/types.html#type-name, colons are fine for ids. Any ideas on this one?
Color Animations plugin only works on elements with background-color already set
I just spent a bit of time trying to get the Color Animations plugin to work -- it took me a while to figure out that the plugin will animate color only for elements that already have a CSS background- color set (to a color value; 'transparent' or 'inherit' don't work). Perhaps this caveat could be stated in a comment in the code, to help others who might run into this same problem?
another framework speed comparison
http://mootools.net/slickspeed/ would be nice to see the jQuery column showing all green with next release ;) any comment? -will
help for noobs
I'm not talking about myself. Would it be ridiculous/possible to add some functionality to the standard $() function to block until the document was ready? It seems that a lot of people goober that one up when they first try jQuery. I'm not sure if it's a good idea or not, so I'm just tossing this one to the wolves. Josh digitalbush.com
Next Page