[jQuery] Re: Can jQuery do it again and again?
I think this is the most appropiate response for this recurrent question: http://docs.jquery.com/FAQ#Why_do_my_events_stop_working_after_an_Ajax_request.3F -- Ariel Flesler http://flesler.blogspot.com/ On Sep 26, 3:17 pm, thelemondropkid <[EMAIL PROTECTED]> wrote: > Thanks to the help I have received on this group, I am making > progress. > But now that all is working fine, the question beckons: Can jQuery do > it all over again? > > This is my code: > > > some header > > Lorem ipsum dolor sit amet. > > > And the jQuery: > > $(document).ready(function(){ > $("div.box> *").wrapAll(''); > $("div.box").append(''+' div>'+''+''); > > }); > > The problem: > > I would have thought that jQuery would repeat the above process if I > created another div with a class of "box" below the previous one. I > was wrong! > > Is there a way to do that because I would like to create various boxes > with a class of "box" and have them all look the same. > > Thanks folks
[jQuery] Re: i was patient, now i'm frustrated
As of now www.jquery.com and docs.jquery.com are loading faster than ever, and I'm in Brazil! - ricardo On Sep 26, 12:21 pm, DejanNenov <[EMAIL PROTECTED]> wrote: > John - > > There are quite a few of us who are big fans and have plenty of data > center capacity. I am sure the community would be happy to mirror the > site (you can have one of our small older server in our rack any > time). Furthermore - RIMU hosting are great (I am a former client) if > you need an app server, but for static content (as I think most of the > jQuery site is) - EC2 may be better - and unlikely to suffer a > "power outage" > > Cheers & keep up the great work, > > Dejan > > On Sep 26, 8:46 am, "John Resig" <[EMAIL PROTECTED]> wrote: > > > This is a completely unrelated issue - we host jQuery.com (the > > homepage, blog, and dev) on a separate server with Rimuhosting. There > > was a power outage at the server facility and they're working ot bring > > it back up:http://rimuhosting.com/maintenance.jsp?server_maint_oid=68009362 > > > The other sub-domains should be responding fine (docs, plugins, ui, code). > > > --John > > > On Fri, Sep 26, 2008 at 4:35 AM, Richard W <[EMAIL PROTECTED]> wrote: > > > > How long does it take to sort out hosting issues? > > > 1 month, 2 months? > > > I've been reading all the comments from frustrated developers who are > > > unable to do their job because the jQuery site does not load. I > > > thought those people should understand the situation and be patient. > > > Now it's my turn to complain, because now this is affecting my job. > > > Media Template obviously don't have the knowledge or capacity to > > > correctly host a high traffic site. What's the problem, really, i'm > > > curious why this SERIOUS issue has not been resolved after so long?
[jQuery] Re: Raising an event when a popup window is closing
Use the unload event: $(myWindow).bind('unload', function(){alert("Closed.")}); - ricardo On Sep 26, 11:52 am, Dan <[EMAIL PROTECTED]> wrote: > I have a page with a popup that I want to raise an event for when the > popup is being closed. Is there any event built-in to jQuery without > any plugins that can be subscribed to for when a popup is closed? > > I can't seem to figure out any way to do this even without using > jQuery. Is there any way to do something like this in jQuery?: > > var myWindow = window.open("/MyPopup.aspx, "myWindow", > "height=550,width=780,top=100,left=100"); > > $(myWindow).bind('close', function(){alert("Closed.")});
[jQuery] Re: Tabs with multiple CSS classes
Thank you kindly sir, that did exacly what I wanted. I only had to use the navClass: 'my-ui-tabs-nav' option. Is looking at the noncompressed code the best way to figure that stuff out with out having to ask? On 9/26/08, Klaus Hartl <[EMAIL PROTECTED]> wrote: > > > You can change the class names via options (undocumented): > > $('#foo').tabs({ >navClass: 'my-ui-tabs-nav' >selectedClass: 'my-ui-tabs-selected', >disabledClass: 'my ui-tabs-disabled', >panelClass: 'my-ui-tabs-panel', >loadingClass: 'my-ui-tabs-loading' > }); > > Although I prefer to style different tabs on one page via context: > > .ui-tabs-nav { >/* shared */ > } > > #one .ui-tabs-nav { >/* additional styles for the first tab interface */ > } > > #two .ui-tabs-nav { >/* additional styles for second tab interface */ > } > > Or if you apply the id directly to the ul element: > > #one.ui-tabs-nav { >/* additional styles for the first tab interface */ > } > > --Klaus > > > On 25 Sep., 17:04, "Dan B." <[EMAIL PROTECTED]> wrote: > > Hi Folks, > > > > I'm interested in having multiple instances of tabs on a page/pages > > throughout a site and on the same page without using an iFrame. > > > > The tabs function is cool. I'd like to pass it a different base > > class, so that basically I have tab controls of different styles on > > the same page. > > > > Specifically I'm wanting to have this set of tabs have different > > widths; I'm looking for like a "base-class" option to pass to > > jquery.tabs or something. > > > > Any suggestions? > > > > dan >
[jQuery] Re: need help in making dynamic form validation
Give the validation plugin a try instead: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Just call $("#form1").validate(); and add a few classes to your form elements, eg. class="required" for required fields, or "email" etc. A list of available methods is here: http://docs.jquery.com/Plugins/Validation#List_of_built-in_Validation_methods Jörn On Fri, Sep 26, 2008 at 8:11 PM, Geuis <[EMAIL PROTECTED]> wrote: > > Hi everyone, I'm hoping someone can help me learn the right way to do > this. Its experimental for me at this point. Example code is at the > bottom. > > So what I'm attempting to do is to do input form validation by loading > a function which self-assembles an object that has its properties set > as the ID names of the inputs in a given form. The values of those > inputs are then assigned as the values of those properties. In this > way, you can pull all of the data in a form at once and iterate > through the object to do your data checks, validation, etc. Since the > properties correspond to the ID names, its easy to dynamically > manipulate the DOM based on the structure of the object. > > In my example code below, I have a version that works correctly but it > is commented out. It is setup so that the properties are predefined, > then sets their values. It works, but its not the more dynamic self > assembling one that I want. > > The second function that is not commented out was my (poor) attempt at > building a working one. Basically, given a form ID, we loop through > all inputs in the form and retrieves their IDs and values. The problem > I have is that I don't know how to create new properties for the > "check" function based on the IDs of the inputs. > > Thank you! > > >$(document).ready(function(){ > >//standard method that works >//check = function(){ >//this.user = $('#user').attr('value'); >//this.pass = $('#pass').attr('value'); >//this.one = $('#one').attr('value'); >//this.two = $('#two').attr('value'); >//} > >//attempted jquery version >check = function(){ >$('#form1 :input').each(function(obj){ >obj.$(this).attr('id') = $(this).attr('value'); >}); >} > >$('#clicker').click(function(){ >c = new check(); >alert( c.user+" | "+c.pass+" | "+c.one+" | "+c.two ); >}); > >}); > > > >user > >pass > >one > >two > > > > >
[jQuery] Re: [validate] jQuery validation plugin in Drupal
Yes, details can be found here: http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29 Jörn On Sat, Sep 27, 2008 at 2:34 AM, Jeroen Coumans <[EMAIL PROTECTED]> wrote: > > Hi, > > When trying to use the validator plugin, I get the following error: > > missing : after property id > edit-name: "required", > > It seems like it has problems with the "-" that Drupal puts in the > id's of each form field. Is there a workaround possible? > > Thanks, > Jeroen Coumans >
[jQuery] Re: jQuery and Zend Framework validation integration
Setup ajaxForm with dataType:"json". Then your success-callback will get a parsed JavaScript object as the first argument. $("#myform").ajaxForm({ dataType: "json", success: function(data) { // iterate over data.messages and display labels? } }); Jörn On Fri, Sep 26, 2008 at 11:56 PM, jnemec <[EMAIL PROTECTED]> wrote: > > Hi all, > > I am going to use server-side Zend_Form data validation process and > its result show with jQuery. I send form data via ajaxForm(); function > and Zend controller validates data a returns information about > validation result in json format: > > {"status":"error","messages":{"email":{"isEmpty":"Value is empty, but > a non-empty value is required"},"password":{"isEmpty":"Value is empty, > but a non-empty value is required"},"password2":{"isEmpty":"Value is > empty, but a non-empty value is required"},"city":{"isEmpty":"Value is > empty, but a non-empty value is required"},"zip":{"isEmpty":"Value is > empty, but a non-empty value is required"},"street":{"isEmpty":"Value > is empty, but a non-empty value is required"}}} > > Do anybody know how to parse it a how to display these messages in > proper form error labels? > > Thank you, J. >
[jQuery] Re: [Validate] Validation + Masked Input Issue
Could you file a ticket for this? http://dev.jquery.com/newticket (requires registration) Thanks! Jörn On Fri, Sep 26, 2008 at 6:30 PM, Jeff Papp <[EMAIL PROTECTED]> wrote: > > I've been using the validation plugin along with the masked input > pluging and I am noticing a possible bug. When you have a textbox > that has an input mask on it and click on the submit button it > validates the field correctly, but then if you focus into the field > and then leave it will mark the field as valid even though the field > is still blank. I looked at the Marketo demo and the same behavior > occurs there. Is there a workaround to get it to keep the field > invalid after you go in and out of the textbox? > > Thanks, > Jeff Papp >
[jQuery] Re: treeview
Random errors in IE6 can be caused by the packed version of jQuery. Try to use minified(+gzip) to get around that. Treeview works best with "small" trees. How big is your menu? I can't find it on the URL you provided. Jörn On Fri, Sep 26, 2008 at 2:21 PM, bdct <[EMAIL PROTECTED]> wrote: > > Hello i hope someone can help this is driving me mad. > Im using > > jquery-1.2.6.pack.js > jquery-treeview.js > jquery-cookie.js > > for a menu on www.bdct.nhs.uk > > everything works ok apart from in ie6 where some of the links > disappear. but even this is inconsistent on different machines with > ie6 installed. Can any one help? > > Also refreshing the page takes a long time is that because of the > cookies? is there any way to speed this up? > > Cheers > > bdct >
[jQuery] Re: [validate] Get form validation state without triggering errors
You can call an internal API method, that should give you the desired result, though its subject to change in future versions. Let me know if it works for you! var validator = $("#myForm").validate(); // to check, call validator.checkForm(); Jörn On Thu, Sep 25, 2008 at 7:36 PM, dl <[EMAIL PROTECTED]> wrote: > > I'm trying to check if a form has been filled out properly before > enabling the "Next" button. Unfotunately, when I call the method > jQuery("#myForm").valid() the error messages are all triggered. > > I want the error message in there because I want the user to be able > click the disabled next button and see what the specific problems are, > but I want the next button to be a visible indicator of when the form > is ready to go. > > Is it possible to silently get the validation state of the form? >
[jQuery] [validate] jQuery validation plugin in Drupal
Hi, When trying to use the validator plugin, I get the following error: missing : after property id edit-name: "required", It seems like it has problems with the "-" that Drupal puts in the id's of each form field. Is there a workaround possible? Thanks, Jeroen Coumans
[jQuery] jQuery and Zend Framework validation integration
Hi all, I am going to use server-side Zend_Form data validation process and its result show with jQuery. I send form data via ajaxForm(); function and Zend controller validates data a returns information about validation result in json format: {"status":"error","messages":{"email":{"isEmpty":"Value is empty, but a non-empty value is required"},"password":{"isEmpty":"Value is empty, but a non-empty value is required"},"password2":{"isEmpty":"Value is empty, but a non-empty value is required"},"city":{"isEmpty":"Value is empty, but a non-empty value is required"},"zip":{"isEmpty":"Value is empty, but a non-empty value is required"},"street":{"isEmpty":"Value is empty, but a non-empty value is required"}}} Do anybody know how to parse it a how to display these messages in proper form error labels? Thank you, J.
[jQuery] Re: how do you toggle a checkbox value?
"var checkbox = $("#" + checkboxId) // this is being found as > expected" The part you are missing is that "checkbox" is a jQuery object, not a checkbox DOM object so: "checkbox.checked" sure would error because there is no ".checked" property of a jQuery object so: checkbox[0].checked would work since the first item on a jQuery array is the DOM object itself make sense? On Sep 26, 1:01 pm, chris <[EMAIL PROTECTED]> wrote: > I know there is a quirk with checkboxes, but I am under the impression > that setting the check state to boolean values within javascript takes > care of that. Unfortunately, this assumption is proving to be an > incorrect one. > > // Here is a snippet of code > $("li#" + liId).click(function(event){ > > var checkbox = $("#" + checkboxId) // this is being found as > expected > > // flip the checkbox state > console.log(checkbox.checked) > checkbox.checked = !checkbox.checked > > == End > > // This code snippet always returns Undefined even when the checkbox > is checked > console.log(checkbox.checked) > > // which then makes the flip of the values not work > checkbox.checked = !checkbox.checked > > What is the proper way to reference the checked value and flip the > value? > > Thanks.
[jQuery] Re: jEditable Clone Referring to the Original Element, livequery ok to use?
I was trying to put livequery in place on the site, but it seems to attach to pre-known events, like click, instead of new events, like editable. For instance, I'm trying to do this: $(".editable, .bline_measure caption").livequery("editable", function(value, settings) { Wanting to watch these items and rebind editable to the newly created captions when I clone them. Is this not a good job for livequery? -Wayne On Sep 22, 9:06 am, Wayne <[EMAIL PROTECTED]> wrote: > Thanks, Mike. This info helps. Great work, btw. > > -Wayne > > On Sep 20, 12:22 pm, Mika Tuupola <[EMAIL PROTECTED]> wrote: > > > On Sep 19, 2008, at 6:20 PM, Wayne wrote: > > > > In short, I can clone jEditable items, but I can't edit them in place > > > without a page reload and rewriting from the server side. Am I > > > ignoring something or do I need to reset a binding somewhere when I do > > > the DOM modification? > > > This should help: > > >http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st... > > > basically you need to rebind events to cloned elements. > > > -- > > Mika Tuupolahttp://www.appelsiini.net/
[jQuery] Re: how do you toggle a checkbox value?
I would recommend using the attr() method of jquery like: checkbox.attr('checked') = !checkbox.attr('checked') On Sep 26, 12:01 pm, chris <[EMAIL PROTECTED]> wrote: > I know there is a quirk with checkboxes, but I am under the impression > that setting the check state to boolean values within javascript takes > care of that. Unfortunately, this assumption is proving to be an > incorrect one. > > // Here is a snippet of code > $("li#" + liId).click(function(event){ > > var checkbox = $("#" + checkboxId) // this is being found as > expected > > // flip the checkbox state > console.log(checkbox.checked) > checkbox.checked = !checkbox.checked > > == End > > // This code snippet always returns Undefined even when the checkbox > is checked > console.log(checkbox.checked) > > // which then makes the flip of the values not work > checkbox.checked = !checkbox.checked > > What is the proper way to reference the checked value and flip the > value? > > Thanks.
[jQuery] Re: add a new class for middle element
HTML: First element Second element Third element jQuery: $('.some-class p:eq(1)' ).css('color', 'red'); -- jQuery pseudo-class :eq(i) targets the i-nd occurence of the obeject selected. Counts start on zero (JavaScript based) Argument i can be a math expression like: ($('p').size() - 1)/2) // founds the middle of a odd number of paragraphs Maujor -Mensagem Original- De: "gepa" <[EMAIL PROTECTED]> Para: "jQuery (English)" Enviada em: sexta-feira, 26 de setembro de 2008 11:44 Assunto: [jQuery] add a new class for middle element Hello I really like this script. I was wondering , how would be possible to add a class to the middle element ?! I mean, by default there are always 3 elements, and i would like the middle one to be different (to add it some css style). Thanks.
[jQuery] Re: append empty string causes error
I'd guess it was something else, as this code works just fine, no errors http://paste.pocoo.org/show/86303/ If appending "" or null was an issue, 'Bob' would never get shown On Sep 26, 3:15 pm, kape <[EMAIL PROTECTED]> wrote: > I'm not sure if this is correct behavior or a bug, but if I append an > empty string it causes an error. So $('#someId').append('') causes an > error. In my case, I'm actually supplying a variable to append() but > this variable could be an empty string. I don't see why appending > nothing would cause an error, which is why I think it's a bug. > > Anyway, for now, I'm just going to check if the variable is empty > before calling append().
[jQuery] jQuery not working while loaded 2nd time in drupal
Hi, i am working in a site made with drupal . there i am using ajax through jQuery for a polling options. the first time code runs nice ... as soon as some one submit one vote the poll section is loaded with the new result. now nothing works in that section. i am having these two major issues : 1) if i comment out the $(document).ready ... line it doesnt work , even for the first time 2) as soon as the ajax is getting called i see two responses in firebug .. one using POST method (in my code i have used this ) and another using the GET method . The code is as follows: $(document).ready(function(){ $("[EMAIL PROTECTED]'edit-vote']").click(function(){ var posted_vote = $('[EMAIL PROTECTED]'choice\']:checked').val(); if(posted_vote == null) { alert('You must have to enter one choice first. Please check one of the checkboxes.'); $('[EMAIL PROTECTED]'choice\']').addClass('form-text required error'); return false; } else { var form_nid = $('#edit-current-nid').val(); $("#div_poll").animate({opacity: 0.7}, 1500 ); $('#div_poll').html(loading_msg); $.ajax({ type: "post", url: req_path + "node/" + form_nid + "/ajax_poll", data: "choice=" + posted_vote + "&op=Vote" + "&nid=" + form_nid, success: function(msg){ $("#div_poll").animate({opacity: 1}, 1500 ); $('#div_poll').text(msg); }, error: function (xmlhttp) { alert('An HTTP error '+ xmlhttp.status +' occured.\n'+ uri); } }); } }); }); any clue ?
[jQuery] Re: i was patient, now i'm frustrated
John - There are quite a few of us who are big fans and have plenty of data center capacity. I am sure the community would be happy to mirror the site (you can have one of our small older server in our rack any time). Furthermore - RIMU hosting are great (I am a former client) if you need an app server, but for static content (as I think most of the jQuery site is) - EC2 may be better - and unlikely to suffer a "power outage" Cheers & keep up the great work, Dejan On Sep 26, 8:46 am, "John Resig" <[EMAIL PROTECTED]> wrote: > This is a completely unrelated issue - we host jQuery.com (the > homepage, blog, and dev) on a separate server with Rimuhosting. There > was a power outage at the server facility and they're working ot bring > it back up:http://rimuhosting.com/maintenance.jsp?server_maint_oid=68009362 > > The other sub-domains should be responding fine (docs, plugins, ui, code). > > --John > > On Fri, Sep 26, 2008 at 4:35 AM, Richard W <[EMAIL PROTECTED]> wrote: > > > How long does it take to sort out hosting issues? > > 1 month, 2 months? > > I've been reading all the comments from frustrated developers who are > > unable to do their job because the jQuery site does not load. I > > thought those people should understand the situation and be patient. > > Now it's my turn to complain, because now this is affecting my job. > > Media Template obviously don't have the knowledge or capacity to > > correctly host a high traffic site. What's the problem, really, i'm > > curious why this SERIOUS issue has not been resolved after so long?
[jQuery] append empty string causes error
I'm not sure if this is correct behavior or a bug, but if I append an empty string it causes an error. So $('#someId').append('') causes an error. In my case, I'm actually supplying a variable to append() but this variable could be an empty string. I don't see why appending nothing would cause an error, which is why I think it's a bug. Anyway, for now, I'm just going to check if the variable is empty before calling append().
[jQuery] Re: suggestion - enable() / disable() functions
I actually *JUST* created enable & disable functions: (function($) { /** * Disables the matched form elements, and adds the disabled class * to them. * @return jQuery The matched elements. */ $.fn.disable = function() { $(this).each(function() { $(this).attr("disabled", true).addClass("disabled"); }); // $(this).each() return $(this); }; // $.fn.disable() /** * Removes the disabled class from the matched form elements, and * re-enables them. * @return jQuery The matched elements. */ $.fn.enable = function() { $(this).each(function() { $(this).removeClass("disabled").attr("disabled", false); }); // $(this).each() return $(this); }; // $.fn.enable() })(jQuery); Enjoy! Jamie On Sep 26, 7:55 am, Martin <[EMAIL PROTECTED]> wrote: > Dear all, > > I like jQuery much but I do not like the way the enabling, disabling > elements is handled. This is a pretty common task and the current > solution based on changing attributes is not in accord with jQuery’s > “write less” philosophy. > The enable() / disable() functions would be MUCH more elegant and in > light with the jQuery gospel. > Could this be included in the next release ? > > Best > Martin
[jQuery] Re: Bind events on DOM elements inserted from other frame
I keep seeing people talking about different ways to access the document of an iframe. This method(after much hairpulling and testing) works very well. $('iframeID').contents() The .contents() method will automatically handle the browser differences between contentWindow and contentDocument. It will give you standard access to the iframe document no matter what browser. Further, if there are particular non-jQuery things you want to do in an iframe, its still a great way to do it. So for example, a problem I have been working on for several weeks involves adding a script into the iframe which itself calls another script for our forum system(Jive) that displays a list of comments. As a sidenote, the commenting system in Jive absolutely SUCKS. No caching, does document.writes, etc. The forum bit is really nice, but the comment system needs to be shot. So I am loading an iframe into the dom, then writing the script that loads the Jive comments into the iframe. When I was using the strict jQuery methods: $('#commentiframe').contents().find('body').html(scriptvar) It would write into the iframe, but it conflicted with some of the ads we serve on our site. Jive's comment widget does a bunch of document.write's into the document, and using the standard jQuery method the comments were being added to the page at the first occurrence of a script tag. Very, very wierd. So, the way I found around that was to drop back into normal javascript methods and came up with this: $('').appendTo('body'); f=$('#commentiframe').contents()[0]; f.open(); f.write(scriptvar); f.close();
[jQuery] [Validate] Validation + Masked Input Issue
I've been using the validation plugin along with the masked input pluging and I am noticing a possible bug. When you have a textbox that has an input mask on it and click on the submit button it validates the field correctly, but then if you focus into the field and then leave it will mark the field as valid even though the field is still blank. I looked at the Marketo demo and the same behavior occurs there. Is there a workaround to get it to keep the field invalid after you go in and out of the textbox? Thanks, Jeff Papp
[jQuery] New Plugin - jMailer
Hi all, I've written a new plugin for jQuery called jMailer which creates a popup form for sending an email with. It's just the front-end, but should be compatible with a back-end of your choice. A demonstration (which has been mapped to a single email address to prevent misuse) can be seen at: www.danwellman.co.uk/jmailer/jMailerTest.html See the souce of the HTML for comments relating to usage I posted in the plugins mailing list but the post has not appeared, hence this post also. How do I get it on the plugins page of the jQuery site? Thanks
[jQuery] Using :empty for blank divs
I've got the following in the of my document: $(document).ready(function() { $(.bc-wrapper:empty").addClass("none"); }); and in the , The class that it's calling, "none" is simply a display: none from the stylesheet. So basically, if the div doesn't have any content in it, hide it. If it does have content, then it doesn't have any effect. Unfortunately, the div is still showing, and the only way that I've been able to actually get it to disappear is by testing the variables to target a table in the .bc-wrapper div. Did I misinterpret the documentation somehow?
[jQuery] Raising an event when a popup window is closing
I have a page with a popup that I want to raise an event for when the popup is being closed. Is there any event built-in to jQuery without any plugins that can be subscribed to for when a popup is closed? I can't seem to figure out any way to do this even without using jQuery. Is there any way to do something like this in jQuery?: var myWindow = window.open("/MyPopup.aspx, "myWindow", "height=550,width=780,top=100,left=100"); $(myWindow).bind('close', function(){alert("Closed.")});
[jQuery] need help in making dynamic form validation
Hi everyone, I'm hoping someone can help me learn the right way to do this. Its experimental for me at this point. Example code is at the bottom. So what I'm attempting to do is to do input form validation by loading a function which self-assembles an object that has its properties set as the ID names of the inputs in a given form. The values of those inputs are then assigned as the values of those properties. In this way, you can pull all of the data in a form at once and iterate through the object to do your data checks, validation, etc. Since the properties correspond to the ID names, its easy to dynamically manipulate the DOM based on the structure of the object. In my example code below, I have a version that works correctly but it is commented out. It is setup so that the properties are predefined, then sets their values. It works, but its not the more dynamic self assembling one that I want. The second function that is not commented out was my (poor) attempt at building a working one. Basically, given a form ID, we loop through all inputs in the form and retrieves their IDs and values. The problem I have is that I don't know how to create new properties for the "check" function based on the IDs of the inputs. Thank you! $(document).ready(function(){ //standard method that works //check = function(){ //this.user = $('#user').attr('value'); //this.pass = $('#pass').attr('value'); //this.one = $('#one').attr('value'); //this.two = $('#two').attr('value'); //} //attempted jquery version check = function(){ $('#form1 :input').each(function(obj){ obj.$(this).attr('id') = $(this).attr('value'); }); } $('#clicker').click(function(){ c = new check(); alert( c.user+" | "+c.pass+" | "+c.one+" | "+c.two ); }); }); user pass one two
[jQuery] how do you toggle a checkbox value?
I know there is a quirk with checkboxes, but I am under the impression that setting the check state to boolean values within javascript takes care of that. Unfortunately, this assumption is proving to be an incorrect one. // Here is a snippet of code $("li#" + liId).click(function(event){ var checkbox = $("#" + checkboxId) // this is being found as expected // flip the checkbox state console.log(checkbox.checked) checkbox.checked = !checkbox.checked == End // This code snippet always returns Undefined even when the checkbox is checked console.log(checkbox.checked) // which then makes the flip of the values not work checkbox.checked = !checkbox.checked What is the proper way to reference the checked value and flip the value? Thanks.
[jQuery] Re: Listen for location anchor change?
I've worked on a clean solution for this a while ago: http://haineault.com/blog/37/ The examples above might not be up to date since the code has changed a bit since then: http://code.google.com/p/jquery-utils/wiki/AnchorHandler Code: http://code.google.com/p/jquery-utils/source/browse/trunk/src/jquery.anchorHandler.js Cheers On Sep 24, 4:09 pm, mario <[EMAIL PROTECTED]> wrote: > Hi, > > I was just wondering if there is anyway to listen for changes on the > location bar when a link sets an anchor on the same page. > > Example: > > current location:www.something.com/ > > I click on a link and it takes me to: > > www.something.com/#someanchor > > Is there anyway to listen for this change/event with jquery?
[jQuery] Re: how to use Current of superfish
Hi Joel, finally i found time. a "working" example can be found under http://www.pbc-arnstorf.de/jquery/ Maybe it isnt working because we (you) changed the hover effect! I also now included the "superfish-navbar.css" which wasnt included by default. But it still doesn't work.
[jQuery] slide div height collapse
Hello, I'm new to jQuery and have been partial to mootools, but wanted to play with jQuery for a particular web project. One thing that I've noticed is the following: Using mootools slide effect http://www.hovara.com/ocl/ Using jQuery slide effect http://www.hovara.com/ocl/jqueryindex.php You will notice when clicking the login or register links, that the mootools is more fluid and the div heigh grows(pushes down) as the slide effect takes place, the jQuery example however sets the div height to what it knows it will eventually be and then performs the slide effect. I prefer the mootools look and was hoping to get some feedback as to whether this is part of the jquery core ui or a part of the specific jquery slide effect. As I will want to go about changing this. Thanks
[jQuery] add a new class for middle element
Hello I really like this script. I was wondering , how would be possible to add a class to the middle element ?! I mean, by default there are always 3 elements, and i would like the middle one to be different (to add it some css style). Thanks.
[jQuery] Reading XML elements with CDATA
Apologies if this has been asked before. I couldn't find any topics on this when I searched. I have some XML which looks like the following: 1 I'd like to be able to read the html in javascript with something like this: $.post("test.xml", function(xml) { new_html = $("html", xml).text(); // Do something with the new html }); However if the XML element is using CDATA, $("html", xml).text() always returns the empty string. Is this a known issue? Is this a limitation of jQuery? Is there a workaround? Thanks, Russ
[jQuery] re[jQuery] place input value with user entered text
i have this set up: users enter number in text field. .blur() I need to pass the entered value to the value attribute. I'm able to get the value of the number entered in the text box but I cannot seem to pass it to the value attribute of the input $('input').blur(function (){ var program = $(this).val(); any help in the correct direction would be great. thanks -- View this message in context: http://www.nabble.com/replace-input-value-with-user-entered-text-tp19694518s27240p19694518.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Get parent url and add to a textarea
Ok. Your instance of jQuery is living in the parent window, so you need to reference it from inside the pop-up. Use this inside your pop-up code: $ = window.opener.$; $(window).load(function(){ $('#message',document).val(window.opener.location.href); }); Working on FF3 here - ricardo On Sep 26, 8:27 am, stinhambo <[EMAIL PROTECTED]> wrote: > The HTML is - > > > Contact > Us > rel="email_page">Email Page > Print > Page > > > and this is part of what sits in my external file - > > $('a[rel="video_demo"]').click(function(){ > > window.open(this.href,'mywindow','height=460,width=400,scrollTo,resizable=0,scrollbars=0,location=0','false'); > return false; > > }); > > $('a[rel="share_story"], a[rel="video_story"]').click(function(){ > > window.open(this.href,'mywindow','height=580,width=400,scrollTo,resizable=0,scrollbars=0,location=0','false'); > return false; > > }); > > $('a[rel="email_page"]').click(function(){ > > window.open(this.href,'mywindow','height=580,width=400,scrollTo,resizable=0,scrollbars=0,location=0','false'); > return false; > > }); > > // This passes along the URL of the parent opener when clicking "Email > this page" > $("#message").get(0).value += window.opener.location.href; > > On Sep 26, 10:31 am, ricardobeat <[EMAIL PROTECTED]> wrote: > > > Now I'm completely lost. Could you post a test page? > > > So where exactly is $("#message").get(0).value += > > window.opener.location.href; running? > > > On Sep 25, 4:29 pm, stinhambo <[EMAIL PROTECTED]> wrote: > > > > Not at the moment. If I put it inside this - > > > > $('a[rel="email_page"]').click(function(){ > > > > window.open(this.href,'mywindow','height=580,width=400,scrollTo,resizable=0,scrollbars=0,location=0','false'); > > > return false; > > > > }); > > > > the popup comes up but the parent also loads the form and no URL gets > > > carried across. > > > > On Sep 26, 2:46 am, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > Is this line > > > > > $("#message").get(0).value += window.opener.location.href; > > > > > running from inside the popup? > > > > > On Sep 25, 8:48 am, Stinhambo <[EMAIL PROTECTED]> wrote: > > > > > > I am having some problems with that bit of code. > > > > > > Basically I am launching a popup window and this is my js file - > > > > > > $('a[rel="email_page"]').click(function(){ > > > > > > window.open(this.href,'mywindow','height=580,width=400,scrollTo,resizable=0,scrollbars=0,location=0','false'); > > > > > return false; > > > > > > }); > > > > > > // This passes along the URL of the parent opener when clicking "Email > > > > > this page" > > > > > $("#message").get(0).value += window.opener.location.href; > > > > > > but it seems to be causing a conflict in the rest of my code. > > > > > > My Firebug console log says - > > > > > $("#message").get(0) is undefined > > > > > > If I comment out the line, everything works nicely. > > > > > > Any idea if I can get rid of this error and still retain the > > > > > functionality?
[jQuery] Re: livequery and iui
In this particular case event delegation might serve you better. Live Query really only works if you are using jQuery methods to modify/manipulate the DOM. The iui code does not use jQuery and that is why Live Query can't see those particular updates. -- Brandon Aaron On Fri, Sep 26, 2008 at 12:25 PM, pere roca <[EMAIL PROTECTED]> wrote: > > > hi, > I usually don't work with iui (iphone) but have some code and wanna adapt > it > to play with jquery. > The problem is to attache events to the new generated DOM at each ajax > request in iui (using jquery AJAX I would make a callback, but...). > Finally > discovered livequery but seems not to work this very very simple code in > http://edit.csic.es/fitxers/gbifs/index.html : > > var example=function() {alert("clickiiin")}; > $('li') > .livequery('click',example); > //each newly generated li should alert when clicking > > some help? thanks > > Pere Roca > visita l'EDIT mapViewer! http://edit.csic.es/edit_geo/prototype/edit.html > > > > > -- > View this message in context: > http://www.nabble.com/livequery-and-iui-tp19692949s27240p19692949.html > Sent from the jQuery General Discussion mailing list archive at Nabble.com. > >
[jQuery] Re: Can jQuery do it again and again?
LiveQuery would handle that http://brandonaaron.net/docs/livequery/ On Sep 26, 2:17 pm, thelemondropkid <[EMAIL PROTECTED]> wrote: > Thanks to the help I have received on this group, I am making > progress. > But now that all is working fine, the question beckons: Can jQuery do > it all over again? > > This is my code: > > > some header > > Lorem ipsum dolor sit amet. > > > And the jQuery: > > $(document).ready(function(){ > $("div.box> *").wrapAll(''); > $("div.box").append(''+' div>'+''+''); > > }); > > The problem: > > I would have thought that jQuery would repeat the above process if I > created another div with a class of "box" below the previous one. I > was wrong! > > Is there a way to do that because I would like to create various boxes > with a class of "box" and have them all look the same. > > Thanks folks
[jQuery] Can jQuery do it again and again?
Thanks to the help I have received on this group, I am making progress. But now that all is working fine, the question beckons: Can jQuery do it all over again? This is my code: some header Lorem ipsum dolor sit amet. And the jQuery: $(document).ready(function(){ $("div.box> *").wrapAll(''); $("div.box").append(''+''+''+''); }); The problem: I would have thought that jQuery would repeat the above process if I created another div with a class of "box" below the previous one. I was wrong! Is there a way to do that because I would like to create various boxes with a class of "box" and have them all look the same. Thanks folks
[jQuery] Re: jQuery infected by script.aculo.us
Let me add another option, you can either: - Upgrade Scriptaculous - Downgrade jQuery - Upgrade jQuery to the version on the trunk. This last option is the new one and I sort of announced that already (on jquery-dev I think). The version on the trunk patches (I wouldn't say fixes) the conflict with Scriptaculous. Still, it's not a formally stable version but should do fine. I think it's important to make it clear (as Rey said) that this was not a bug on jQuery, but a conflict effects.js created when adding Array.prototype.call. Cheers -- Ariel Flesler http://flesler.blogspot.com On Sep 26, 5:46 am, ricardoe <[EMAIL PROTECTED]> wrote: > Hello, > > First of all, I need to get this working without touching markup. I > really can't, only in very extreme cases. > > I'm loading jquery at the bottom of the body and script.aculo.us is on > the head section. > The main problem is: > > (I'm using jQuery.noConflict() and even tried myJq = > jQuery.noConflict(true)) > normally a jQuery('img',document.body) will return an object (Array) > filled with the image elements. > > now, In the current page I'm stuck the jQuery('img',document.body) > returns also an object but object[0] is a HTMLImageElement and this > object also is an array that has all the image elements, so as you can > imagine. > > jQuery('img',document.body).each() iterates over only 1 element and > its the HTMLImageElement, and worse than that actually any query like > jQuery('a') returns an array with 1 element and this element has all > the desired elements. > > Please help me, is this documented? I can't find anythign about > conflicts between both libraries. > If I remove (I repeat this is a test, in the real thing I can't remove > that) the script.aculo.us
[jQuery] Re: Bind events on DOM elements inserted from other frame
Hope you don't mind turning your thread into a discussion :) now that sounds like a bug. $(document).ready(function(){ $(frames.testframe2.document).ready(function(){ $('#test',frames.testframe2.document); }); }); The inner ready() function is fired exactly at the same time as the parent document. So, the jQuery object returns empty because the DOM is not loaded for the iframe yet. I wonder why is the function fired if the DOM is not ready? It would be nice to have the same advantages ready() offers over the load event for iframes. Any thoughts? - ricardo On Sep 26, 6:11 am, Paul Mills <[EMAIL PROTECTED]> wrote: > That's what I tried first but couldn't get it to work, so I switched > to using load function. > > I've created a demo page with 2 iframes - one using each method and > only the load function works. > You can find it here if you want to have a look to see if I've done > something wrong.http://jquery.sallilump.com/bindtest/bind.html > > Paul > > On 26 Sep, 01:46, ricardobeat <[EMAIL PROTECTED]> wrote: > > > Oh, that's right. > > > But I think the best way would be > > > $(document).ready(function(){ > > > //theother code blabla > > > //now that the iframe element exists > > $(frames.testframe.document).ready(function(){ > > > }); > > > }); > > > On Sep 25, 4:56 pm, Paul Mills <[EMAIL PROTECTED]> wrote: > > > > The ready function fires when the iframe is ready in the DOM, not when > > > the contents of the iframe are ready. I think you need to use the load > > > function - a bit like this: > > > > $(window).load(function () { > > > $('#test', > > > frames['testframe'].document).click(function() { > > > $("#hold").append('Inserted > > > from iframe '); > > > }); > > > }); > > > > Paul > > > > On Sep 25, 6:37 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > You need to put the code inside the $(document).ready function, it's > > > > not finding theiframebecause the DOM is not loaded. > > > > > - ricardo > > > > > On Sep 25, 12:36 pm, hubbs <[EMAIL PROTECTED]> wrote: > > > > > > Well, I tried this, but again it is not working, I really must be > > > > > missing something. > > > > > > All I want to do it be able to click the link inside theiframe, and > > > > > have it append some HTML into the parent, and apply a click event as > > > > > well, that is all, seems simple! :) > > > > > > My test page: http://web2.puc.edu/PUC/files/bind.html > > > > >Iframepage:http://web2.puc.edu/PUC/files/iframe.html > > > > > > Thanks for all the help. > > > > > > On Sep 24, 3:02 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > > > > > > This works for me (FF3) (code running in the parent frame): > > > > > > > $('#test',frames[0].document).click(function(){ //bindfunction to > > > > > > event from element *insideiframe* > > > > > > $('TESTE').appendTo('body').click(function(){ // append > > > > > > element to the *parent frame* and assing a click handler to it > > > > > > alert('test'); > > > > > > }); > > > > > > > }); > > > > > > > I might not be understanding clearly what you want, a test case or > > > > > > explanation of the functionality you are looking for might help. > > > > > > > cheers, > > > > > > - ricardo > > > > > > > On Sep 24, 1:27 pm, hubbs <[EMAIL PROTECTED]> wrote: > > > > > > > > Hi Ricardo, > > > > > > > > I am not appending aniframe, it is hardcoded. I am trying to > > > > > > > append > > > > > > > to the parent document from within theiframe, and have the event > > > > > > > in > > > > > > > the parent bound to the appended element from theiframe. > > > > > > > > On Sep 23, 11:49 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi, I can't test anything right now, but are you setting up the > > > > > > > > ready() function after appending theiframe? > > > > > > > > > On Sep 23, 9:11 pm, hubbs <[EMAIL PROTECTED]> wrote: > > > > > > > > > > Yeah, this really is not working. Could someone please help > > > > > > > > > me to > > > > > > > > > understand how to make multiple frames use the same jquery > > > > > > > > > instance so > > > > > > > > > I can resolve this problem? Do I need to resort to frame > > > > > > > > > ready > > > > > > > > > plugin? I really don't want to... > > > > > > > > > > On Sep 17, 7:12 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > Not sure but $(frames['frame'].document).ready() should > > > > > > > > > > work (from the > > > > > > > > > > parent window). > > > > > > > > > > > On Sep 17, 8:21 pm, hubbs <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > Ok, I am realizing it has to do with the do with the > > > > > > > > > > > $(document).ready > > > > > > > > > > > function. If I just use: > > > > > > > > > > > > $ = window.parent.$; > > > > > > > > > > > $("#hold").append('Inserted fromiFrame > > > > > > > > > > > '); > > > > > > > > >
[jQuery] Re: jQuery infected by script.aculo.us
Yay! Thanks Ariel, I'll keep that on mind. For now we're dealing with the manager of the host-page because everything is caused by a WP plugin known as mp3inline, they are using old prototype libs. Thanks for all everybody (if someday you came to México, you will get a free shot of Mezcal) ;) On 26 sep, 12:57, Ariel Flesler <[EMAIL PROTECTED]> wrote: > Let me add another option, you can either: > > - Upgrade Scriptaculous > - Downgrade jQuery > - Upgrade jQuery to the version on the trunk. > > This last option is the new one and I sort of announced that already > (on jquery-dev I think). > The version on the trunk patches (I wouldn't say fixes) the conflict > with Scriptaculous. Still, it's not a formally stable version but > should do fine. > > I think it's important to make it clear (as Rey said) that this was > not a bug on jQuery, but a conflict effects.js created when adding > Array.prototype.call. > > Cheers > > -- > Ariel Fleslerhttp://flesler.blogspot.com > > On Sep 26, 5:46 am, ricardoe <[EMAIL PROTECTED]> wrote: > > > Hello, > > > First of all, I need to get this working without touching markup. I > > really can't, only in very extreme cases. > > > I'm loading jquery at the bottom of the body and script.aculo.us is on > > the head section. > > The main problem is: > > > (I'm using jQuery.noConflict() and even tried myJq = > > jQuery.noConflict(true)) > > normally a jQuery('img',document.body) will return an object (Array) > > filled with the image elements. > > > now, In the current page I'm stuck the jQuery('img',document.body) > > returns also an object but object[0] is a HTMLImageElement and this > > object also is an array that has all the image elements, so as you can > > imagine. > > > jQuery('img',document.body).each() iterates over only 1 element and > > its the HTMLImageElement, and worse than that actually any query like > > jQuery('a') returns an array with 1 element and this element has all > > the desired elements. > > > Please help me, is this documented? I can't find anythign about > > conflicts between both libraries. > > If I remove (I repeat this is a test, in the real thing I can't remove > > that) the script.aculo.us
[jQuery] livequery and iui
hi, I usually don't work with iui (iphone) but have some code and wanna adapt it to play with jquery. The problem is to attache events to the new generated DOM at each ajax request in iui (using jquery AJAX I would make a callback, but...). Finally discovered livequery but seems not to work this very very simple code in http://edit.csic.es/fitxers/gbifs/index.html : var example=function() {alert("clickiiin")}; $('li') .livequery('click',example); //each newly generated li should alert when clicking some help? thanks Pere Roca visita l'EDIT mapViewer! http://edit.csic.es/edit_geo/prototype/edit.html -- View this message in context: http://www.nabble.com/livequery-and-iui-tp19692949s27240p19692949.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: jQuery infected by script.aculo.us
Hi Rey, Its not an easy option but its reasonable, so I'll test it. For now, my tests confirm what Michael said, the array.call its the picky line, I removed it and everything is working fine again, if someone can make a call to John Resig :D asking if its ok if we remove that :) So I'm with 3 options right now (easier first): 1) Patch my jquery 2) Downgrade my jquery 3) Update Scriptaculous Keep the suggestions coming, and I'm very thankful to all of you, this is a great b-day gift for me :) On 26 sep, 12:03, Rey Bango <[EMAIL PROTECTED]> wrote: > But can you upgrade it? The reason I had asked the version was for the > reason the Mike mentioned, the conflict in makeArray. Mind you that this > is not a bug in jQuery but an issue in several prior releases of > Scriptaculous where they decided to overwrite the default behavior of > the call method. They fixed it in subsequent releases. > > Rey... > > ricardoe wrote: > > Hi Michael, > > > Sorry about the confusion. > > I'll try your solutions, but as I'm just "invited" to the page I'm > > working I can't downgrade scriptaculous. > > But I'll try with an older jquery or with the little tweak. I'll we > > back with the results. > > > On 26 sep, 10:34, "Michael Geary" <[EMAIL PROTECTED]> wrote: > >>> Its important to know that I'm almost unable to change a bit > >>> of markup or other js libraries code, I'm being injected > >>> along with jQuery to this site, so I'm more like a "guest" in > >>> this uber-mix of js. > >> Could you quote the relevant text from previous message(s) in your replies? > >> For those of us who read the group on the mailing list, it makes it easier > >> to keep track of what's being discussed. > > >> For this message, the part I had to hunt down was: > > >>> The jquery is 1.2.6 and scriptaculous is v1.7.0 > >> There's a known conflict between those two versions. I filed a bug report > >> on > >> it and it was rejected as "wontfix". I can't get into the bug tracker or I > >> would look up the bug number. > > >> The easiest fixes would be to either: > > >> 1) Upgrade Scriptaculous from 1.7.0 (which I believe was considered a beta) > >> to the current release version, 1.8.1 or so. > > >> 2) Downgrade jQuery to 1.2.3. > > >> More work, but a better fix, would be to revisit the bug and come up with a > >> patch. > > >> The problem is in this jQuery function: > > >> makeArray: function( array ) { > >> var ret = []; > > >> if( array != null ){ > >> var i = array.length; > >> //the window, strings and functions also have 'length' > >> if( i == null || array.split || array.setInterval || array.call > >> ) > >> ret[0] = array; > >> else > >> while( i ) > >> ret[--i] = array[i]; > >> } > > >> return ret; > >> }, > > >> It's the array.call test at the end of the if statement. Scriptaculous > >> 1.7.0 > >> defines an Array.prototype.call method, which confuses that test. This > >> jQuery code expects that arrays do *not* have a call method (nor split nor > >> setInterval), so that addition by Scriptaculous causes this test to go > >> wrong. > > >> I'm not sure what specific browser or condition that array.call test is > >> supposed to guard against. (Ariel, if you happen to see this message, I > >> believe this was your code; do you recall any of the specifics on why those > >> three particular methods needed to be tested?) > > >> You could just try removing the array.call in your copy of jQuery and see > >> what happens: > > >> makeArray: function( array ) { > >> var ret = []; > > >> if( array != null ){ > >> var i = array.length; > >> //the window, strings and functions also have 'length' > >> if( i == null || array.split || array.setInterval ) > >> ret[0] = array; > >> else > >> while( i ) > >> ret[--i] = array[i]; > >> } > > >> return ret; > >> }, > > >> That will fix the Scriptaculous conflict, but I don't know what other > >> problems it may introduce. If it does cause any problems, then maybe there > >> is some other method name that could be tested instead of array.call to > >> achieve the same end. > > >> -Mike
[jQuery] Re: jQuery infected by script.aculo.us
But can you upgrade it? The reason I had asked the version was for the reason the Mike mentioned, the conflict in makeArray. Mind you that this is not a bug in jQuery but an issue in several prior releases of Scriptaculous where they decided to overwrite the default behavior of the call method. They fixed it in subsequent releases. Rey... ricardoe wrote: Hi Michael, Sorry about the confusion. I'll try your solutions, but as I'm just "invited" to the page I'm working I can't downgrade scriptaculous. But I'll try with an older jquery or with the little tweak. I'll we back with the results. On 26 sep, 10:34, "Michael Geary" <[EMAIL PROTECTED]> wrote: Its important to know that I'm almost unable to change a bit of markup or other js libraries code, I'm being injected along with jQuery to this site, so I'm more like a "guest" in this uber-mix of js. Could you quote the relevant text from previous message(s) in your replies? For those of us who read the group on the mailing list, it makes it easier to keep track of what's being discussed. For this message, the part I had to hunt down was: The jquery is 1.2.6 and scriptaculous is v1.7.0 There's a known conflict between those two versions. I filed a bug report on it and it was rejected as "wontfix". I can't get into the bug tracker or I would look up the bug number. The easiest fixes would be to either: 1) Upgrade Scriptaculous from 1.7.0 (which I believe was considered a beta) to the current release version, 1.8.1 or so. 2) Downgrade jQuery to 1.2.3. More work, but a better fix, would be to revisit the bug and come up with a patch. The problem is in this jQuery function: makeArray: function( array ) { var ret = []; if( array != null ){ var i = array.length; //the window, strings and functions also have 'length' if( i == null || array.split || array.setInterval || array.call ) ret[0] = array; else while( i ) ret[--i] = array[i]; } return ret; }, It's the array.call test at the end of the if statement. Scriptaculous 1.7.0 defines an Array.prototype.call method, which confuses that test. This jQuery code expects that arrays do *not* have a call method (nor split nor setInterval), so that addition by Scriptaculous causes this test to go wrong. I'm not sure what specific browser or condition that array.call test is supposed to guard against. (Ariel, if you happen to see this message, I believe this was your code; do you recall any of the specifics on why those three particular methods needed to be tested?) You could just try removing the array.call in your copy of jQuery and see what happens: makeArray: function( array ) { var ret = []; if( array != null ){ var i = array.length; //the window, strings and functions also have 'length' if( i == null || array.split || array.setInterval ) ret[0] = array; else while( i ) ret[--i] = array[i]; } return ret; }, That will fix the Scriptaculous conflict, but I don't know what other problems it may introduce. If it does cause any problems, then maybe there is some other method name that could be tested instead of array.call to achieve the same end. -Mike
[jQuery] Re: jQuery infected by script.aculo.us
Hi Michael, Sorry about the confusion. I'll try your solutions, but as I'm just "invited" to the page I'm working I can't downgrade scriptaculous. But I'll try with an older jquery or with the little tweak. I'll we back with the results. On 26 sep, 10:34, "Michael Geary" <[EMAIL PROTECTED]> wrote: > > Its important to know that I'm almost unable to change a bit > > of markup or other js libraries code, I'm being injected > > along with jQuery to this site, so I'm more like a "guest" in > > this uber-mix of js. > > Could you quote the relevant text from previous message(s) in your replies? > For those of us who read the group on the mailing list, it makes it easier > to keep track of what's being discussed. > > For this message, the part I had to hunt down was: > > > The jquery is 1.2.6 and scriptaculous is v1.7.0 > > There's a known conflict between those two versions. I filed a bug report on > it and it was rejected as "wontfix". I can't get into the bug tracker or I > would look up the bug number. > > The easiest fixes would be to either: > > 1) Upgrade Scriptaculous from 1.7.0 (which I believe was considered a beta) > to the current release version, 1.8.1 or so. > > 2) Downgrade jQuery to 1.2.3. > > More work, but a better fix, would be to revisit the bug and come up with a > patch. > > The problem is in this jQuery function: > > makeArray: function( array ) { > var ret = []; > > if( array != null ){ > var i = array.length; > //the window, strings and functions also have 'length' > if( i == null || array.split || array.setInterval || array.call > ) > ret[0] = array; > else > while( i ) > ret[--i] = array[i]; > } > > return ret; > }, > > It's the array.call test at the end of the if statement. Scriptaculous 1.7.0 > defines an Array.prototype.call method, which confuses that test. This > jQuery code expects that arrays do *not* have a call method (nor split nor > setInterval), so that addition by Scriptaculous causes this test to go > wrong. > > I'm not sure what specific browser or condition that array.call test is > supposed to guard against. (Ariel, if you happen to see this message, I > believe this was your code; do you recall any of the specifics on why those > three particular methods needed to be tested?) > > You could just try removing the array.call in your copy of jQuery and see > what happens: > > makeArray: function( array ) { > var ret = []; > > if( array != null ){ > var i = array.length; > //the window, strings and functions also have 'length' > if( i == null || array.split || array.setInterval ) > ret[0] = array; > else > while( i ) > ret[--i] = array[i]; > } > > return ret; > }, > > That will fix the Scriptaculous conflict, but I don't know what other > problems it may introduce. If it does cause any problems, then maybe there > is some other method name that could be tested instead of array.call to > achieve the same end. > > -Mike
[jQuery] Re: jQuery infected by script.aculo.us
> Its important to know that I'm almost unable to change a bit > of markup or other js libraries code, I'm being injected > along with jQuery to this site, so I'm more like a "guest" in > this uber-mix of js. Could you quote the relevant text from previous message(s) in your replies? For those of us who read the group on the mailing list, it makes it easier to keep track of what's being discussed. For this message, the part I had to hunt down was: > The jquery is 1.2.6 and scriptaculous is v1.7.0 There's a known conflict between those two versions. I filed a bug report on it and it was rejected as "wontfix". I can't get into the bug tracker or I would look up the bug number. The easiest fixes would be to either: 1) Upgrade Scriptaculous from 1.7.0 (which I believe was considered a beta) to the current release version, 1.8.1 or so. 2) Downgrade jQuery to 1.2.3. More work, but a better fix, would be to revisit the bug and come up with a patch. The problem is in this jQuery function: makeArray: function( array ) { var ret = []; if( array != null ){ var i = array.length; //the window, strings and functions also have 'length' if( i == null || array.split || array.setInterval || array.call ) ret[0] = array; else while( i ) ret[--i] = array[i]; } return ret; }, It's the array.call test at the end of the if statement. Scriptaculous 1.7.0 defines an Array.prototype.call method, which confuses that test. This jQuery code expects that arrays do *not* have a call method (nor split nor setInterval), so that addition by Scriptaculous causes this test to go wrong. I'm not sure what specific browser or condition that array.call test is supposed to guard against. (Ariel, if you happen to see this message, I believe this was your code; do you recall any of the specifics on why those three particular methods needed to be tested?) You could just try removing the array.call in your copy of jQuery and see what happens: makeArray: function( array ) { var ret = []; if( array != null ){ var i = array.length; //the window, strings and functions also have 'length' if( i == null || array.split || array.setInterval ) ret[0] = array; else while( i ) ret[--i] = array[i]; } return ret; }, That will fix the Scriptaculous conflict, but I don't know what other problems it may introduce. If it does cause any problems, then maybe there is some other method name that could be tested instead of array.call to achieve the same end. -Mike
[jQuery] Re: jQuery infected by script.aculo.us
Its important to know that I'm almost unable to change a bit of markup or other js libraries code, I'm being injected along with jQuery to this site, so I'm more like a "guest" in this uber-mix of js.
[jQuery] Re: i was patient, now i'm frustrated
This is a completely unrelated issue - we host jQuery.com (the homepage, blog, and dev) on a separate server with Rimuhosting. There was a power outage at the server facility and they're working ot bring it back up: http://rimuhosting.com/maintenance.jsp?server_maint_oid=68009362 The other sub-domains should be responding fine (docs, plugins, ui, code). --John On Fri, Sep 26, 2008 at 4:35 AM, Richard W <[EMAIL PROTECTED]> wrote: > > How long does it take to sort out hosting issues? > 1 month, 2 months? > I've been reading all the comments from frustrated developers who are > unable to do their job because the jQuery site does not load. I > thought those people should understand the situation and be patient. > Now it's my turn to complain, because now this is affecting my job. > Media Template obviously don't have the knowledge or capacity to > correctly host a high traffic site. What's the problem, really, i'm > curious why this SERIOUS issue has not been resolved after so long? >
[jQuery] Also...
Its important to know that I'm almost unable to change a bit of markup or other js libraries code, I'm being injected along with jQuery to this site, so I'm more like a "guest" in this uber-mix of js.
[jQuery] Re: jQuery infected by script.aculo.us
Hi Rey The jquery is 1.2.6 and scriptaculous is v1.7.0 Also an important note is: with prototype there's seem to be no problem, its when scriptaculous is added when everything is screwed. :( I've been debugging line by line (with firebug) the jQuery selector function and there's a time when it jumps to prototype.js code... I'll start again to see exactly where it happens but something related to bind() I think so. Thanks for the help! :) I think you can test with a file like this: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml"; dir="ltr"> DEMO $$j = jQuery.noConflict(true); $$j(document).ready(function(){ $$j("a").remove(); }); Something Something Something Something Something Something Something Something Something Something Something Something Then fire some $$('a') on firebug console and you will see what I'm talking about. Regards
[jQuery] Re: jQuery infected by script.aculo.us
What version of jQuery and Scriptaculous are you using? Rey ricardoe wrote: Hello, First of all, I need to get this working without touching markup. I really can't, only in very extreme cases. I'm loading jquery at the bottom of the body and script.aculo.us is on the head section. The main problem is: (I'm using jQuery.noConflict() and even tried myJq = jQuery.noConflict(true)) normally a jQuery('img',document.body) will return an object (Array) filled with the image elements. now, In the current page I'm stuck the jQuery('img',document.body) returns also an object but object[0] is a HTMLImageElement and this object also is an array that has all the image elements, so as you can imagine. jQuery('img',document.body).each() iterates over only 1 element and its the HTMLImageElement, and worse than that actually any query like jQuery('a') returns an array with 1 element and this element has all the desired elements. Please help me, is this documented? I can't find anythign about conflicts between both libraries. If I remove (I repeat this is a test, in the real thing I can't remove that) the script.aculo.us
[jQuery] Re: i was patient, now i'm frustrated
svn checkout http://jqueryjs.googlecode.com/svn/trunk/tools/api-browser jqueryapi open jqueryapi/index.html On Sep 26, 5:18 am, Richard W <[EMAIL PROTECTED]> wrote: > Thank you for the response Richard. > For me, (in London), the docs site takes on average about 3 minutes to > load per page. (I just tried again now.) The pages do eventually load,
[jQuery] Re: wrap function
Good greef Samy! That works like a charm - I did not think it´s that simple. Thanks a million. Q. On Sep 26, 3:18 pm, "Mauricio \(Maujor\) Samy Silva" <[EMAIL PROTECTED]> wrote: > Use wrapAll() method. > > Maujor > > -Mensagem Original- > De: "thelemondropkid" <[EMAIL PROTECTED]> > Para: "jQuery (English)" > Enviada em: sexta-feira, 26 de setembro de 2008 09:13 > Assunto: [jQuery] wrap function > > I´m stuck, please help! > > My code: > > > some header > > Lorem ipsum dolor sit amet > > > The jQuery: > > $(document).ready(function(){ > $("div.box-two > *").wrap(''); > }); > > The idea is to 'wrap' the , and the with a single class="inside">. > The problem I have is that ALL the elements are individually wrapped > with . Not what I want! > > How can i tell jquery to do this?
[jQuery] Re: i was patient, now i'm frustrated
You're complaining why? Why should the jQuery site not loading affect your job in any way? The jQuery site offers nothing to me that I can't find elsewhere. I can get the most recent jQuery release from Google code, Remy Sharp has the API hosted on his site (or his downloable AIR app), and I have this mailing list. Why do you need the site at all? andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Richard W Sent: Friday, September 26, 2008 3:36 AM To: jQuery (English) Subject: [jQuery] i was patient, now i'm frustrated How long does it take to sort out hosting issues? 1 month, 2 months? I've been reading all the comments from frustrated developers who are unable to do their job because the jQuery site does not load. I thought those people should understand the situation and be patient. Now it's my turn to complain, because now this is affecting my job. Media Template obviously don't have the knowledge or capacity to correctly host a high traffic site. What's the problem, really, i'm curious why this SERIOUS issue has not been resolved after so long?
[jQuery] Re: wrap function
Use wrapAll() method. Maujor -Mensagem Original- De: "thelemondropkid" <[EMAIL PROTECTED]> Para: "jQuery (English)" Enviada em: sexta-feira, 26 de setembro de 2008 09:13 Assunto: [jQuery] wrap function I´m stuck, please help! My code: some header Lorem ipsum dolor sit amet The jQuery: $(document).ready(function(){ $("div.box-two > *").wrap(''); }); The idea is to 'wrap' the , and the with a single . The problem I have is that ALL the elements are individually wrapped with . Not what I want! How can i tell jquery to do this?
[jQuery] Re: text() as a wrapped set?
Oh, and break everything that depends on the text method. On Sep 26, 9:16 am, 703designs <[EMAIL PROTECTED]> wrote: > I could also do something along these lines: > > $.fn.oldText = $.fn.text; > $.fn.text = function() { > return $(document.createTextNode(this.oldText())); > > } > > That is, of course, if I'd like to confuse the hell out of future > maintainers :) > > On Sep 25, 1:15 am, Balazs Endresz <[EMAIL PROTECTED]> wrote: > > > I think the easiest way is to write another plugin: > > > $.fn.$text=function(){ > > return $( document.createTextNode( this.text() ) ) > > > } > > > $("a").$text().appendTo("#sanbox"); > > > but you can extend the String prototype too: > > > String.prototype.jqueryify=function(){ > > return $( document.createTextNode( this ) ) > > > } > > > $('a').text().jqueryify().appendTo("#sanbox"); > > > On Sep 24, 8:27 pm, 703designs <[EMAIL PROTECTED]> wrote: > > > > Because the text method returns a string, it's missing appendTo and > > > other methods. Now, of course I can do this: > > > > $("#sandbox").text($("a").text()); > > > > But I'd prefer to do this: > > > > $("a").text().appendTo("#sanbox"); > > > > What goes between text and appendTo? Or is the first example the best > > > way to do this? > >
[jQuery] Re: text() as a wrapped set?
I could also do something along these lines: $.fn.oldText = $.fn.text; $.fn.text = function() { return $(document.createTextNode(this.oldText())); } That is, of course, if I'd like to confuse the hell out of future maintainers :) On Sep 25, 1:15 am, Balazs Endresz <[EMAIL PROTECTED]> wrote: > I think the easiest way is to write another plugin: > > $.fn.$text=function(){ > return $( document.createTextNode( this.text() ) ) > > } > > $("a").$text().appendTo("#sanbox"); > > but you can extend the String prototype too: > > String.prototype.jqueryify=function(){ > return $( document.createTextNode( this ) ) > > } > > $('a').text().jqueryify().appendTo("#sanbox"); > > On Sep 24, 8:27 pm, 703designs <[EMAIL PROTECTED]> wrote: > > > Because the text method returns a string, it's missing appendTo and > > other methods. Now, of course I can do this: > > > $("#sandbox").text($("a").text()); > > > But I'd prefer to do this: > > > $("a").text().appendTo("#sanbox"); > > > What goes between text and appendTo? Or is the first example the best > > way to do this? > >
[jQuery] treeview
Hello i hope someone can help this is driving me mad. Im using jquery-1.2.6.pack.js jquery-treeview.js jquery-cookie.js for a menu on www.bdct.nhs.uk everything works ok apart from in ie6 where some of the links disappear. but even this is inconsistent on different machines with ie6 installed. Can any one help? Also refreshing the page takes a long time is that because of the cookies? is there any way to speed this up? Cheers bdct
[jQuery] Re: Plugin that offers smart tag-like functionality?
Thought someone might have done something like this. HTML would be something like this: Action 1 Action 2 And jQuery (kind of works, but not in IE and doesn't hide if hovering over the content and out without going over the icon first): $(smarttags); function smarttags() { $("#smarttagicon").hover( function() { $("#smarttagcontent").show(); },function(e) { // if not over the smarttag div, hide content if(!$(e.relatedTarget).parents("#smarttag").length) { $("#smarttagcontent").hide(); } } ); } The 'smarttag' div would be hidden initially, but populated and shown when hovering over an element that it is applied to. I suppose a smart tag is an extension of a tooltip (which doesn't disappear if you mouse over it). -- Sam On Sep 25, 5:07 pm, Rey Bango <[EMAIL PROTECTED]> wrote: > Anyone know of a plugin that offers functionality like this? > > http://en.wikipedia.org/wiki/Image:Smarttags.PNG > > Rey...
[jQuery] wrap function
I´m stuck, please help! My code: some header Lorem ipsum dolor sit amet The jQuery: $(document).ready(function(){ $("div.box-two > *").wrap(''); }); The idea is to 'wrap' the , and the with a single . The problem I have is that ALL the elements are individually wrapped with . Not what I want! How can i tell jquery to do this?
[jQuery] suggestion - enable() / disable() functions
Dear all, I like jQuery much but I do not like the way the enabling, disabling elements is handled. This is a pretty common task and the current solution based on changing attributes is not in accord with jQuery’s “write less” philosophy. The enable() / disable() functions would be MUCH more elegant and in light with the jQuery gospel. Could this be included in the next release ? Best Martin
[jQuery] Re: Simple Queires for Function calling
"But in .js file it does not resolve the <%%> value. Any help would be appreciated. " As it shouldn't you've got a .js file, which IIS treats as plain ol text and passes through untouched, it will never get seen or more importantly processed by ASP.NET You've got options through: 1) Keep any dynamically created script in the asp or aspx page 2) create a new aspx page thats got all the JS markup inside it set it's ContentType to "text/javascript" But either way, the whole point of external js is so that the browser will cache it so it only needs to be downloaded once, so having changing values in a static js file doesn't make much sense anyways
[jQuery] Re: Simple Queires for Function calling
Take a look at the metadata plugin: http://plugins.jquery.com/project/metadata - Richard On Fri, Sep 26, 2008 at 7:09 AM, JQueryProgrammer <[EMAIL PROTECTED]>wrote: > > Understand. But my issue is a bit different which i think i could not > make it clear. I have a js file associated with every aspx page. Now > my code is like > > > > I tried to use the code (which is in my .js file) as: > > > $(function() { //document.ready > $("#myid").click(function() { > alert( "Hello " + <%= myValueFromServer%> ); > } > }); > > But in .js file it does not resolve the <%%> value. Any help would be > appreciated. > > On Sep 26, 2:13 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > > The same with jQuery looks like this: > > > > > >