hover & <select/>
helo, Here is the goal: A box containing a form (with a <select>) should only be visible as long as the mouse pointer is inside it. I used jQuery's hover function on the box but when the mouse pointer is moved over the select box's drop down menu to select an item, the box disappears because browsers don't set the relatedTarget property of the event, causing jQuery's hover function to signal a mouse out. I worked around this by checking if the event's relatedTarget is set but wonder if this is something
Bug: $("div", some_html_string) where string has EOL
Hi there, I recently found a bug that is present in jQuery 1.1.4, 1.2.1 and today's nightly build. In essence, doing this:
AJAX problem using Safari 3 Beta
Hello everyone. I'm a casual jQuery user and have noticed a bug that affects only Safari 3 (beta, Mac+PC). In general terms, the bug happens when a person submits a form via AJAX, the AJAX response redirects the browser to a new URL, and then the user submits a 2nd form on the 2nd page. I've created a test scenario to demonstrate the problem. I'm hoping this isn't too complex to follow. http://txtblaster.com/temp/temp http://txtblaster.com/temp/temp2 When you visit either of those pages and click
Setting additional header for jQuery.ajax
Has there been any motion toward being able to add additional headers to a jQuery.ajax request? Is this functionality there, and I just missed it? I have run into a situation where I'm getting a 411 Length Required error back from a server, and it seems that explicity setting Content- Length: 0 would allow the post request to be handled properly.
Next jQuery minor release
Hi, When it will be released the new minor version of jQuery? In the SVN are many bugs fixes
Background-position related CSS properties issue
I was trying to access the `background-position-x` and `*-y` properties for an element with an offset background image, but found that the property is blank without first setting "background- position", eg: <div id="a" style="background: url('images/my_image.jpg') -50px 12px no-repeat transparent; height: 30px; width: 200px;"></div> $("#a").css("background") # returns blank $("#a").css("background-image") # returns "url('images/ my_image.jpg')" $("#a").css("background-position") # returns blank $("#a").css("background-position",
unbinding hover()
I'm not sure how to unbind hover handlers. Here is the problem: I am writing plugin that uses $(...).hover(f,g) function to bind mouseover and mouseout handlers. When cleanup time comes I cannot unbind only my handlers because they are not really bound to mouseover and mouseout events. That is handleHover(e) private function from jQuery core which cannot be namespaced in v.1.2.1. I can unbind all the handlers for these events but it is certainly not desired behavior for any plugin. I'm going to copy
Criticisms of jQuery code
In a comp.lang.javascript discussion, someone posted the criticisms of jQuery below. Can the dev team comment on any of these points? I have not looked into the jQuery code in great detail myself, but the things pointed out here worry me. Add to that the unnecessary browser sniffing I've seen in other places in the code and things like the slow and unnecessary event object duplication, and I'm starting to wonder just how solid the code is in the library. I'm going to do an analysis of it myself as
jQuery + Json library = broken jQuery
Hey everyone. This IS a potential debug issue.... I'm having a real so-b of a time using jQuery with an SAjax based library I've written. Here's a basic description of the problem: When I add functions to prototypes of objects jQuery breaks - hard. I ran into a similar problem with a javascript templating engine I wrote a little while ago. here's a copy of the json library (and prototype modiers) that I'm using http://mds.walkerlive.com/_lib/json.js.php And here's what I think the reason may be....
need help with arrays
Hi, I would like to know if I can access a jquery array (eg. $ ('.myclass')) like a normal array, means that way (not working example): $('.myclass')[i] I need something like this when it comes to two different objects, which are the same in count. There is a table with two input fields per row and I want to traverse the rows for extracting data (one row (2 cells) -> one object). I didn't find anything in the API...so if you could help me..would be very nice :) greets, Thorsten
embed/object IE6/7
I'm struggling with something strange that worked before Oktober, have a problem with either remove(),empty(),width(),height() and embedded quicktime movies sorry no example for the moment, I'll try in the meantime is there any known issue related? yes little info I know, but I get no error, just .remove() doesnt seam to remove() or height() doesn't work and give no error or somethingin the likes. Thank you! -will
Document Ready Problem.
Hi, people. I've got some "operation aborted" erros when using jQuery's $( document ).ready(); function for wainting page to load and after this, manipulating some HTML elements. This problem occours both in IE 6 and 7. I've corrected it, overwriting some functions right after importing jQuery. This is the code I've used to fix this problem: jQuery.ready = function(){ if ( !jQuery.isReady ){ jQuery.isReady = true; if( jQuery.browser.msie ){ if( document.readyState
Bug? Unable to manipulate jQuery written HTML.
I'm using jQuery to make ajax requests and return HTML, which then gets inserted into the document using val(), in order to build a form on-the-fly. The problem is that I need to manipulate the HTML that has been written into the page using ajax. I am unable to count the li elements that I have inserted, using: site_options_array = $("#site_list_dropdown").find("li").get(); site_options = site_options_array.length; jQuery is unable to find the newly created list elements using: $("#site_list_dropdown").find("li").hover(function()
Is this bug?
Here is the code: jQuery(document).ready(function(){ var tr = document.createElement("tr"); var td = document.createElement("td"); var inp = document.createElement("select"); var myoptions = "<option value='1' selected='selected'>Option1</option><option value ='2'>Option2</option>"; jQuery(inp).append(myoptions); jQuery(td).append(inp); jQuery(tr).append(td); jQuery("#myid").append(tr); }); The HTML is: <table id="myid" border='0' cellpadding='1' cellspacing='0'></table> I expect that the first value
.hover() and its queue
Hi, I'm using .hover() to highlight some images in a row. onMouseOver the image animate its opacity from 0.8 to 1, onMouseOut ... you can imagine. It works quite well, but if you move the mouse very quickly in and out, in and out,... the images continue to make the animation for some seconds. I think this is caused by a sort of queue managed by .hover() function, this function remember how many times I "hover" the images. In this case this in not a very cool features. Someone know avoid this? Thank
Keeping Global & Sub Nav current
Hi, I have been using this article as a reference: http://leftlogic.com/lounge/articles/auto-selecting_navigation to keep my main navigation style changes visible with current page selections. I am now at the point where I need to have both the global nav and sub nav showing current states. Currently this is my code, $(function(){ var path = location.pathname.substring(1); $('#subNav a[@href$="' + path + '"]').addClass('on'); $('#globalNavList a[@href$="' + path + '"]').addClass('on'); }); My current
loadXML() ?
Are there any equivalent in jQuery for this function in IE? Unfortunately after using $.post method we are getting string, but not document, that's why It's necessary to create additional function ...
how can i upload file with $.post and php
i can not use $.post for upload file plz help me.(i need sample)
templating engine for jQuery?
Hey y'all. I wrote a simple templating engine for javascript (tag replacement + repeating objects (arrays)) that takes a string, presumably html and a properly formatted javascript object/array and outputs good code. I've found it to be EXTREMELY valuable. Does jQuery have something like this? If not, how do I get my shizzle into one of the libraries?
flash file upload broken in OS X Leopard
looks like apple (or adobe) missed something.. http://forums.macrumors.com/showthread.php?t=376954 that gonna be a pain as I'm not sure you can distinguish between Leopard and Tiger from the user-agent. will have to force flash update to latest once fixed by adobe for all macintosh users? not good.. -will
IE7 failing to load images from Cache when using $(document).ready
My chess site (64squar.es) quite a few images (chess pieces). It also renders the board dynamically on document.ready. I find that document.ready causes IE7 to sometime fail to load all the images on the page, even though they are definitely cached. I was hoping a fix for this was to use window.onload to reload the images. But unfortunately window.onload never gets called (my guess is because that the page is never fully loaded). Does anyone know why this might happen, or a way round it ? *...(
Dealing with globalEval and Safari -- suggestion for a better approach
Hello, I've been digging into jQuery's source to find out exactly how it deals with the fact that Safari cannot eval code synchronously. My conclusion is that I think jQuery's approach is flawed. The globalEval() method does the actual evaluating of the code. Here it is noted (in a comment) that Safari does not support synchronous evals. As a result, using Safari it is not guaranteed that the code evaluation is done as soon as the globalEval() method exits, while with any other browser we do have
width() returns incorrect results
Basically, width() returns an incorrect result when called on a hidden element that has absolute or fixed positioning, and no explicit width assigned. I'm doing this to correctly and dynamically position some UI elements before showing them. I posted ticked #1818 with an example, and it looks like somebody else posted ticket #1839, which is a duplicate of mine. The fix seems to be simple: changing the one line in .css() that sets the 'left' and 'right' CSS properties to zero, to instead set the 'left'
jQuery.ui for jquery v1.1.3
I realize this may be a stupid question but I can't seem to find the older version of the jQuery UI. I'm using the liferay portal and the current version uses jQuery 1.1.3. Does anyone know where I can download a newer version of the jquery ui so I can have it compatible with 1.1.3? Thanks in advance
document.ready firing too early within iframe
Hi Im trying out the new document ready code from SVN. I am finding that when my page is within an iframe, document ready fires at the wrong point in IE7. IE6 and firefox work fine. IE7 worked ok with the old document ready code (e.g. 1.2) Any ideas how to fix this Sorry for the lack of punctuation im writing this on a danish keyboard !! jonah
Ticket #1843 - Bug in jQuery.css
http://dev.jquery.com/ticket/1843 I just entered this bug into Trac. There seems to be a bug in the jQuery.css function. The lines: if ( parPos == "static" ) e.parentNode.style.position = "relative"; Cause a problem in FF when the element is a direct child of the <body> tag. If you happen to call the height() or width() methods while typing in a textarea box, the cursor jumps to the end. This seems to be because FF does some kind of weird screen refresh if you try to set the position style on the
IE fails to evaluate scripts enclosed by html comments - patch
Hi all, I've opened a ticket about this issue http://dev.jquery.com/ticket/1833 In my opinion, it is to be merged as soon as possible, so I decided to post a reminder to this list. Renato
IE6 png fix and fades
Hi I've had a problem for a long time with using pngfixed elements in IE6 and jquery's fade in and out. My previous ticket seems to have been lost so I created a new one. Essentially line 1054 throws an error since png fixed elements elem.filter.match may be null. (parseFloat( elem.filter.match(/opacity=([)]*)/) [1] ) / 100).toString(). Can be fixed with : (parseFloat( (elem.filter.match(/opacity=([)]*)/) [0,100]) [1] ) / 100).toString() : Ticket here : http://dev.jquery.com/ticket/1837 Be great
Limiting the number of elements accepted by a sortable list help
Hi, I sent this email with the wrong subject so I am sending it again with the right subject. I am using the interface plugin for jquery for drag and drop (sortable lists). Is there any way I can limit the number of elements each list can accept. Here is my code (its indented by I don't know if the email will retain that). In it, I want list 1 (ul1) to accept only 10 elemnts and stop accepting any elements after that. <script type="text/javascript" language="Javascript" src="../libs/jquery/jquery.js"></script>
jQuery.offset
Is it just me, or would jQuery.offset benefit from accepting parameters as well? Right now code is often the similar to the following var offset = jQuery(elem).offset(); jQuery(elem).css({ left: (offset.left + (whatever)) + 'px', top: (offset.top +(whatever)) + 'px' }); whereas we could simply have jQuery(element).offset(50,50) which would adjust the offset by 50 pixels (positively) in both the x and y directions and we could have a jQuery(element).moveTo(x,y) which absolutely adjusted the top,left
ajax and regex, correct response...wrong result
Ok, this is going to be difficult to explain. I have a page that uses many different ajax expressions to render the content upon the user's request. I'm using the liferay portal to render my content and unfortunately any of my request must have the html from the portal in the response along with what I need. (i.e. a lot of extra, unneeded text). I cannot use jQuery(response).find, I believe because of some embedded scripts that jQuery can't parse, so I decided to use a global regex: (my generated
Slide effect bugs in IE 6 and 7 since version 1.1.3
Hi all, I have issues with the slide effect since the version 1.1.3 (same issue with 1.1.4): _ Flicker effet when the div is sliding up, just before disappearing. (working fine with 1.1.2) _ The slide effect don't apply to a div with a relative position when the doctype is strict Everything is working fine with firefox, but with internet explorer it's a different story. It there sonething wrong in my code or is it a bug? You can find a demo here : http://sd-5269.dedibox.fr/temp/jquery/bug112T.html
Get HTML of selected object
Hey guys, i try to get the HTML-Code of a selected element like $ ('#id').toHTMLString(). This is needed to give a concated html-values as param where only string is allowed. I tried to do it this way: (function($) { /* jQuery object extension methods */ $.fn.extend({ toHTMLString: function() { return this.clone().wrap('<b></b>').parent().html(); } }); })(jQuery); It breaks while trying to clone it. If I dont clone, it works pretty, but it effects my original source (which i dont
Event object's pageX and pageY are still broken
Hi, I'm currently working on a wysiwyg editor program, so I have scripts accessing elements inside the iframe from the parent page. I bound some events to document object for the iframe page. When the events were fired, I couldn't get the right pageX and pageY. Then I looked up into the source code, and found jquery's code to compute pageX and pageY for IE: // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && event.clientX != null ) { var
unbind doesn't work with function passed in
Hi, while fixing a bug for tabs I found out that at least since jQuery 1.2.1 the unbind method doesn't unbind the event if a function reference is passed in, like: function foo() { } $('a').unbind('click', foo); I circumvented that bug by using a namespaced event instead of unbinding the function. Is that a known bug? Or is the general strategy to move to namespaced events? If not, I would create a ticket... -Klaus
need help
I am unable to get the ajax to work in jquery. Whenever i pass a .php url to $.ajax. it does not return and none of the callbacks are executed. It justt hangs with no error. It looks very smple but does not seem to work.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script language="javascript"
Expanding jQuery's removing options
Hey everyone, I find myself doing this often in an application I'm writing: jQuery(new_body).find('.wrap').each(function() { jQuery(this).replaceWith(jQuery(this).html()); }); Essentially I'm wanting to remove the node itself, but preserving it's contents. Do you think this functionality would be useful in jQuery core, or is it better left to the realm of plugins? (I ask this because I'm most likely going to attempt at making a plugin that will handle this - I was thinking replaceAndPreserve()
Queue
Hey John, So I've been having trouble figuring out how queue is meant to be used. In its most simple case, its use is pretty obvious. But it's not clear how you would use it to do anything non-trivial. What are some examples of its intended use? <br clear="all"> -- Yehuda Katz Web Developer | Procore Technologies (ph) 718.877.1325
OOP, object literal notation, and the 'new' operator - how to have multiple child objects of a parent object?
I wonder if anyone can clear up an OOP issue for me, specifically, how to have multiple child objects of a parent object. Consider the code below: var parentObj={ childCount: 0, childObj: { id:false, init: function() { alert(this.id); parentObj.childCount++; this.id = parentObj.childCount; alert("Child " + this.id + " Created"); } } } Calling 'parentObj.childObj.init();', the first alert produces 'undefined' and the second 'Child 1 Created'. A second call to 'parentObj.childObj.init();' produces
self[...] in height()/width()
Howdy - I was wondering if someone could let me know if the self[...] is necessary in the height()/width() method, as opposed to just using window[...]. JavaScript Lint is throwing a hissy fit and I'd like to change it if we can. --John
Next Page