[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....
thank's i'll give it a try ... stay tuned :D On 27 Gen, 22:45, Ricardo Tomasi ricardob...@gmail.com wrote: Hi Stefano, I think I found a solution. All you need to do is check if the callback has been called after your specified timeout. If it has not been called yet, overwrite it with an empty function, else do nothing. That will mess up with any further usage of the callback, but it works for this case anyway, take a look: http://jsbin.com/ukehu/http://jsbin.com/ukehu/edit Change the timeout: 1 in the $.jsonp() call to a short/long value to test it. I made the callback and timeout callback Firebug logs also. cheers, - ricardo On Jan 27, 5:01 pm, Ricardo Tomasi ricardob...@gmail.com wrote: Unless you remove the script tag after the 'timeout', of couse. On Jan 27, 9:59 am, Mike Alsup mal...@gmail.com wrote: ah and there is no way to simulate that? You can simulate a timeout in your code by using setTimeout, but it's not the same as when the XHR is used for the request. With XHR jQuery can invoke the abort fn to cancel the request. There is no such option for the jsonp script injection method. So you can not close the connection or do anything particularly useful other than assume your timeout is being called because the request failed. But then you're only guessing, and the response may return the moment after you time it out.
[jQuery] Re: [validate] Jquery validation plugin isn't working in IE
I'm sorry, but you have trailing commas: http://www.pluralsight.com/community/blogs/fritz/archive/2007/06/19/47771.aspx I hope its not too late :-) Jörn On Tue, Jan 27, 2009 at 11:46 PM, whtthehecker hecker.r...@gmail.com wrote: Hi, This is my first time using the validation plugin for jquery and i've got it working in firefox but when i test in IE it's not working. Here is the page: http://rickhecker.com/test/login-sign-up/index.html I'm sure it's something stupid that I'm doing because I don't see anyone else having the same problem so any help would be greatly appreciated! Thanks! p.s. the validation messages are a bit unique because it's for an alcohol related site :)
[jQuery] Re: cluetip with an dynamic aspx content
do anyone have a solution? On 26 Jan., 19:31, chrs chrs.alb...@googlemail.com wrote: hi karl, it is a parse error. the class, where the site is deduced, can't be loaded. (or something like this...) --- christian
[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....
Ok perfect :) Many thanks. So if i've understand the request continue loading and when server send back the response (if any) if the timeout as occured there is no callback set on window and do nothing else do the job have any sense try to shutdown the request? Is possible? Anyway thanks a lot. On 28 Gen, 09:23, Stefano Corallo stefan...@gmail.com wrote: thank's i'll give it a try ... stay tuned :D On 27 Gen, 22:45, Ricardo Tomasi ricardob...@gmail.com wrote: Hi Stefano, I think I found a solution. All you need to do is check if the callback has been called after your specified timeout. If it has not been called yet, overwrite it with an empty function, else do nothing. That will mess up with any further usage of the callback, but it works for this case anyway, take a look: http://jsbin.com/ukehu/http://jsbin.com/ukehu/edit Change the timeout: 1 in the $.jsonp() call to a short/long value to test it. I made the callback and timeout callback Firebug logs also. cheers, - ricardo On Jan 27, 5:01 pm, Ricardo Tomasi ricardob...@gmail.com wrote: Unless you remove the script tag after the 'timeout', of couse. On Jan 27, 9:59 am, Mike Alsup mal...@gmail.com wrote: ah and there is no way to simulate that? You can simulate a timeout in your code by using setTimeout, but it's not the same as when the XHR is used for the request. With XHR jQuery can invoke the abort fn to cancel the request. There is no such option for the jsonp script injection method. So you can not close the connection or do anything particularly useful other than assume your timeout is being called because the request failed. But then you're only guessing, and the response may return the moment after you time it out.
[jQuery] Re: Sending Arguments to Event
If you look at the examples in the bind documentation ( http://docs.jquery.com/Events/bind ) there's this sample: function handler(event) { alert(event.data.foo); } $(p).bind(click, {foo: bar}, handler) So for your example that could be: var someVar = { init : function () { $('#someID').bind(click, {'args': ['arg1', 'arg2']}, this.add); }, add : function(event) { alert(event.data.args[0] + ' : ' + event.data.args[1]); } }; Karl Rudd On Wed, Jan 28, 2009 at 5:12 PM, Anjanesh anjanesh.for...@gmail.com wrote: I understand jQuery has parameters stored in event.data.* But Is there a way to achieve this using jQuery ? var someVar = { init : function () { $('#someID').bind(click, ['arg1', 'arg2'], this.add); }, add : function(p1, p2) { alert(p1 + ' : ' + p2); // Doesnt show arg1 : arg2 } }; Thanks
[jQuery] newbie: autocompletion using hidden data inline in document
Hi, I have something like the following (fragment but shows context): var currentActiveCommands = jQuery(#menudiv ul li.runnable).find (a.c); var len = currentActiveCommands.length; var resulthtml = ; var field = document.getElementById(run_command); var currentidtoclick =; var display = jQuery(#autocompletval); var incrementer = 0; if(which != 13){ if(len 2){ var reg = new RegExp(field.value,i); currentActiveCommands.each(function(i) { if(reg.test($(this).html())) { if(incrementer == 0){ firstidinline = $(this).attr(id); //alert(i is less than 1 + currentidtoclick); } incrementer = incrementer + 1; currentidtoclick = $(this).attr(id); //alert(currentidtoclick); //note clicker function must be made cross- browser, IE uses fireEvent I use dispatchevent resulthtml = resulthtml + a href='#' onclick='clicker(\ + currentidtoclick + \)' + $(this).html() + /abr / display.html(resulthtml); display.css(display, block); // Add to body element }else{ } }); Anyway as can be seen what happens here is the data that needs to be queried is inside the document, currently hidden but could be displayed in some cases. When someone starts entering data in the input field it goes through this data and makes an autocomplete from the data in the document. The problem is that if data entered in the input field initially can match something in the document but then stops matching the previously possible matches are not removed from the display. What is the best way to handle this? Also should I perhaps do an initial read in of this data to some arrays and then do matches on the arrays? Or another suggestion?
[jQuery] How to decode Json value through Jquery
Hi! I am novice to Jquery. Iam getting following Json output from PHP file : {jval:{wine:3,sugar:4,lemon:22}} how can I decode/get these Json values in Jquery. Thanks in advance
[jQuery] jQuery 1.3.x XPath
Earlier version of jQuery allowed one to search for elements using XPath, but after the implementation of the Sizzler selector engine, the XPath support was lost, or so it seems. Any comments?
[jQuery] hiding flash content on a page
I am relatively new to javascript but wondered if anyone could help me. I am trying to hide flash content on a webpage and am using the following script: $(document).ready(function() { $('object').hide(); }); This seems to work on firefox and opera on a mac (not tested on a pc yet) but for some reason it wont hide the object in safari? I guess this is a bug but does anyone know of a work around? I have tried defining a direct id too but that doesnt make any difference. Any help would be greatly received. The script does work as i have tried replacing object with div and it works fine.
[jQuery] Re: How can I fix the mcDropdown plugin to jQuery 1.3.1?
i just stumbeled across the same problem is there any chance of you providing the lines that you altered to solve the problem On Jan 28, 6:32 am, Alexsandro_xpt bagul...@gmail.com wrote: Problem solved. The problem is with Selector [attribute=value] sintax which this empty comparison don't work. On 27 jan, 18:23, Alexsandro_xpt bagul...@gmail.com wrote: I using the at mcDropdown (http://www.givainc.com/labs/ mcdropdown_jquery_plugin.htm) but it don't work in jQuery 1.3.1. Firebug show me error at this line: thismenu.closeMenu(); And this is reference to: $.mcDropDownMenu = function(el, list, options){ var $self, thismenu = this(.); And $.mcDropDownMenu has lot private function just like .closeMenu(). But the reference for thismenu = this don't call it raising a error in firebug: this.closeMenu is not a function [Break on this error] this.closeMenu(); How can I fix it?
[jQuery] HELP!!! wait for fade out before replacement div fades in
Hi. Here is my code I'm trying to get this to fade out first before the fade in happens. Please help!! $(document).ready(function() { $(a.linkclass).click(function() { $('.msg_body').fadeOut(fast); $($(this).attr(href)).fadeIn(fast); }); }); Thank!
[jQuery] Reversing the SlideUp and SlideDown functions to slide from the bottom and not the top
I saw this was posted before, but there was never a solution posted. I want to use the Toggle function but have it slide up from the bottom of the div instead of the top, I have tried searching through all the plugins, and even tried writing my own but have had no luck. If there's anyone who can help me I would be extremely grateful.
[jQuery] Force GET on $.load()
I have written a small script that uses $.load() and I am trying to show a div through the callback. However, whenever I use more than one argument in the $.load() function, jQuery automatically assumes I am doing a POST request, causing my server to blow up. Anyone know how to force it into GET?
[jQuery] Re: IE7 dead pixels in jpg with animation effect
http://www.alexjudd.com/?p=5 Look like if you are ok with not having any pure black in your image you can just adjust levels and be ok. Sure seems easier to put the image on a div with a black background, and then size the div as appropriate. Wish we didn't have to jump through these hoops though!
[jQuery] Re: Ajax Problem
On Jan 28, 8:23 am, saiful.ha...@gmail.com saiful.ha...@gmail.com wrote: hi all, I have 2 file rating.js $(document).ready(function() { var behav = function(){ $(.rating_class).hover(function(){ $(#tooltip_star).css({visibility:visible, top:($ (this).offset().top - 60), left:($(this).offset().left+$(this).width ()+ 2)}); $.ajax({ type: POST, url: $(this).attr(href), success: function(msg){ $(#tooltip_star).html(msg); } }); }, function(){ $(#tooltip_star).css(visibility,hidden); }).ajaxStart(function(){ $(#tooltip_star).html(table class=\table_animation \trtdimg style=\text-align:center\ src=\/resource/images/ loading.gif\/td/tr/table); }); $(.rating_class).click(function(){ location = $(this).attr(href).replace(ajax_, ); return false; }); } behav(); }); there is just call function behav(); to run all sintax in this file, and i have some ajax sintax in other file file this $(document).ready(function() { var mainApp = function(page){ $.ajax({ type: POST, url: ?= base_url();?product/related/?= $idProduct ?/+page, success: function(msg){ $(#displayRelated).html(msg); behav(); } }); } mainApp(1); }); But i get some error in my firebug like this behav is not defined success()()6 (line 652) success()jquery-1.2.6.js (line 2818) onreadystatechange()()jquery-1.2.6.js (line 2773) [Break on this error] behav(); my question is, why my function behav() in rating.js can't called from success: function(msg){...}, there is need something like global function? thang's ~ saiful haqqi ~ Hi saiful, 1 = try to define ur behave(); function in that .js file where ur above ajax code. 2 = - if u have another .js file for behave(); function - if ur bringing html file with response then include ur .js file in that html response like this script type=text/javascript src=rating.js charset=utf-8/ script hope this will work. regards Regx :)
[jQuery] Re: HELP!!! wait for fade out before replacement div fades in
use animat() function $('.msg_body').animate({left: 50, opacity: 1}, 1500).fadeOut(1000); $($(this).attr(href)).animate({left: 50, opacity: 1}, 1500).fadeIn(1000); above animate function will fade out first after 1000 ms will proceed for fadein right now its getting fadeOut immediate getting fadeIn so ur not able to observe what happening or when it happening. :) regards, Regx On Wed, Jan 28, 2009 at 10:33 AM, TimmyH t...@thelevelco.com wrote: Hi. Here is my code I'm trying to get this to fade out first before the fade in happens. Please help!! $(document).ready(function() { $(a.linkclass).click(function() { $('.msg_body').fadeOut(fast); $($(this).attr(href)).fadeIn(fast); }); }); Thank! -- ---| Regard |--- Mohd.Tareque
[jQuery] Re: hiding flash content on a page
put the flash into it's own div (you should be using swfobject or something ideally, rather then an embed) then hide the div. riches.ke...@googlemail.com wrote: I am relatively new to javascript but wondered if anyone could help me. I am trying to hide flash content on a webpage and am using the following script: $(document).ready(function() { $('object').hide(); }); This seems to work on firefox and opera on a mac (not tested on a pc yet) but for some reason it wont hide the object in safari? I guess this is a bug but does anyone know of a work around? I have tried defining a direct id too but that doesnt make any difference. Any help would be greatly received. The script does work as i have tried replacing object with div and it works fine.
[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....
Hi Riccardo, i've a problem in the example you posted you do: $.jsonp({ url: 'http://api.flickr.com/services/feeds/photos_public.gne? tags=hackdayindialang=en-usformat=jsoncallback=jsonFlickrFeed', timeout: 1, onTimeout: function(url){ console.error('jsonp script timed out: '+url) } }); how about the success function? and the error one etc etc ?!?! I'm tring to something like this : .jsonp({ type: GET, url: some.php, data: name=Johnlocation=Boston, timeout: 1, // in seconds success: function(msg){ alert( Data Saved: + msg ); }, error:function(request, errorType, errorThrown){ alert(oppps ); }, onTimeout:function(url){ console.error('jsonp script timed out: '+url) } }); the success function is never executed (timeout or not). In your example you've defined a function before the $.jsonp call (the jsonFlickrFeed) and added in the url of the request ... why the success function is not working? I've forgotten something? Thanks. On 28 Gen, 10:15, Stefano Corallo stefan...@gmail.com wrote: Ok perfect :) Many thanks. So if i've understand the request continue loading and when server send back the response (if any) if the timeout as occured there is no callback set on window and do nothing else do the job have any sense try to shutdown the request? Is possible? Anyway thanks a lot. On 28 Gen, 09:23, Stefano Corallo stefan...@gmail.com wrote: thank's i'll give it a try ... stay tuned :D On 27 Gen, 22:45, Ricardo Tomasi ricardob...@gmail.com wrote: Hi Stefano, I think I found a solution. All you need to do is check if the callback has been called after your specified timeout. If it has not been called yet, overwrite it with an empty function, else do nothing. That will mess up with any further usage of the callback, but it works for this case anyway, take a look: http://jsbin.com/ukehu/http://jsbin.com/ukehu/edit Change the timeout: 1 in the $.jsonp() call to a short/long value to test it. I made the callback and timeout callback Firebug logs also. cheers, - ricardo On Jan 27, 5:01 pm, Ricardo Tomasi ricardob...@gmail.com wrote: Unless you remove the script tag after the 'timeout', of couse. On Jan 27, 9:59 am, Mike Alsup mal...@gmail.com wrote: ah and there is no way to simulate that? You can simulate a timeout in your code by using setTimeout, but it's not the same as when the XHR is used for the request. With XHR jQuery can invoke the abort fn to cancel the request. There is no such option for the jsonp script injection method. So you can not close the connection or do anything particularly useful other than assume your timeout is being called because the request failed. But then you're only guessing, and the response may return the moment after you time it out.
[jQuery] Cloning list items in OL screws up numbering in IE
Hi all, I've got an ordered list OL with 5 list items. Each list item contains an input and the list is, as you would expect, numbered from 1 to 5. There is a link to add another item to this list which I have bound the following function to: $(#materialadd).click(function() { $(#materialol li:last).clone().appendTo(#materialol); $(#materialol li:last).hide().fadeIn(fast); return false; }); #materialol is the list - the last item is cloned and appended to the end of the list, then hidden and faded in so the user can spot the change. In Firefox, this works perfectly, and the list numbering is continued. Click it once, and the next item is 6, then 7, then 8... In IE.. not so much. IE 6 and 7 both execute the cloning and addition process but the list items numbers of the cloned + added items are 1. So you end up with a list numbered 1, 2, 3, 4, 5, 1, 1, 1, 1, 1. Is there another way for me to do what I'm doing that will work properly in IE as well as FF? I'm using jQ 1.2.6 by the way. Regards, Michael Price
[jQuery] Re: How to decode Json value through Jquery
If you use AJAX to get your data, take a look at: jQuery.getJSON() http://docs.jquery.com/Ajax/jQuery.getJSON If your JSON data came from another source, suppose your JSON data are stored in a string variable called json, you can simply do: eval(var obj=+json); then the variable obj will hold the decoded JSON data. However this method is quite insecure if the data came from an untrusted source (e.g. over the Internet). Therefore I would recommend to use the secureEvalJSON() method of the json plugin. http://code.google.com/p/jquery-json/ by(e) Stephan 2009/1/28 Bluesapphire michealg...@gmail.com: Hi! I am novice to Jquery. Iam getting following Json output from PHP file : {jval:{wine:3,sugar:4,lemon:22}} how can I decode/get these Json values in Jquery. Thanks in advance
[jQuery] Re: How to decode Json value through Jquery
jquery encode / decode plugin is available try it hope ur will find solution Regx http://www.prodevtips.com/2008/10/21/jquery-plugin-html-decode-and-encode/ On Wed, Jan 28, 2009 at 5:09 PM, Bluesapphire michealg...@gmail.com wrote: Hi! I am novice to Jquery. Iam getting following Json output from PHP file : {jval:{wine:3,sugar:4,lemon:22}} how can I decode/get these Json values in Jquery. Thanks in advance -- ---| Regard |--- Mohd.Tareque
[jQuery] Re: How to use one button to toggle multiple panels in succession
I'm not sure if I realy understand what you want to do, but it could look something like HTML: div id=root div class=myHeaderbutton+/button/div div class='myPanel'1/div div class='myPanel'2/div div class='myPanel'3/div div class='myPanel'4/div div class='myPanel'5/div /div JavaScript: var myPanels = $(.myPanel).hide(); var nextPanel = 0; $(.myHeader button).click(function(){ if (nextPanel myPanels.length) { $(myPanels[nextPanel++]).slideDown(); } }); However, you may have problems if you delete or insert a panel. A more flexible, but not so performat method would be: (same HTML) JavaScript: var myPanels = $(.myPanel).hide(); $(.myHeader button).click(function(){ $(.myPanel:hidden:first).slideDown(); }); by(e) Stephan 2009/1/27 webopolis krodenho...@gmail.com: I want to have 1 + with x number of slide panels set to display: none; under it . When a user clicks the + a panel is revealed. Each time the + is clicked, the next panel is revealed, and so on. Each panel will have a x that can be clicked to close itself. I figure I would have to create an array for my collection of DIVs, then with clicks, iterate through each one until I have the desired number of panels revealed, or, I reach the end of the array. I just have no idea how to begin with this. Am I making any sense?
[jQuery] Re: newbie: autocompletion using hidden data inline in document
Hi, Ok solved my problem. Using methods shown here: http://www.mattryall.net/blog/2008/07/jquery-filter-demo Cheers, Bryan Rasmussen On Jan 28, 12:06 pm, pantagruel rasmussen.br...@gmail.com wrote: Hi, I have something like the following (fragment but shows context): var currentActiveCommands = jQuery(#menudiv ul li.runnable).find (a.c); var len = currentActiveCommands.length; var resulthtml = ; var field = document.getElementById(run_command); var currentidtoclick =; var display = jQuery(#autocompletval); var incrementer = 0; if(which != 13){ if(len 2){ var reg = new RegExp(field.value,i); currentActiveCommands.each(function(i) { if(reg.test($(this).html())) { if(incrementer == 0){ firstidinline = $(this).attr(id); //alert(i is less than 1 + currentidtoclick); } incrementer = incrementer + 1; currentidtoclick = $(this).attr(id); //alert(currentidtoclick); //note clicker function must be made cross- browser, IE uses fireEvent I use dispatchevent resulthtml = resulthtml + a href='#' onclick='clicker(\ + currentidtoclick + \)' + $(this).html() + /abr / display.html(resulthtml); display.css(display, block); // Add to body element }else{ } }); Anyway as can be seen what happens here is the data that needs to be queried is inside the document, currently hidden but could be displayed in some cases. When someone starts entering data in the input field it goes through this data and makes an autocomplete from the data in the document. The problem is that if data entered in the input field initially can match something in the document but then stops matching the previously possible matches are not removed from the display. What is the best way to handle this? Also should I perhaps do an initial read in of this data to some arrays and then do matches on the arrays? Or another suggestion?
[jQuery] Re: onblur Firing Ahead Of onclick
Hi bob, So it works exactly how I would expect that it should work. 1. the focus is taken from the input, so you get a blur event 2. the submit button is clicked, so you get a submit event How about simply ignoring the blur event if you don't use it? If you use it for data validation you would want do to it BEFORE you submit the form, so the order 1. blur event - data validation, set validation flag to true / false 2. submit event - submit form if validation flag is true makes sense for me. by(e) Stephan 2009/1/27 bob xoxeo...@gmail.com: jQuery('form[name=myForm]').bind('submit', validateForm); jQuery('#login').bind('focus', validateForm); jQuery('#blur').bind('blur', validateForm); Problem: when I click login text field and then Submit button what happens is that instead of alert('submit'); I get alert('blur'); What can I do about it? I need to have alert('submit'); triggered every time I click it. form name=myForm id=myForm method=post onsubmit=return false; input type=text name=login id=login input type=submit value=Submit/ function validateForm(e){ if(e.type=='submit'){alert('submit');} if(e.type=='blur'){alert('blur');} }
[jQuery] Re: HELP!!! wait for fade out before replacement div fades in
simply do the fade in in the finished callback of the fade out $(a.linkclass).click(function() { var next = $($(this).attr(href)); $('.msg_body').fadeOut(fast, function(){ next.fadeIn(fast); }) }); by(e) Stephan
[jQuery] Re: cluetip with an dynamic aspx content
Hi Christian, Sounds like the problem is on the server end of things? I really don't know, given the little information that I have. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 28, 2009, at 3:45 AM, chrs wrote: do anyone have a solution? On 26 Jan., 19:31, chrs chrs.alb...@googlemail.com wrote: hi karl, it is a parse error. the class, where the site is deduced, can't be loaded. (or something like this...) --- christian
[jQuery] Re: jQuery 1.3.x XPath
On Jan 28, 2009, at 6:43 AM, Neil Craig wrote: Earlier version of jQuery allowed one to search for elements using XPath, but after the implementation of the Sizzler selector engine, the XPath support was lost, or so it seems. Any comments? Hi Neil, You're right that 1.3.x removed support for the [...@attr] syntax, but it had been deprecated already for a long time. Using [attr] will achieve the same thing. As of jQuery 1.2 (released Sept. 24, 2007), basic XPath such as location path expressions, was removed. There is an XPath compatibility plugin for those expressions at http://plugins.jquery.com/project/xpath/ . Is that no longer working for you? --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: Reversing the SlideUp and SlideDown functions to slide from the bottom and not the top
On Jan 27, 2009, at 11:07 PM, ryjohnson wrote: I saw this was posted before, but there was never a solution posted. I want to use the Toggle function but have it slide up from the bottom of the div instead of the top, I have tried searching through all the plugins, and even tried writing my own but have had no luck. If there's anyone who can help me I would be extremely grateful. The easiest way I have found to accomplish this is through CSS: #myDiv { position: absolute; /* could also be relative */ left: 0; bottom: 0; /* *** this is the important one *** */ } You'll have to tweak things to work in your situation, and you may have to add a height and width if you're setting position:absolute. I implemented this reverse slide effect here: http://www.littleorangestar.com/ When you click on one of the badges, you'll see a lightbox effect, but also, if you look at the bottom of the viewport, you'll see the close bar slide up into view. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: Passing an HTML page fragment as an Ajax XML field
Many thanks jay for your responses. The first one - using load() to filter the response - unfortunately load() will then discard the remainder of the XML response. I want to pass the HTML fragment as part of a larger XML message and use the data from the other fields as well. I would have to make the request twice (once for the HTML fragment, once for the XML fields and things will have changed server-side in the interim). I am using $.ajax(). I haven't testing load() but I suspect in any case it may require a text (rather than XML response) from the server to work, much like $.ajax (). In your second example, yes this works because you are passing HTML to the after() method (provided of course you use valid HTML element tags, such as span or div rather than frag). However the problem I have is passing XML to after() rather than HTML To demonstrate, I quickly wrote up the example above into code and tested it. This is the XML file (response.xml) sitting on the server: ?xml version=1.0? response cityid2/cityid frag div class=citybox h2 class=citytitleCity of London/h2 p class=descLondon is on the River Thames/p /div /frag /response And this is the requesting webpage: html head script type='text/javascript' src=jquery.js/script script type='text/javascript' $(function(){ $(#button).click(function(){ $.ajax ({ url: response.xml, success: function(data, status) { alert (Received City ID +$(data).find(cityid).text ()); $(#title).after($(data).find(frag).children()); } }); }); }); /script /head body p id=titleCities of the World/p input type=button id=button value=Get /body The above receives the XML message, displays the city ID correctly, but then fails to insert the HTML fragment into the webpage...
[jQuery] Re: Cloning list items in OL screws up numbering in IE
Hi, Michael... I was having a similar problem cloning image inputs and found this solution for that problem, which might also be modified to solve your li cloning problem. In the notes, it basically says that not all modern browsers (IE, I think is the problem here) updates the values of cloned elements. So this fellow, Ben Nadel, developed a word-around: Here's the link... http://www.bennadel.com/blog/1375-Ask-Ben-Dynamically-Adding-File-Upload-Fields-To-A-Form-Using-jQue ry.htm Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Michael Price Sent: Wednesday, January 28, 2009 7:10 AM To: jquery-en@googlegroups.com Subject: [jQuery] Cloning list items in OL screws up numbering in IE Hi all, I've got an ordered list OL with 5 list items. Each list item contains an input and the list is, as you would expect, numbered from 1 to 5. There is a link to add another item to this list which I have bound the following function to: $(#materialadd).click(function() { $(#materialol li:last).clone().appendTo(#materialol); $(#materialol li:last).hide().fadeIn(fast); return false; }); #materialol is the list - the last item is cloned and appended to the end of the list, then hidden and faded in so the user can spot the change. In Firefox, this works perfectly, and the list numbering is continued. Click it once, and the next item is 6, then 7, then 8... In IE.. not so much. IE 6 and 7 both execute the cloning and addition process but the list items numbers of the cloned + added items are 1. So you end up with a list numbered 1, 2, 3, 4, 5, 1, 1, 1, 1, 1. Is there another way for me to do what I'm doing that will work properly in IE as well as FF? I'm using jQ 1.2.6 by the way. Regards, Michael Price
[jQuery] Re: Cloning list items in OL screws up numbering in IE
Thanks Rick, I'll check that out. Meanwhile, my own testing has uncovered a possible cause, and it's an odd one. If I comment out this line: $(#materialol li:last).hide().fadeIn(fast); The list items are numbered correctly! Curiouser and curiouser.. Regards, Michael Price Rick Faircloth wrote: Hi, Michael... I was having a similar problem cloning image inputs and found this solution for that problem, which might also be modified to solve your li cloning problem. In the notes, it basically says that not all modern browsers (IE, I think is the problem here) updates the values of cloned elements. So this fellow, Ben Nadel, developed a word-around: Here's the link... http://www.bennadel.com/blog/1375-Ask-Ben-Dynamically-Adding-File-Upload-Fields-To-A-Form-Using-jQue ry.htm Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Michael Price Sent: Wednesday, January 28, 2009 7:10 AM To: jquery-en@googlegroups.com Subject: [jQuery] Cloning list items in OL screws up numbering in IE Hi all, I've got an ordered list OL with 5 list items. Each list item contains an input and the list is, as you would expect, numbered from 1 to 5. There is a link to add another item to this list which I have bound the following function to: $(#materialadd).click(function() { $(#materialol li:last).clone().appendTo(#materialol); $(#materialol li:last).hide().fadeIn(fast); return false; }); #materialol is the list - the last item is cloned and appended to the end of the list, then hidden and faded in so the user can spot the change. In Firefox, this works perfectly, and the list numbering is continued. Click it once, and the next item is 6, then 7, then 8... In IE.. not so much. IE 6 and 7 both execute the cloning and addition process but the list items numbers of the cloned + added items are 1. So you end up with a list numbered 1, 2, 3, 4, 5, 1, 1, 1, 1, 1. Is there another way for me to do what I'm doing that will work properly in IE as well as FF? I'm using jQ 1.2.6 by the way. Regards, Michael Price
[jQuery] cycle plugin scrollLeft has flickering white line if boxes have a background color colour
Although I did manage to fix it by changing this line opts.cssBefore.left = next.offsetWidth; becomes opts.cssBefore.left = next.offsetWidth-1; so does move everything along by 1 pixel but no more bug client is happy.
[jQuery] Re: Alternate row colors using Ajax
Thanks. I tried that but it did not work. Tried placing it within the function, outside the function, etc. I think the issue has something to do with the dynamic creation of the table. I've done this in the past with Spry which has operators that enable you to do this. I haven't been able to find similar features in jQuery. On Jan 27, 7:13 pm, donb falconwatc...@comcast.net wrote: $(tr:odd,table.stripeme).addClass('altcolor'); is a way to stripe the rows. It is assumed there is a class 'altcolor' with a suitable background-color definition. On Jan 27, 4:43 pm, septemberbrain kindlerda...@gmail.com wrote: I have some code that reads an xml file and outputs to a table. I would like the rows to have alternate colors but cannot get it to work properly. Below is my code. Hope someone can help. Thanks! script src=../jQuery/jquery-1.3.1.min.js type=text/javascript/ script style type=text/css tr.alt td {background:#e1e7e8;} tr.over td {background::#99a4a4;} /style script type=application/javascript $(document).ready(function(){ $.ajax({ type: GET, url: FTF_OLL.xml, dataType: xml, success: function(xml) { $(xml).find('Document').each(function(){ var title_text = $(this).find('Title').text() var type_text = $(this).find('Type').text() var format_text = $(this).find('Format').text () var location_text = $(this).find ('Location').text() var track_text = $(this).find('Track').text() var company_text = $(this).find ('Company').text() $('tr/tr') .html('td' + title_text + '/tdtd' + type_text + '/tdtd' + format_text + '/tdtd' + location_text + '/tdtd' + track_text + '/tdtd' + company_text + '/td' ) .appendTo('#update-target table'); }); //close each( } }); //close $.ajax( }); //close $( /script /head body p div id='update-target' table class=stripeMetrtdTitle/tdtdType/ tdtdFormat/tdtdLocation/tdtdTrack/tdtdCompany/td/ tr/table /div /p
[jQuery] Re: Alternate row colors using Ajax
Thanks. I tried that but it did not work. Tried placing it within the function, outside the function, etc. I think the issue has something to do with the dynamic creation of the table. I've done this in the past with Spry which has operators that enable you to do this. I haven't been able to find similar features in jQuery. On Jan 27, 7:13 pm, donb falconwatc...@comcast.net wrote: $(tr:odd,table.stripeme).addClass('altcolor'); is a way to stripe the rows. It is assumed there is a class 'altcolor' with a suitable background-color definition. On Jan 27, 4:43 pm, septemberbrain kindlerda...@gmail.com wrote: I have some code that reads an xml file and outputs to a table. I would like the rows to have alternate colors but cannot get it to work properly. Below is my code. Hope someone can help. Thanks! script src=../jQuery/jquery-1.3.1.min.js type=text/javascript/ script style type=text/css tr.alt td {background:#e1e7e8;} tr.over td {background::#99a4a4;} /style script type=application/javascript $(document).ready(function(){ $.ajax({ type: GET, url: FTF_OLL.xml, dataType: xml, success: function(xml) { $(xml).find('Document').each(function(){ var title_text = $(this).find('Title').text() var type_text = $(this).find('Type').text() var format_text = $(this).find('Format').text () var location_text = $(this).find ('Location').text() var track_text = $(this).find('Track').text() var company_text = $(this).find ('Company').text() $('tr/tr') .html('td' + title_text + '/tdtd' + type_text + '/tdtd' + format_text + '/tdtd' + location_text + '/tdtd' + track_text + '/tdtd' + company_text + '/td' ) .appendTo('#update-target table'); }); //close each( } }); //close $.ajax( }); //close $( /script /head body p div id='update-target' table class=stripeMetrtdTitle/tdtdType/ tdtdFormat/tdtdLocation/tdtdTrack/tdtdCompany/td/ tr/table /div /p
[jQuery] Re: This code, no response...will this work, if modified?
Arrggh! Dummy me... I had the select input named agents, but was referring in the jQuery to what I thought was its class .agents. Now that the class has been assigned as .agents, all is working. Thanks, guys, sorry for the silly mistake! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Tuesday, January 27, 2009 4:08 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: This code, no response...will this work, if modified? Thanks for the feedback, MorningZ and Eric. I've tried both your suggested changes for this line: I tried: $(this).find('option:selected').each(function() { and $('option:selected', this).each(function() { but nothing's working. I also tried re-writing it according to your suggestion, Eric, (see below), but that didn't work...no error messages, but no response at all. How could I use console.log (or something else) to troubleshoot this? Thanks for your help, both of you! Rick $(document).ready(function() { $(function() { var agent_data = { dsn: 'cfoutput#application.dsn#/cfoutput', method: 'get_new_agent', returnFormat: 'json', agent_id: null }; $('.agents').change(function() { $('option:selected', this).each(function() { agent_data.agent_id = $(this).val(); $.post('../components/floor_duty.cfc?', agent_data, function() { alert( response.MESSAGE == 'Success' ? 'Success' : 'Failure' ); }), 'json' }); }); }) }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Eric Garside Sent: Tuesday, January 27, 2009 3:27 PM To: jQuery (English) Subject: [jQuery] Re: This code, no response...will this work, if modified? $('this option:selected').each(function() { Should be changed to $('option:selected', this).each(function() { That's the only glaring error I saw with it. Though you could probably clean it up a bit: $(function(){ var agent_data = {dsn: 'cfoutput#application.dsn#/cofoutput', method: 'get_new_agent', returnFormat: 'json', agent_id: null}; $('.agents').change(function(){ $('option:selected', this).each(function(){ agent_data.agent_id = $(this).val(); $.post('../components/floor_duty.cfc?', agent_data, function() { alert( response.MESSAGE == 'Success' ? 'Success' : 'Failure' ); }), 'json'); }); }) }); On Jan 27, 3:12 pm, Rick Faircloth r...@whitestonemedia.com wrote: Hi, all... Are the first three lines of code below legitimate? I've got a page full of dropdowns (.agents) and when a user uses one to change the agent, I want to send the choice to my processing page via ajax. I want to trigger the ajax function when the user changes the selection and I saw in the docs where the option selection could be used to do that, so I tried to modify the code to suit my needs. Apparently, I've got something wrong, because I get no response from changing the dropdown. No errors in Firebug, either. The first three lines of code are of concern and also the use of this to specify the agent_id in the formval var. Will those code work, if modified, or should I just go with changing the dropdown and then giving the user an update button to trigger the ajax function? Thanks for any feedback. Rick script $(document).ready(function() { $('.agents').change(function() { $('this option:selected').each(function() { var formval = { dsn: 'cfoutput#application.dsn#/cfoutput', agent_id: $(this).attr('value') }; $.ajax({ cache: false, type: POST, url: ../components/floor_duty.cfc?method=get_new_agentreturnFormat=json, dataType: json, data: formval, success: function(response) { if (response.MESSAGE == 'Success') { alert('Success'); } else { alert('Failure'); } } }); }); }); });
[jQuery] paragraphs disappearing from accordion when jquery applied
I'm trying to use the accordion box as show on http://www.webdesignerwall.com/demo/jquery/accordion1.html I'm using PL/SQL to pull my content from the database which it does perfectly. I then applied my CSS and it also displays the way I'd expect. However, when I add my jquery.js file and extra bit of code, the content displays with one exception; any paragraphs after the first don't display. My content is like so: [code] div class=accordion h3question/h3 panswer para 1/p panswer para 2/p panswer para 3/p /div [/code]However, after applying: [code]script type=text/javascript $(document).ready(function(){ $(.accordion h3:first).addClass(active); $(.accordion p:not(:first)).hide(); $(.accordion h3).click(function(){ $(this).next(p).slideToggle(slow) .siblings(p:visible).slideUp(slow); $(this).toggleClass(active); $(this).siblings(h3).removeClass(active); }); }); /script [/code]panswer para 2/p panswer para 3/p don't display. Any ideas why? It's an Intranet environment so apologies for lack of links.
[jQuery] Re: How can I fix the mcDropdown plugin to jQuery 1.3.1?
Just Find line with li[ You will found line within jQuery expressions like that: $list.find(li[ + settings.valueAttr + ='+ value +']); Remove the ' char before and behind of + value + . I wish help you. On 28 jan, 05:53, WobblyBob hurrican...@gmail.com wrote: i just stumbeled across the same problem is there any chance of you providing the lines that you altered to solve the problem On Jan 28, 6:32 am, Alexsandro_xpt bagul...@gmail.com wrote: Problem solved. The problem is with Selector [attribute=value] sintax which this empty comparison don't work. On 27 jan, 18:23, Alexsandro_xpt bagul...@gmail.com wrote: I using the at mcDropdown (http://www.givainc.com/labs/ mcdropdown_jquery_plugin.htm) but it don't work in jQuery 1.3.1. Firebug show me error at this line: thismenu.closeMenu(); And this is reference to: $.mcDropDownMenu = function(el, list, options){ var $self, thismenu = this(.); And $.mcDropDownMenu has lot private function just like .closeMenu(). But the reference for thismenu = this don't call it raising a error in firebug: this.closeMenu is not a function [Break on this error] this.closeMenu(); How can I fix it?
[jQuery] function after each -loop
Hi Need som smart advice here, I have a eachloop like this. $(inp...@name='category']).each(function(){ }); And then I want to run a function after the each i done Is that possible? all the best / johannes
[jQuery] function in plugin not running
I tried to debug my first attempt to write a JQuery Plugin, and found out that none of the functions inside my plugin-attempt are executed. Looks like this: $.fn.galletri = function(){ console.log(inside galletri1); TNL = $(this); return this.each(function(){ console.log(inside galletri2); $(TNL + a).fadeTo(0, 0.4); $(TNL + a).hover(function(){ $(this).stop().fadeTo(100, 1); }, function(){ $(this).fadeTo(100, 0.4);}); $(TNL + a).click(function(){ console.log(inside click); ManageClick($(this).attr(Picture1), $(this).attr(Picture2), $ (this).attr(Picture3), $(this).attr(title)); return false; }); function ManageClick(src1, src2, src3, text){ $(#Picture2).addClass(loading); $(#PictureDesc).fadeOut(300, function(){ $(this).html('p' + text + '/p').fadeIn(400); }); NewPic(#Picture1, src1, 400); NewPic(#Picture2, src2, 800); NewPic(#Picture3, src3, 1200); } function NewPic(id, src, fadeTime){ pic = $(id + img); pic.stop(); if(pic.length){ $(id).append(p id='fill'nbsp;/p); pic.fadeOut(300).remove(); } if(src != ){ var largeImage = new Image(); $(largeImage).attr(src, src) .load(function() { $(largeImage).hide(); $(#Picture2).removeClass(loading); $(id).append(largeImage); $(largeImage).fadeIn(fadeTime); $(#fill).remove(); }); }} $(TNL + a:first).click(); });}; The console messages are: inside galletri1 galletri forsoeg
[jQuery] Re: function after each -loop
Just put the call after the each loop $(document).ready(function() { $(inp...@name='category']).each(function(){ }); LoopComplete(); }); function LoopComplete() { alert(All done with loop!); } On Jan 28, 10:13 am, johannesF johannes.foss...@gmail.com wrote: Hi Need som smart advice here, I have a eachloop like this. $(inp...@name='category']).each(function(){ }); And then I want to run a function after the each i done Is that possible? all the best / johannes
[jQuery] How to wait for load() to finish executing
How can I wait for the load() function to finish before executing the next line of code? The code that I need to execute after load() is finished cannot be called within the callback function. I basically need to return true after the load has finished but not beforehand. Here's the relevant code: jQuery(this).cluetip({ cluetipClass: 'jtip', arrows: true, dropShadow: false, hoverIntent: false, sticky: true, mouseOutClose: false, closePosition: 'title', closeText: 'close', activation: 'click', local: true, hideLocal: true, onActivate: function() { var url = jQuery(this).attr(href); jQuery(this).load(url); //dont' return true until load() is finished return true; } });
[jQuery] All is well except in IE - links initially not clickable
Hi, My site (http://pthesis.com) works fine in Firefox/Opera/Safari, but in IE 7 there is a small hitch. Sometimes when I click the portfolio link and open it, the links to the sites in the left column aren't clickable. If I close it and re-open it, they work, and if I do Refine by category and then click, they work. As I mentioned, this only happens in IE 7. I've tested in IE 8 beta 2 and it works fine. Does anyone have any suggestions for a workaround? If it would be helpful I'll post the page code here, or you may view it directly from the site. Thanks for your help, Precar.
[jQuery] Re: Force GET on $.load()
Just use $.get: $.get('bohemia.php', { mydata: 123, ourdata: 456 }, function(data){ $('#mydiv').html( data ); }, 'html'); http://docs.jquery.com/Ajax/jQuery.get On Jan 28, 2:07 am, penjuin jeremy@gmail.com wrote: I have written a small script that uses $.load() and I am trying to show a div through the callback. However, whenever I use more than one argument in the $.load() function, jQuery automatically assumes I am doing a POST request, causing my server to blow up. Anyone know how to force it into GET?
[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....
It isn't possible to have error/success callbacks for JSONP. You can't cancel the request either. Once you add a script tag to the head, the browser fires a GET request and it can't be interrupted - even if you remove the script before the response comes, the script will still run. (the only event that fires on the script tag is 'onload', but it only tells you if the content has successfully loaded, not the opposite. There is no way to know if an error happened) Also, you're misunderstanding the way JSONP works - there is no need for a 'success' function, that is the callback function which will be called when the response is loaded. Thats 'jsonFlickerFeed' in my example. cheers, - ricardo On Jan 28, 10:07 am, Stefano Corallo stefan...@gmail.com wrote: Hi Riccardo, i've a problem in the example you posted you do: $.jsonp({ url: 'http://api.flickr.com/services/feeds/photos_public.gne? tags=hackdayindialang=en-usformat=jsoncallback=jsonFlickrFeed', timeout: 1, onTimeout: function(url){ console.error('jsonp script timed out: '+url) } }); how about the success function? and the error one etc etc ?!?! I'm tring to something like this : .jsonp({ type: GET, url: some.php, data: name=Johnlocation=Boston, timeout: 1, // in seconds success: function(msg){ alert( Data Saved: + msg ); }, error:function(request, errorType, errorThrown){ alert(oppps ); }, onTimeout:function(url){ console.error('jsonp script timed out: '+url) } }); the success function is never executed (timeout or not). In your example you've defined a function before the $.jsonp call (the jsonFlickrFeed) and added in the url of the request ... why the success function is not working? I've forgotten something? Thanks. On 28 Gen, 10:15, Stefano Corallo stefan...@gmail.com wrote: Ok perfect :) Many thanks. So if i've understand the request continue loading and when server send back the response (if any) if the timeout as occured there is no callback set on window and do nothing else do the job have any sense try to shutdown the request? Is possible? Anyway thanks a lot. On 28 Gen, 09:23, Stefano Corallo stefan...@gmail.com wrote: thank's i'll give it a try ... stay tuned :D On 27 Gen, 22:45, Ricardo Tomasi ricardob...@gmail.com wrote: Hi Stefano, I think I found a solution. All you need to do is check if the callback has been called after your specified timeout. If it has not been called yet, overwrite it with an empty function, else do nothing. That will mess up with any further usage of the callback, but it works for this case anyway, take a look: http://jsbin.com/ukehu/http://jsbin.com/ukehu/edit Change the timeout: 1 in the $.jsonp() call to a short/long value to test it. I made the callback and timeout callback Firebug logs also. cheers, - ricardo On Jan 27, 5:01 pm, Ricardo Tomasi ricardob...@gmail.com wrote: Unless you remove the script tag after the 'timeout', of couse. On Jan 27, 9:59 am, Mike Alsup mal...@gmail.com wrote: ah and there is no way to simulate that? You can simulate a timeout in your code by using setTimeout, but it's not the same as when the XHR is used for the request. With XHR jQuery can invoke the abort fn to cancel the request. There is no such option for the jsonp script injection method. So you can not close the connection or do anything particularly useful other than assume your timeout is being called because the request failed. But then you're only guessing, and the response may return the moment after you time it out.
[jQuery] Re: How to block the javascript engine when jQuery.ui.dialog is pop up?
The only elegant solution is to structure your code so that there are no 'loose' statementes following dialog('open'), then call them from the dialog close callback. You can't stop the browser other than freezing it with a loop. On Jan 28, 1:16 am, mctpursuer mctpurs...@yahoo.com wrote: Hi, I am trying to replace javascript built-in alert prompt with jQuery.ui.dialog, the problem is dialog won't block the javascript engine from excuting statements following the dialog(open). Is there an elegant solution for this? Thanks.
[jQuery] Re: All is well except in IE - links initially not clickable
It looks like it's not appending the selected class to the li onClick in IE7. Are you using the bind() method to apply the click functionality? On Jan 28, 10:34 am, precar pranshua...@gmail.com wrote: Hi, My site (http://pthesis.com) works fine in Firefox/Opera/Safari, but in IE 7 there is a small hitch. Sometimes when I click the portfolio link and open it, the links to the sites in the left column aren't clickable. If I close it and re-open it, they work, and if I do Refine by category and then click, they work. As I mentioned, this only happens in IE 7. I've tested in IE 8 beta 2 and it works fine. Does anyone have any suggestions for a workaround? If it would be helpful I'll post the page code here, or you may view it directly from the site. Thanks for your help, Precar.
[jQuery] Re: function after each -loop
MZ... what role does the first LoopComplete(); play in the code in your response at the bottom of the page. How would the code behave differently if it was just $(document).ready(function() { $(inp...@name='category']).each(function() { }); function LoopComplete() { alert(All done with loop!); }); Thanks for any guidance and info... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Wednesday, January 28, 2009 10:32 AM To: jQuery (English) Subject: [jQuery] Re: function after each -loop Just put the call after the each loop $(document).ready(function() { $(inp...@name='category']).each(function(){ }); LoopComplete(); }); function LoopComplete() { alert(All done with loop!); } On Jan 28, 10:13 am, johannesF johannes.foss...@gmail.com wrote: Hi Need som smart advice here, I have a eachloop like this. $(inp...@name='category']).each(function(){ }); And then I want to run a function after the each i done Is that possible? all the best / johannes
[jQuery] $('#list').unbind().html('') -- redundant?
I have a dynamically generated a long list of items with events bound to them. I was wondering, when I clear the list, or replace it, is it necessary to unbind all their events before clearing its parent container? I know I can experiment to answer this question, but I wanted to know if perhaps html('') on the parent container runs unbind() anyways? ...Rene
[jQuery] Re: paragraphs disappearing from accordion when jquery applied
Is this like, a test? $(.accordion p:not(:first)).hide(); that line, why do you think no paragraphs are displaying after the first? Steven Grant wrote: I'm trying to use the accordion box as show on http://www.webdesignerwall.com/demo/jquery/accordion1.html I'm using PL/SQL to pull my content from the database which it does perfectly. I then applied my CSS and it also displays the way I'd expect. However, when I add my jquery.js file and extra bit of code, the content displays with one exception; any paragraphs after the first don't display. My content is like so: [code] div class=accordion h3question/h3 panswer para 1/p panswer para 2/p panswer para 3/p /div [/code]However, after applying: [code]script type=text/javascript $(document).ready(function(){ $(.accordion h3:first).addClass(active); $(.accordion p:not(:first)).hide(); $(.accordion h3).click(function(){ $(this).next(p).slideToggle(slow) .siblings(p:visible).slideUp(slow); $(this).toggleClass(active); $(this).siblings(h3).removeClass(active); }); }); /script [/code]panswer para 2/p panswer para 3/p don't display. Any ideas why? It's an Intranet environment so apologies for lack of links.
[jQuery] Re: Reversing the SlideUp and SlideDown functions to slide from the bottom and not the top
Use the effects in jQuery-UI when you need more than basic slideUp/ slideDown. Using show hide with the appropriate options will allow you to slide in any direction. You also have a lot more effects to choose from then just 'slide' To open by sliding 'up', and close in reverse... $E.show( 'slide', {direction: 'up'} ); $E.hide( 'slide', {direction: 'up'} ); To use a 'drop' effect instead of 'slide'... $E.show( 'drop', {direction: 'up'} ); $E.hide( 'drop', {direction: 'up'} ); You can find details in the jQuery docs: http://docs.jquery.com/UI/Effects /Kevin On Jan 27, 8:07 pm, ryjohnson ry.john...@gmail.com wrote: I saw this was posted before, but there was never a solution posted. I want to use the Toggle function but have it slide up from the bottom of the div instead of the top, I have tried searching through all the plugins, and even tried writing my own but have had no luck. If there's anyone who can help me I would be extremely grateful.
[jQuery] paint columns in alternating colour
i have this table structure - a database feeds rows into it with Class=Row or AltRow I want to paint the columns in alternating colours for both Row and AltRow for readability I tried: $(document).ready(function(){ $(.Grid.Rowtd:even).css(background,silver); }); and other variations - i'm having difficulty selecting the TD's in the TR of Class 'Row' which is in the table of class 'Grid' - at one point i got a checkerboard effect :) I can give the table an ID if that's better to pick things out Any help appreciated = table class=Grid cellspacing=0 cellpadding=0 caption class=RowTotal Records:nbsp;5nbsp;/caption tr class=Caption th/th th/th th/th th/th th/th thManager/th thStatus/th /tr tr class=GroupCaption th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th /tr tr class=Row td style=TEXT-ALIGN: rightnbsp; /td td style=TEXT-ALIGN: right150 /td tdExamOne Hamilton /td tdprinter /td tdnbsp; /td tdLaura Felker /td tdUn-Assigned /td /tr tr class=Row td style=TEXT-ALIGN: rightnbsp; /td td style=TEXT-ALIGN: right150 /td tdnbsp; /td tdmonitors /td tdnbsp; /td tdnbsp; /td tdUn-Assigned /td /tr tr class=Footer td colspan=7 !-- ..nav buttons appear here -- /tr /table
[jQuery] Re: paint columns in alternating colour
if you have to have the background color on the td use this $(document).ready(function(){ $(.Grid .Row:even td).each().css(background,silver); }); if you can put the background color on the tr instead and leave the td transparent it's just this $(document).ready(function(){ $(.Grid .Row:even).css(background,silver); }); I'd change .css(background,silver); to .addClass(classname); though. kevind wrote: i have this table structure - a database feeds rows into it with Class=Row or AltRow I want to paint the columns in alternating colours for both Row and AltRow for readability I tried: $(document).ready(function(){ $(.Grid.Rowtd:even).css(background,silver); }); and other variations - i'm having difficulty selecting the TD's in the TR of Class 'Row' which is in the table of class 'Grid' - at one point i got a checkerboard effect :) I can give the table an ID if that's better to pick things out Any help appreciated = table class=Grid cellspacing=0 cellpadding=0 caption class=RowTotal Records:nbsp;5nbsp;/caption tr class=Caption th/th th/th th/th th/th th/th thManager/th thStatus/th /tr tr class=GroupCaption th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th /tr tr class=Row td style=TEXT-ALIGN: rightnbsp; /td td style=TEXT-ALIGN: right150 /td tdExamOne Hamilton /td tdprinter /td tdnbsp; /td tdLaura Felker /td tdUn-Assigned /td /tr tr class=Row td style=TEXT-ALIGN: rightnbsp; /td td style=TEXT-ALIGN: right150 /td tdnbsp; /td tdmonitors /td tdnbsp; /td tdnbsp; /td tdUn-Assigned /td /tr tr class=Footer td colspan=7 !-- ..nav buttons appear here -- /tr /table
[jQuery] Re: Can JQuery solve the iframe height=100% problem?
HI Dave, You can find all the info in the Layout documentation and examples, but here is a quick answer... The widget needs to 'find' the iframe. The default method is to give the element a ui-layout class, like this... iframe id=fileTreeIframe class=ui-layout-center ... OR, since the iframe has an ID, you can tell the widget to use that... script type=text/javascript $(document).ready(function() { $(body).layout({ closable: false , resizable: false , spacing_open: 0 , center_paneSelector: #fileTreeIframe }); }); /script /Kevin On Jan 27, 8:35 am, laredotorn...@zipmail.com laredotorn...@zipmail.com wrote: Hi Kevin, How do I apply this expansion to the iframe specifically? I included this on my page ... script type=text/javascript src=../scriptsjquery.layout.min.js/ script script type=text/javascript $(document).ready(function() { $(body).layout({ closable: false , resizable: false , spacing_open: 0 }); }); /script iframe id=fileTreeIframe style=border:0px none #ff; src=file_tree.php border=0 width=100% scroll=auto/iframe but still no love! ...http://screencast.com/t/aJxegNZmv - Dave On Jan 26, 12:27 pm, Kevin Dalman kevin.dal...@gmail.com wrote: Hi Dave, This plugin may be more than you need, but... The UI/Layout widget will automatically position and size an iframe (or other element) to fill the entire page, OR allow for a header, footer, or sidebars. The code and markup are dead-simple. Here is an example with a page-banner and an iframe. Everything is done for you, including eliminating the 'body scrollbar'... $(document).ready(function(){ $(body).layout({ closable: false , resizable: false , spacing_open: 0 }); }); DIV class=ui-layout-north [Banner here] /DIV IFRAME class=ui-layout-center src=myIframe.html ... That's it! I recommend setting an iframe width height for non- Javascript browsers, but it's not necessary for Layout. Plus you must set your preferred iframe options, like scrolling, border, padding, etc. Plug-in website:http://layout.jquery-dev.net Simple iframe demo:http://layout.jquery-dev.net/demos/frames.html The Layout website itself used iframe pages with a 'banner', like: http://layout.jquery-dev.net/discuss.html Hope this helps. /Kevin On Jan 26, 6:55 am, laredotorn...@zipmail.com laredotorn...@zipmail.com wrote: My iframe is also hard-coded. But here is what I get when I do console.log statements ... $('#fileTreeIframe').load( function() { var $ifbody = $(this).contents().find ( 'body' ); console.log($ifbody); // Outputs Object length=1 0=body prevObject=Object jquery=1.2.6 $ifbody.css( 'height','auto' ); console.log($ifbody.height()); // Outputs 0 $(this).height( $ifbody.height() ); }); Obviously the troubling thing here is that height is outputting zero. Can you provide the HTML that surrounds your hard-coded iframe? There must be something else I'm not setting in the CSS or HTML. Thanks, - Dave On Jan 25, 1:53 pm, dbzz j...@briskey.net wrote: i have the iframe hardcoded in the html. if you are adding it to the dom with js, it won't get the load event binding. you might try livequery or something like it. On Jan 25, 10:21 am, laredotorn...@zipmail.com laredotorn...@zipmail.com wrote: Hi dbzz, I tried the code you provided, but went from this ... http://screencast.com/t/W8lOtgKO to the iframe disappearing entirely ... http://screencast.com/t/jCTjOLhpeX I put your code in a $(document).ready() block (below). Are there any other modifications I should make to get it to display at 100%? $(document).ready(function() { $('#fileTreeIframe').load( function() { var $ifbody = $(this).contents().find ( 'body' ); $ifbody.css( 'height','auto' ); $(this).height( $ifbody.height() ); }); }); Thanks, - Dave- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: paint columns in alternating colour
i added it thus: $(document).ready(function(){ $(.Grid .Row:even td).each().addClass(colouredtd); }); style on page= .colouredtd {background:silver;} Did you mean to leave a space between .Grid and .Row ? I'm new to the JQuery syntax - does anyone have a page that breaks down how to select different elements and their child (if that's the right term) elements - the Selectors section of the JQuery documentation online tends to deal with divs first. kd On Jan 28, 12:05 pm, Liam Potter radioactiv...@gmail.com wrote: if you have to have the background color on the td use this $(document).ready(function(){ $(.Grid .Row:even td).each().css(background,silver); }); if you can put the background color on the tr instead and leave the td transparent it's just this $(document).ready(function(){ $(.Grid .Row:even).css(background,silver); }); I'd change .css(background,silver); to .addClass(classname); though. kevind wrote: i have this table structure - a database feeds rows into it with Class=Row or AltRow I want to paint the columns in alternating colours for both Row and AltRow for readability I tried: $(document).ready(function(){ $(.Grid.Rowtd:even).css(background,silver); }); and other variations - i'm having difficulty selecting the TD's in the TR of Class 'Row' which is in the table of class 'Grid' - at one point i got a checkerboard effect :) I can give the table an ID if that's better to pick things out Any help appreciated = table class=Grid cellspacing=0 cellpadding=0 caption class=RowTotal Records:nbsp;5nbsp;/caption tr class=Caption th/th th/th th/th th/th th/th thManager/th thStatus/th /tr tr class=GroupCaption th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th /tr tr class=Row td style=TEXT-ALIGN: rightnbsp; /td td style=TEXT-ALIGN: right150 /td tdExamOne Hamilton /td tdprinter /td tdnbsp; /td tdLaura Felker /td tdUn-Assigned /td /tr tr class=Row td style=TEXT-ALIGN: rightnbsp; /td td style=TEXT-ALIGN: right150 /td tdnbsp; /td tdmonitors /td tdnbsp; /td tdnbsp; /td tdUn-Assigned /td /tr tr class=Footer td colspan=7 !-- ..nav buttons appear here -- /tr /table
[jQuery] Re: paint columns in alternating colour
forgot to say, it didn't work :(
[jQuery] Re: Can jQuery calculate CSS Width/Height
Thanks Matt, but that does not work. As my example shows, the element may have a percentage width, or it could be 'auto' (which it would be if not specifically set). What I need is the 'pixel' measurement that would replicate its current size. In other words, if it currently is width:90%; and I replace it with width:985px;, the width *would not change* (assuming 985 is the pixel equivalent). On Jan 26, 3:03 pm, Matt matt.critch...@gmail.com wrote: $('#Test').css('width') ? On Jan 26, 11:46 am, Kevin Dalman kevin.dal...@gmail.com wrote: jQuery has innerHeight/Width and outerHeight/Width methods, but is there a method that can return a 'CSS Height/Width'. A CSS width is the width that would be applied via CSS to achieve a given 'outer width'. This value will differ depending on the box model and other older browser idiosyncracies. Here is an example... DIV#Test { width: 90%; height: auto; padding: 7px; margin: 11px; border: 3px solid #000; } DIV id=Test line1 BR line 2 BR line 3 /DIV Now I want to increase the DIV width height by 1-pixel. To do so, I need the current 'pixel width/height' that is equivent to its current size. AFAIK, $(#Test).innerWidth() will not address this. Is there another dimension method that can? I already have a custom function to calculate this, but I'm wondering if I am missing something in jQuery that would simplify my code? If not, I may suggest such a method for jQuery, but want to be sure it doesn't already exist! Does anyone have knowledge of this? /Kevin- Hide quoted text - - Show quoted text -
[jQuery] Re: Event delegation and hover(over, out)
Could you check out this example I created and let me know if that was your intended effect? I'm still not entirely certain I'm grasping everything you're trying to do. Basically, you have an initial list. You want the image in each one to fade in/out when the link is hovered. You then want to be able to add a list item to the list and have the hover effect still work. Using the most recent JQuery, you could use the new .live() event handler like in my example, or you could change it back to a bind and use the hover event instead of mouseover and mouseout. http://shaneriley.info/deletefade
[jQuery] [validate] rules section problem
Hello, I use validation code someting below. It works if I load that page directly. But loading it from another page using $(#myApplDiv).load ('that_page.php') the rules sections does not work. But submitHandler section works well. script $().ready(function() { // some codes here var validator = $(#myForm).bind(invalid-form.validate, function () { $(#summary).html(Error); }).validate({ submitHandler: function() { // some codes here }, rules: { fieldName { required: { depends: #anotherFieldName:checked } } } }); }); /script Any suggestions? Thanks Mesut TUNGA
[jQuery] feedback for alert replacement plugin
I wrote a quick plugin to replace alert (I didn't like that I couldn't copy and paste from the alert window, and that it was modal). I decided to use window.open instead of absolute divs to show it. I've also used toJSON plugin for when an object is passed in. Faced a couple of problems with getting outerWidth of the browser in IE, and using scrollWidth/scrollHeight to determine window size, which I'm unsure I solved right. feedback? body script src=jquery.js/script script src=json.js/script script (function($){ $.alert = function(obj,options) { var defaults = { maxWidth: 800, maxHeight: 1000 }; var options = $.extend(defaults, options); w = window.open('','','width=100,height=100,resizable=1'); if(typeof obj == object){ obj = \n$.toJSON(+obj+):\n + $.toJSON(obj); } w.document.write(body topmargin=0 leftmargin=0 style='padding: 0px;height:100%'textarea id='ta1' wrap='off' style='background- color:#c0c0c0;color:black;font:8pt lucida console;width:100%;height: 100%'+obj+/textarea/body); var innerWidth = w.innerWidth || w.document.documentElement.clientWidth || w.document.body.clientWidth; var innerHeight = w.innerHeight || w.document.documentElement.clientHeight || w.document.body.clientHeight; var outerWidth = w.outerWidth+12 || innerWidth+32; var outerHeight = w.outerHeight+12 || innerHeight+51; var ta = $('#ta1',w.document) var scrollX = ta[0].scrollWidth+(outerWidth-innerWidth); var scrollY = ta[0].scrollHeight+(outerHeight-innerHeight); w.resizeTo((scrollXoptions.maxWidth)?options.maxWidth:scrollX, (scrollYoptions.maxHeight)?options.maxHeight:scrollY); return this; //if returning something else use return this.pushStack (somethingElse) so that .end() returns this }; })(jQuery); $.alert(jQuery.data); var obj = {one:1,two:2,three:3,four:function(){test=1}}; $.alert(obj); /script /body
[jQuery] Re: How to block the javascript engine when jQuery.ui.dialog is pop up?
The only way would be to not have any javascript statements after the open statement. If, however, you mean you don't want users triggering other events or interacting with the page after a dialog has been opened then you can do this by simply setting the dialog modal:true. On Jan 28, 3:16 am, mctpursuer mctpurs...@yahoo.com wrote: Hi, I am trying to replace javascript built-in alert prompt with jQuery.ui.dialog, the problem is dialog won't block the javascript engine from excuting statements following the dialog(open). Is there an elegant solution for this? Thanks.
[jQuery] Re: paint columns in alternating colour
no wonder it didn't work, .Row is only on captions, try this $(document).ready(function(){ $(table.Grid tr:even td).each().addClass(colouredtd); }); I did mean to leave spaces yes, you write the selector just like you would with CSS. kevind wrote: i added it thus: $(document).ready(function(){ $(.Grid .Row:even td).each().addClass(colouredtd); }); style on page= .colouredtd {background:silver;} Did you mean to leave a space between .Grid and .Row ? I'm new to the JQuery syntax - does anyone have a page that breaks down how to select different elements and their child (if that's the right term) elements - the Selectors section of the JQuery documentation online tends to deal with divs first. kd On Jan 28, 12:05 pm, Liam Potter radioactiv...@gmail.com wrote: if you have to have the background color on the td use this $(document).ready(function(){ $(.Grid .Row:even td).each().css(background,silver); }); if you can put the background color on the tr instead and leave the td transparent it's just this $(document).ready(function(){ $(.Grid .Row:even).css(background,silver); }); I'd change .css(background,silver); to .addClass(classname); though. kevind wrote: i have this table structure - a database feeds rows into it with Class=Row or AltRow I want to paint the columns in alternating colours for both Row and AltRow for readability I tried: $(document).ready(function(){ $(.Grid.Rowtd:even).css(background,silver); }); and other variations - i'm having difficulty selecting the TD's in the TR of Class 'Row' which is in the table of class 'Grid' - at one point i got a checkerboard effect :) I can give the table an ID if that's better to pick things out Any help appreciated = table class=Grid cellspacing=0 cellpadding=0 caption class=RowTotal Records:nbsp;5nbsp;/caption tr class=Caption th/th th/th th/th th/th th/th thManager/th thStatus/th /tr tr class=GroupCaption th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th th style=TEXT-ALIGN: rightnbsp; /th /tr tr class=Row td style=TEXT-ALIGN: rightnbsp; /td td style=TEXT-ALIGN: right150 /td tdExamOne Hamilton /td tdprinter /td tdnbsp; /td tdLaura Felker /td tdUn-Assigned /td /tr tr class=Row td style=TEXT-ALIGN: rightnbsp; /td td style=TEXT-ALIGN: right150 /td tdnbsp; /td tdmonitors /td tdnbsp; /td tdnbsp; /td tdUn-Assigned /td /tr tr class=Footer td colspan=7 !-- ..nav buttons appear here -- /tr /table
[jQuery] Is .parent() only one level up?
Hello, pretty noob question here. I have this example: div form div labelExample/label input type=text/ /div /form /div Now let's say there's this jQuery: $(input).click(function(){ $(this).parent(form).css(color,#F00); }); My question: Does the parent() method work like that, or do I need to do something like $(this).prev().prev() to get to the form? I guess I'm trying to better understand how flexible the parent() and children () methods are. Thanks in advance.
[jQuery] Re: Is .parent() only one level up?
I think the method you are looking for is closest On Jan 28, 12:39 pm, kgosser kgos...@gmail.com wrote: Hello, pretty noob question here. I have this example: div form div labelExample/label input type=text/ /div /form /div Now let's say there's this jQuery: $(input).click(function(){ $(this).parent(form).css(color,#F00); }); My question: Does the parent() method work like that, or do I need to do something like $(this).prev().prev() to get to the form? I guess I'm trying to better understand how flexible the parent() and children () methods are. Thanks in advance.
[jQuery] Re: Is .parent() only one level up?
http://docs.jquery.com/Traversing/closest On Jan 28, 12:39 pm, kgosser kgos...@gmail.com wrote: Hello, pretty noob question here. I have this example: div form div labelExample/label input type=text/ /div /form /div Now let's say there's this jQuery: $(input).click(function(){ $(this).parent(form).css(color,#F00); }); My question: Does the parent() method work like that, or do I need to do something like $(this).prev().prev() to get to the form? I guess I'm trying to better understand how flexible the parent() and children () methods are. Thanks in advance.
[jQuery] Re: $('#list').unbind().html('') -- redundant?
html('') calls empty() so starting with 1.2.2 it will also remove all event handlers and internally cached data. On Jan 28, 11:48 am, René renefourn...@gmail.com wrote: I have a dynamically generated a long list of items with events bound to them. I was wondering, when I clear the list, or replace it, is it necessary to unbind all their events before clearing its parent container? I know I can experiment to answer this question, but I wanted to know if perhaps html('') on the parent container runs unbind() anyways? ...Rene
[jQuery] Re: How to wait for load() to finish executing
This could be accomplished using a synchronous xmlhttp call (does jQuery even support this?), or you could put a while loop before the return true to poll a variable that is set in the callback. You would probably want to set the variable if there is an error as well so that the browser doesn't freeze too long. On Jan 28, 10:33 am, Adam apcau...@gmail.com wrote: How can I wait for the load() function to finish before executing the next line of code? The code that I need to execute after load() is finished cannot be called within the callback function. I basically need to return true after the load has finished but not beforehand. Here's the relevant code: jQuery(this).cluetip({ cluetipClass: 'jtip', arrows: true, dropShadow: false, hoverIntent: false, sticky: true, mouseOutClose: false, closePosition: 'title', closeText: 'close', activation: 'click', local: true, hideLocal: true, onActivate: function() { var url = jQuery(this).attr(href); jQuery(this).load(url); //dont' return true until load() is finished return true; } });
[jQuery] Re: Is .parent() only one level up?
No, not necessarily, but thanks for the link. I'll take a deeper look at that. What my question centers around is when I put parent(example); ... how far up the tree does jQuery look for the example -- just one level, or higher? The key is I'm trying to understand how to stop having to write traversing like this: $(this).parent.().parent().prev().prev().prev().children(p.example); If you see what I'm getting at? On Jan 28, 11:42 am, jay jay.ab...@gmail.com wrote: http://docs.jquery.com/Traversing/closest On Jan 28, 12:39 pm, kgosser kgos...@gmail.com wrote: Hello, pretty noob question here. I have this example: div form div labelExample/label input type=text/ /div /form /div Now let's say there's this jQuery: $(input).click(function(){ $(this).parent(form).css(color,#F00); }); My question: Does the parent() method work like that, or do I need to do something like $(this).prev().prev() to get to the form? I guess I'm trying to better understand how flexible the parent() and children () methods are. Thanks in advance.
[jQuery] Cycle plugin: Replay button won't replay
I have a slideshow: script type=text/javascript $(function(){ $('#slideshowBoxRetouching').cycle({ fx: 'fade', speed: 300, timeout: 2400, pause: 0, autostop: 17, end: function() { $('#replayRetouching,#ellipsis').fadeIn(); $('#page').fadeOut(); } }); }); /script I have a replay button appear at the end, and a click function assigned to it: $('#replayRetouching').click(function() { $('#slideshowBoxRetouching').cycle('play'); }); But all this does is return to the first slide and stay there. How do I get the slideshow to start over? I feel like autostop is causing my problems, but I'm trying to avoid a continuous loop... Thanks!
[jQuery] Re: Is .parent() only one level up?
parent is just one level. closest() looks up the tree like .parent ().parent()... until a match is found.. I'm not sure if there is an equivalent that would do what you want.. you could try .closest (.parentClass).find(.childClass) On Jan 28, 12:53 pm, kgosser kgos...@gmail.com wrote: No, not necessarily, but thanks for the link. I'll take a deeper look at that. What my question centers around is when I put parent(example); ... how far up the tree does jQuery look for the example -- just one level, or higher? The key is I'm trying to understand how to stop having to write traversing like this: $(this).parent.().parent().prev().prev().prev().children(p.example); If you see what I'm getting at? On Jan 28, 11:42 am, jay jay.ab...@gmail.com wrote: http://docs.jquery.com/Traversing/closest On Jan 28, 12:39 pm, kgosser kgos...@gmail.com wrote: Hello, pretty noob question here. I have this example: div form div labelExample/label input type=text/ /div /form /div Now let's say there's this jQuery: $(input).click(function(){ $(this).parent(form).css(color,#F00); }); My question: Does the parent() method work like that, or do I need to do something like $(this).prev().prev() to get to the form? I guess I'm trying to better understand how flexible the parent() and children () methods are. Thanks in advance.- Hide quoted text - - Show quoted text -
[jQuery] Re: $('#list').unbind().html('') -- redundant?
Thanks saves me some code, and perhaps a few cycles. On Jan 28, 10:46 am, jay jay.ab...@gmail.com wrote: html('') calls empty() so starting with 1.2.2 it will also remove all event handlers and internally cached data. On Jan 28, 11:48 am, René renefourn...@gmail.com wrote: I have a dynamically generated a long list of items with events bound to them. I was wondering, when I clear the list, or replace it, is it necessary to unbind all their events before clearing its parent container? I know I can experiment to answer this question, but I wanted to know if perhaps html('') on the parent container runs unbind() anyways? ...Rene
[jQuery] Array values disappear when ready event fires
I have some old jsp pages with bad coding, where I created javascript arrays in the jsp code, so in the end I've got an html page with lots of script tags where I add values to a Javascript array. I know it's a really ugly way of doing things, but that's the only way I thought of at the time. Now (since I switched to 1.3) I've seen that none of those pages are working due to a strange behavior. When I trigger a function that uses any of those arrays, nothing happens, so I've been debuging and I've seen that all the arrays are empty. If I put a breakpoint where the elements are inserted (during page construction) everything works fine, but whenever the $().ready() method is called, all the elements on those arrays disappear. I don't know if that's a bug or just some behavior I don't know about, but everything worked fine before I switched to JQuery 1.3. I'd like to avoid redoing the code because that's a lot of work, so maybe someone can point me what's going on. Thanks a lot.
[jQuery] Re: [validate] rules section problem
Can't spot any issues in that snippets. Could you post a testpage? Jörn On Wed, Jan 28, 2009 at 6:22 PM, TUNGA mesut.tu...@gmail.com wrote: Hello, I use validation code someting below. It works if I load that page directly. But loading it from another page using $(#myApplDiv).load ('that_page.php') the rules sections does not work. But submitHandler section works well. script $().ready(function() { // some codes here var validator = $(#myForm).bind(invalid-form.validate, function () { $(#summary).html(Error); }).validate({ submitHandler: function() { // some codes here }, rules: { fieldName { required: { depends: #anotherFieldName:checked } } } }); }); /script Any suggestions? Thanks Mesut TUNGA
[jQuery] Re: Can jQuery calculate CSS Width/Height
with 1.3.1 I'm able to get pixel measurement from percent with no problem. example: body script src=jquery.js/script div id=d1 style=width:100%;border:1px solid black div id=d2 style=width:90%;border:1px solid black div id=d3 style=width:90%;border:1px solid black div id=d4 style=width:90%;border:1px solid black test /div /div /div /div script alert($(#d1).width()); alert($(#d2).width()); alert($(#d3).width()); alert($(#d4).width()); /script /body On Jan 28, 12:17 pm, Kevin Dalman kevin.dal...@gmail.com wrote: Thanks Matt, but that does not work. As my example shows, the element may have a percentage width, or it could be 'auto' (which it would be if not specifically set). What I need is the 'pixel' measurement that would replicate its current size. In other words, if it currently is width:90%; and I replace it with width:985px;, the width *would not change* (assuming 985 is the pixel equivalent). On Jan 26, 3:03 pm, Matt matt.critch...@gmail.com wrote: $('#Test').css('width') ? On Jan 26, 11:46 am, Kevin Dalman kevin.dal...@gmail.com wrote: jQuery has innerHeight/Width and outerHeight/Width methods, but is there a method that can return a 'CSS Height/Width'. A CSS width is the width that would be applied via CSS to achieve a given 'outer width'. This value will differ depending on the box model and other older browser idiosyncracies. Here is an example... DIV#Test { width: 90%; height: auto; padding: 7px; margin: 11px; border: 3px solid #000; } DIV id=Test line1 BR line 2 BR line 3 /DIV Now I want to increase the DIV width height by 1-pixel. To do so, I need the current 'pixel width/height' that is equivent to its current size. AFAIK, $(#Test).innerWidth() will not address this. Is there another dimension method that can? I already have a custom function to calculate this, but I'm wondering if I am missing something in jQuery that would simplify my code? If not, I may suggest such a method for jQuery, but want to be sure it doesn't already exist! Does anyone have knowledge of this? /Kevin- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Array Plugin
Does anyone know of a plugin that duplicates Prototypes array methods. The closest I've found is the Rich Array Plugin. http://plugins.jquery.com/project/rich-array Any others?
[jQuery] Re: Alternate row colors using Ajax
You need to put that code right after append(), like .appendTo('#update-target table') .find('tr:odd').addClass('alt'); }); //close each( On Jan 28, 12:47 pm, septemberbrain kindlerda...@gmail.com wrote: Thanks. I tried that but it did not work. Tried placing it within the function, outside the function, etc. I think the issue has something to do with the dynamic creation of the table. I've done this in the past with Spry which has operators that enable you to do this. I haven't been able to find similar features in jQuery. On Jan 27, 7:13 pm, donb falconwatc...@comcast.net wrote: $(tr:odd,table.stripeme).addClass('altcolor'); is a way to stripe the rows. It is assumed there is a class 'altcolor' with a suitable background-color definition. On Jan 27, 4:43 pm, septemberbrain kindlerda...@gmail.com wrote: I have some code that reads an xml file and outputs to a table. I would like the rows to have alternate colors but cannot get it to work properly. Below is my code. Hope someone can help. Thanks! script src=../jQuery/jquery-1.3.1.min.js type=text/javascript/ script style type=text/css tr.alt td {background:#e1e7e8;} tr.over td {background::#99a4a4;} /style script type=application/javascript $(document).ready(function(){ $.ajax({ type: GET, url: FTF_OLL.xml, dataType: xml, success: function(xml) { $(xml).find('Document').each(function(){ var title_text = $(this).find('Title').text() var type_text = $(this).find('Type').text() var format_text = $(this).find('Format').text () var location_text = $(this).find ('Location').text() var track_text = $(this).find('Track').text() var company_text = $(this).find ('Company').text() $('tr/tr') .html('td' + title_text + '/tdtd' + type_text + '/tdtd' + format_text + '/tdtd' + location_text + '/tdtd' + track_text + '/tdtd' + company_text + '/td' ) .appendTo('#update-target table'); }); //close each( } }); //close $.ajax( }); //close $( /script /head body p div id='update-target' table class=stripeMetrtdTitle/tdtdType/ tdtdFormat/tdtdLocation/tdtdTrack/tdtdCompany/td/ tr/table /div /p
[jQuery] Re: Can JQuery solve the iframe height=100% problem?
Hi Kevin, I really appreciate your help with all this. Unfortunately, I added what you had suggested ... script type=text/javascript $(document).ready(function() { $(body).layout({ closable: false , resizable: false , spacing_open: 0 , center_paneSelector: #fileTreeIframe }); }); /script iframe id=fileTreeIframe class=ui-layout-center style=border:0px none #ff; src=file_tree.php border=0 width=100% scroll=auto/iframe and even included the normal script instaed of the .min.js file ... script type=text/javascript src=../scripts/jquery.layout.js/ script but sadly still now luck (screen shot is as before). There are no JS errors on the page. Do I have to give every element on my page a class name like you mention above, or should it be enough to only name the iframe? Thanks, - Dave On Jan 28, 10:11 am, Kevin Dalman kevin.dal...@gmail.com wrote: HI Dave, You can find all the info in the Layout documentation and examples, but here is a quick answer... The widget needs to 'find' the iframe. The default method is to give the element a ui-layout class, like this... iframe id=fileTreeIframe class=ui-layout-center ... OR, since the iframe has an ID, you can tell the widget to use that... script type=text/javascript $(document).ready(function() { $(body).layout({ closable: false , resizable: false , spacing_open: 0 , center_paneSelector: #fileTreeIframe });}); /script /Kevin On Jan 27, 8:35 am, laredotorn...@zipmail.com laredotorn...@zipmail.com wrote: Hi Kevin, How do I apply this expansion to the iframe specifically? I included this on my page ... script type=text/javascript src=../scriptsjquery.layout.min.js/ script script type=text/javascript $(document).ready(function() { $(body).layout({ closable: false , resizable: false , spacing_open: 0 }); }); /script iframe id=fileTreeIframe style=border:0px none #ff; src=file_tree.php border=0 width=100% scroll=auto/iframe but still no love! ...http://screencast.com/t/aJxegNZmv - Dave On Jan 26, 12:27 pm, Kevin Dalman kevin.dal...@gmail.com wrote: Hi Dave, This plugin may be more than you need, but... The UI/Layout widget will automatically position and size an iframe (or other element) to fill the entire page, OR allow for a header, footer, or sidebars. The code and markup are dead-simple. Here is an example with a page-banner and an iframe. Everything is done for you, including eliminating the 'body scrollbar'... $(document).ready(function(){ $(body).layout({ closable: false , resizable: false , spacing_open: 0 }); }); DIV class=ui-layout-north [Banner here] /DIV IFRAME class=ui-layout-center src=myIframe.html ... That's it! I recommend setting an iframe width height for non- Javascript browsers, but it's not necessary for Layout. Plus you must set your preferred iframe options, like scrolling, border, padding, etc. Plug-in website:http://layout.jquery-dev.net Simple iframe demo:http://layout.jquery-dev.net/demos/frames.html The Layout website itself used iframe pages with a 'banner', like: http://layout.jquery-dev.net/discuss.html Hope this helps. /Kevin On Jan 26, 6:55 am, laredotorn...@zipmail.com laredotorn...@zipmail.com wrote: My iframe is also hard-coded. But here is what I get when I do console.log statements ... $('#fileTreeIframe').load( function() { var $ifbody = $(this).contents().find ( 'body' ); console.log($ifbody); // Outputs Object length=1 0=body prevObject=Object jquery=1.2.6 $ifbody.css( 'height','auto' ); console.log($ifbody.height()); // Outputs 0 $(this).height( $ifbody.height() ); }); Obviously the troubling thing here is that height is outputting zero. Can you provide the HTML that surrounds your hard-coded iframe? There must be something else I'm not setting in the CSS or HTML. Thanks, - Dave On Jan 25, 1:53 pm, dbzz j...@briskey.net wrote: i have the iframe hardcoded in the html. if you are adding it to the dom with js, it won't get the load event binding. you might try livequery or something like it. On Jan 25, 10:21 am, laredotorn...@zipmail.com laredotorn...@zipmail.com wrote: Hi dbzz, I tried the code you provided, but went from this ... http://screencast.com/t/W8lOtgKO to the iframe disappearing entirely ...
[jQuery] Re: function after each -loop
In your sample you're missing a closing bracket for the function, and LoopComplete would only be declared but not run. I think you meant $(document).ready(function() { $('input[name=category]').each(function() { //... }); alert(All done with loop!); }); johannes: everything in Javascript is synchronous, except for Ajax calls (or timeouts/intervals - they are synchronous too but will execute in a different order). So the alert here will only fire after each() has done it's job. Also note that the '@' for attribute selectors has been deprecated in jQuery 1.2.6, and removed in 1.3 (will error). - ricardo On Jan 28, 2:47 pm, Rick Faircloth r...@whitestonemedia.com wrote: MZ... what role does the first LoopComplete(); play in the code in your response at the bottom of the page. How would the code behave differently if it was just $(document).ready(function() { $(inp...@name='category']).each(function() { }); function LoopComplete() { alert(All done with loop!); }); Thanks for any guidance and info... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Wednesday, January 28, 2009 10:32 AM To: jQuery (English) Subject: [jQuery] Re: function after each -loop Just put the call after the each loop $(document).ready(function() { $(inp...@name='category']).each(function(){ }); LoopComplete(); }); function LoopComplete() { alert(All done with loop!); } On Jan 28, 10:13 am, johannesF johannes.foss...@gmail.com wrote: Hi Need som smart advice here, I have a eachloop like this. $(inp...@name='category']).each(function(){ }); And then I want to run a function after the each i done Is that possible? all the best / johannes
[jQuery] Re: How to wait for load() to finish executing
You can use async: false, check the docs: http://docs.jquery.com/Ajax/jQuery.ajax That's the closest thing to a 'pause' in JS, but that is not good as it will freeze the whole browser while waiting for the server response. The best solution would be to use the load callback, but then you can't change the return value. $(this).load(url, function(){ //do whatever returning true would do }); On Jan 28, 3:52 pm, jay jay.ab...@gmail.com wrote: This could be accomplished using a synchronous xmlhttp call (does jQuery even support this?), or you could put a while loop before the return true to poll a variable that is set in the callback. You would probably want to set the variable if there is an error as well so that the browser doesn't freeze too long. On Jan 28, 10:33 am, Adam apcau...@gmail.com wrote: How can I wait for the load() function to finish before executing the next line of code? The code that I need to execute after load() is finished cannot be called within the callback function. I basically need to return true after the load has finished but not beforehand. Here's the relevant code: jQuery(this).cluetip({ cluetipClass: 'jtip', arrows: true, dropShadow: false, hoverIntent: false, sticky: true, mouseOutClose: false, closePosition: 'title', closeText: 'close', activation: 'click', local: true, hideLocal: true, onActivate: function() { var url = jQuery(this).attr(href); jQuery(this).load(url); //dont' return true until load() is finished return true; } });
[jQuery] Re: Is .parent() only one level up?
Be careful about closest(), as if it doesn't find any matches it will return the element itself. The alternative is $(this).parents(form:first) Essentially, parent() returns the parent (the one and only) and then filters it to the selector you gave. parents() does the same but with all parents, in order, up to body. $(this).parent().parent().prev().prev().prev().children(p.example) could be turned into $(this).parents('.myTarget').prevAll('.myOtherTarget').children (p.example); but neither is good, you shouldn't have the need for this kind of long traversal. - ricardo On Jan 28, 4:01 pm, jay jay.ab...@gmail.com wrote: parent is just one level. closest() looks up the tree like .parent ().parent()... until a match is found.. I'm not sure if there is an equivalent that would do what you want.. you could try .closest (.parentClass).find(.childClass) On Jan 28, 12:53 pm, kgosser kgos...@gmail.com wrote: No, not necessarily, but thanks for the link. I'll take a deeper look at that. What my question centers around is when I put parent(example); ... how far up the tree does jQuery look for the example -- just one level, or higher? The key is I'm trying to understand how to stop having to write traversing like this: $(this).parent.().parent().prev().prev().prev().children(p.example); If you see what I'm getting at? On Jan 28, 11:42 am, jay jay.ab...@gmail.com wrote: http://docs.jquery.com/Traversing/closest On Jan 28, 12:39 pm, kgosser kgos...@gmail.com wrote: Hello, pretty noob question here. I have this example: div form div labelExample/label input type=text/ /div /form /div Now let's say there's this jQuery: $(input).click(function(){ $(this).parent(form).css(color,#F00); }); My question: Does the parent() method work like that, or do I need to do something like $(this).prev().prev() to get to the form? I guess I'm trying to better understand how flexible the parent() and children () methods are. Thanks in advance.- Hide quoted text - - Show quoted text -
[jQuery] Re: Array values disappear when ready event fires
Could you post a sample page showing your code? Nothing in jQuery should touch any other objects. On Jan 28, 4:40 pm, Emili Calonge emilicalo...@gmail.com wrote: I have some old jsp pages with bad coding, where I created javascript arrays in the jsp code, so in the end I've got an html page with lots of script tags where I add values to a Javascript array. I know it's a really ugly way of doing things, but that's the only way I thought of at the time. Now (since I switched to 1.3) I've seen that none of those pages are working due to a strange behavior. When I trigger a function that uses any of those arrays, nothing happens, so I've been debuging and I've seen that all the arrays are empty. If I put a breakpoint where the elements are inserted (during page construction) everything works fine, but whenever the $().ready() method is called, all the elements on those arrays disappear. I don't know if that's a bug or just some behavior I don't know about, but everything worked fine before I switched to JQuery 1.3. I'd like to avoid redoing the code because that's a lot of work, so maybe someone can point me what's going on. Thanks a lot.
[jQuery] Re: Unsetting variables
Yes it does! On Jan 27, 8:43 pm, Hector Virgen djvir...@gmail.com wrote: You can use delete for unsetting items in objects, but I'm not sure if it works with variables in general: var myObject = { foo: 'Foo', bar: 'Bar }; delete myObject['foo']; -Hector On Tue, Jan 27, 2009 at 2:33 PM, MorningZ morni...@gmail.com wrote: x = null; On Jan 27, 5:22 pm, Chris J. Lee chri...@gmail.com wrote: There a function to delete variables for jquery? x = undefined; // would that work?
[jQuery] Re: closure inside ajax method
Thanks everybody, to Eric Garside : I have tried jQuery Automatic Script Includer and it does not download scripts for me. Are there any known issues that I should be aware of? I placed this code inside of jquery.js right at the end. (function($){ var scripts = /\?(.*)/, files = [], path = /^.*\//, loaded = 0, count = 0; $('script').each(function(){ var src = $(this).attr('src'); if (!scripts.test(src)) return; var pathto = src.match(path); files = files.concat($.map(src.match(scripts).pop().split(','), function(e,i){ return pathto+e+'.js'; })); }) count = files.length; $.each(files, function(){ $.getScript(this, function(){ loaded++; if(loaded == count $.isFunction(onBackload)) onBackload(loaded) }) }) })(jQuery); html head script type=text/javascript src=path/to/jquery.js/script /head body divTest JS preloading/div script src=path/to/xmlhttp.js?form,color/script /body /html
[jQuery] Re: AHAH- Working with return data.
Kind of: $.get('page.htm', function(closet){ $(closet).find('stuff').hide(); //or $('stuff', closet).appendTo('#trash'); }); You're not creating any temporary DIV, just passing the HTML string to jQuery which will parse it and turn it into actual elements. On Jan 27, 6:25 pm, zunama jjm@gmail.com wrote: What is the best way to work with HTML data returned on an AJAX call. Want to do something like this but I know it doesn't work. Do I need to stick the data into a temp div and then work with it? function (data) { $(data).find(.); } Thanks
[jQuery] Re: Broken selector in jQuery 1.3
Different issues: $('[value=]') also works in 1.3, but not in 1.3.1. $('[value=]') as in ticket #3933 works in 1.2.6, 1.3 and 1.3.1 in the following test: http://jquery.nodnod.net/cases/77 It's probably related to the [attribute!=anything] fix landed on 1.3.1: http://groups.google.com/group/jquery-en/browse_thread/thread/d70d3f31b892dc1e/9111f5f8e230211e $('input:not([value])') will return all elements which don't have the 'value' attribute or where it is empty. - ricardo On Jan 27, 8:12 pm, Hector Virgen djvir...@gmail.com wrote: Nevermind, I just found the bug report for this: http://dev.jquery.com/ticket/3933 -Hector On Tue, Jan 27, 2009 at 2:04 PM, Hector Virgen djvir...@gmail.com wrote: Hello, I just updated to jQuery 1.3 and I am having trouble with the following selector: var options = $('option[value=]'); Firebug says: [Exception... 'Syntax error, unrecognized expression: value=]' when calling method: [nsIDOMEventListener::handleEvent] nsresult: 0x8057001e (NS_ERROR_XPC_JS_THREW_STRING) location: unknown data: no] This selector used to work in jQuery 1.2 and I need to know how I can re-write the selector to be 1.3-compatible. The HTML snippet looks something like this: select *option value=Select One/option* option value=fooFoo/option option value=barBar/option /select I need to select the option that doesn't have a value and I'd like to avoid using class names. Any suggestions? -Hector
[jQuery] Re: Unsetting variables
Well, yes and no. The delete operator works on global variables, but only because they are actually properties of the global object. It doesn't work on local variables in a function. A couple of other notes... You can write this code two different ways; both work the same: delete myObject['foo']; delete myObject.foo; And depending on what you need, x = null; or x = undefined; may be perfectly adequate. They don't remove the variable (and you can't do that for a local variable anyway), but for many purposes they will give the same result. -Mike From: Ricardo Tomasi Yes it does! On Jan 27, 8:43 pm, Hector Virgen djvir...@gmail.com wrote: You can use delete for unsetting items in objects, but I'm not sure if it works with variables in general: var myObject = { foo: 'Foo', bar: 'Bar }; delete myObject['foo']; -Hector On Tue, Jan 27, 2009 at 2:33 PM, MorningZ morni...@gmail.com wrote: x = null; On Jan 27, 5:22 pm, Chris J. Lee chri...@gmail.com wrote: There a function to delete variables for jquery? x = undefined; // would that work?
[jQuery] Re: How to wait for load() to finish executing
async:false doesn't just freeze the entire browser, in many browsers it may freeze every browser window as well, even windows open on other sites. Adam, why can't the code you need to execute be called from the success callback function? -Mike From: Ricardo Tomasi You can use async: false, check the docs: http://docs.jquery.com/Ajax/jQuery.ajax That's the closest thing to a 'pause' in JS, but that is not good as it will freeze the whole browser while waiting for the server response. The best solution would be to use the load callback, but then you can't change the return value. $(this).load(url, function(){ //do whatever returning true would do }); On Jan 28, 3:52 pm, jay jay.ab...@gmail.com wrote: This could be accomplished using a synchronous xmlhttp call (does jQuery even support this?), or you could put a while loop before the return true to poll a variable that is set in the callback. You would probably want to set the variable if there is an error as well so that the browser doesn't freeze too long. On Jan 28, 10:33 am, Adam apcau...@gmail.com wrote: How can I wait for the load() function to finish before executing the next line of code? The code that I need to execute after load() is finished cannot be called within the callback function. I basically need to return true after the load has finished but not beforehand. Here's the relevant code: jQuery(this).cluetip({ cluetipClass: 'jtip', arrows: true, dropShadow: false, hoverIntent: false, sticky: true, mouseOutClose: false, closePosition: 'title', closeText: 'close', activation: 'click', local: true, hideLocal: true, onActivate: function() { var url = jQuery(this).attr(href); jQuery(this).load(url); //dont' return true until load() is finished return true; } });
[jQuery] OT: CF-Talk Down?
Hi, guys... Pardon the OT, but I'm trying to find out if the CF-Talk list, which several of the jQuery list users are on, is down. I haven't gotten anything since yesterday afternoon and I noticed that the last message on houseoffusion.com was from 5pm yesterday. News? Rick
[jQuery] Has anybody managed to print a sorted table using table sorter?
Hi, I've got table sorter, has anybody tried to print a table after sorting it ? Thanls
[jQuery] Re: OT: CF-Talk Down?
Neither have I... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Wednesday, January 28, 2009 2:46 PM To: jquery-en@googlegroups.com Subject: [jQuery] OT: CF-Talk Down? Hi, guys... Pardon the OT, but I'm trying to find out if the CF-Talk list, which several of the jQuery list users are on, is down. I haven't gotten anything since yesterday afternoon and I noticed that the last message on houseoffusion.com was from 5pm yesterday. News? Rick
[jQuery] Re: OT: CF-Talk Down?
Yup down for me too. -- Josh -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Wednesday, January 28, 2009 12:46 PM To: jquery-en@googlegroups.com Subject: [jQuery] OT: CF-Talk Down? Hi, guys... Pardon the OT, but I'm trying to find out if the CF-Talk list, which several of the jQuery list users are on, is down. I haven't gotten anything since yesterday afternoon and I noticed that the last message on houseoffusion.com was from 5pm yesterday. News? Rick
[jQuery] Re: OT: CF-Talk Down?
Perhaps I could ask you a question, Josh. I've been stuck on a CF/jQuery ajax issue for a day now and went to post my question to CF-Talk about the time it went down. Basically, I got everything working, but in my json response, beside the correct data, I get CF debugging code. I have cfsetting showdebugoutput = no, so that's not it. I just wonder what could be causing that to appear...any suggestions?j Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Josh Nathanson Sent: Wednesday, January 28, 2009 4:00 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: OT: CF-Talk Down? Yup down for me too. -- Josh -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Wednesday, January 28, 2009 12:46 PM To: jquery-en@googlegroups.com Subject: [jQuery] OT: CF-Talk Down? Hi, guys... Pardon the OT, but I'm trying to find out if the CF-Talk list, which several of the jQuery list users are on, is down. I haven't gotten anything since yesterday afternoon and I noticed that the last message on houseoffusion.com was from 5pm yesterday. News? Rick
[jQuery] Re: closure inside ajax method
I think the following line is the problem files = files.concat($.map(src.match(scripts).pop().split(','), function(e,i){ count = files.length; // gives me 0 or undefined
[jQuery] Re: OT: CF-Talk Down?
Rick, Here is how I handle creating json content with ColdFusion. I store the json string in a variable (like variables.myJSONdata). Then, I output the variable as follows: cfcontent reset=yes / cfheader name=expires value=#now()# cfheader name=pragma value=no-cache cfheader name=cache-control value=no-cache, no-store, must- revalidate cfoutput#myJSONdata#/cfoutputcfabort / !--- The cfabort prevents CF from adding anything else to the output, including debugging info. --- The first line clears anything CF might have rendered to the page up to this point. The second through fourth lines prevent the browser from caching the AJAX response. The last line outputs the json data then immediately aborts CF processing, effectively stopping any additional content being added onto the end. HTH, Carl On Jan 28, 2:04 pm, Rick Faircloth r...@whitestonemedia.com wrote: Perhaps I could ask you a question, Josh. I've been stuck on a CF/jQuery ajax issue for a day now and went to post my question to CF-Talk about the time it went down. Basically, I got everything working, but in my json response, beside the correct data, I get CF debugging code. I have cfsetting showdebugoutput = no, so that's not it. I just wonder what could be causing that to appear...any suggestions?j Rick
[jQuery] Jquery call works with 'alert' but no if i comment 'alert' out!
Ok so I am using amcharts and I am trying to change a setting dynamically. The following codes (when placed at the top of the document) works PERFECTLY: $(window).load(function() { alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); HOWEVER when I comment out the 'alert': $(window).load(function() { //alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); Not only does the setting change NOT take place I also get this: document.getElementById('ip_details_graph').setParam is not a function WHAT GIVES!? I need to run that code after the amchart has finished loading but I just not sure how to do that! Maybe thats what the problem is. The ID of the SWF object is 'ip_details_graph' THANKS!! -- View this message in context: http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-comment-%27alert%27-out%21-tp21715465s27240p21715465.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] injecting content
are there any samples of injecting content? i am familiar with hide/show of content inline, but don't grasp injecting content. if i have a table - can i inject a div between 2 rows? or do i need to inject a new row?
[jQuery] Re: Jquery call works with 'alert' but no if i comment 'alert' out!
Well, I agree with the browser... DOMElement.setParam() is not a function. You might have another script in your page that is overloading the prototype to define a setParam function, which would explain the alert() behaviour. Scripts are always executed in document order, so your script snippet above will run, and then alert() will cause that scripts execution to halt, which will allow the other scripts to get their pending work done. Potential solutions: 1) put your scripts in the correct order 2) fake it, by delaying the execution of your setParam, hopefully long enough so that your other scripts can do their business: $(function () { setTimeout(function () { document.getElementById('ip_details_graph').setParam ('values.value.max','100'); },500); }); I would recommend solution #1. You will need to figure out what the correct ordering is. On Jan 28, 1:28 pm, RR_QQ rquiu...@leasethis.com wrote: Ok so I am using amcharts and I am trying to change a setting dynamically. The following codes (when placed at the top of the document) works PERFECTLY: $(window).load(function() { alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); HOWEVER when I comment out the 'alert': $(window).load(function() { //alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); Not only does the setting change NOT take place I also get this: document.getElementById('ip_details_graph').setParam is not a function WHAT GIVES!? I need to run that code after the amchart has finished loading but I just not sure how to do that! Maybe thats what the problem is. The ID of the SWF object is 'ip_details_graph' THANKS!! -- View this message in context:http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Jquery call works with 'alert' but no if i comment 'alert' out!
I understand. However is there another option? How about with jquery allowing the object id containing the flash to finish loading before that code gets executed? How can I do that? That's probably easier but I am new to jquery and I just don't know how to do that! William-118 wrote: Well, I agree with the browser... DOMElement.setParam() is not a function. You might have another script in your page that is overloading the prototype to define a setParam function, which would explain the alert() behaviour. Scripts are always executed in document order, so your script snippet above will run, and then alert() will cause that scripts execution to halt, which will allow the other scripts to get their pending work done. Potential solutions: 1) put your scripts in the correct order 2) fake it, by delaying the execution of your setParam, hopefully long enough so that your other scripts can do their business: $(function () { setTimeout(function () { document.getElementById('ip_details_graph').setParam ('values.value.max','100'); },500); }); I would recommend solution #1. You will need to figure out what the correct ordering is. On Jan 28, 1:28 pm, RR_QQ rquiu...@leasethis.com wrote: Ok so I am using amcharts and I am trying to change a setting dynamically. The following codes (when placed at the top of the document) works PERFECTLY: $(window).load(function() { alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); HOWEVER when I comment out the 'alert': $(window).load(function() { //alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); Not only does the setting change NOT take place I also get this: document.getElementById('ip_details_graph').setParam is not a function WHAT GIVES!? I need to run that code after the amchart has finished loading but I just not sure how to do that! Maybe thats what the problem is. The ID of the SWF object is 'ip_details_graph' THANKS!! -- View this message in context:http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-comment-%27alert%27-out%21-tp21715465s27240p21716536.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: injecting content
In general, you can just use the jQuery manipulation APIs to inject arbitrary text and elements, like $('a').append('(bThis is a link/ b)') Tables are a bit of a special case. In my experience, it does not work consistently, so it is better if you use the browser DOM APIs to do things like row = table.insertRow(index) and cell = row.insertCell (index) On Jan 28, 1:50 pm, roxstyle resut...@gmail.com wrote: are there any samples of injecting content? i am familiar with hide/show of content inline, but don't grasp injecting content. if i have a table - can i inject a div between 2 rows? or do i need to inject a new row?
[jQuery] Re: Jquery call works with 'alert' but no if i comment 'alert' out!
I doubt mucking about in the jQuery innards to change the behaviour of when the ready or load events fire will be easier than re-arranging your scripts so that setParam is defined before you call it... On Jan 28, 2:28 pm, RR_QQ rquiu...@leasethis.com wrote: I understand. However is there another option? How about with jquery allowing the object id containing the flash to finish loading before that code gets executed? How can I do that? That's probably easier but I am new to jquery and I just don't know how to do that! William-118 wrote: Well, I agree with the browser... DOMElement.setParam() is not a function. You might have another script in your page that is overloading the prototype to define a setParam function, which would explain the alert() behaviour. Scripts are always executed in document order, so your script snippet above will run, and then alert() will cause that scripts execution to halt, which will allow the other scripts to get their pending work done. Potential solutions: 1) put your scripts in the correct order 2) fake it, by delaying the execution of your setParam, hopefully long enough so that your other scripts can do their business: $(function () { setTimeout(function () { document.getElementById('ip_details_graph').setParam ('values.value.max','100'); },500); }); I would recommend solution #1. You will need to figure out what the correct ordering is. On Jan 28, 1:28 pm, RR_QQ rquiu...@leasethis.com wrote: Ok so I am using amcharts and I am trying to change a setting dynamically. The following codes (when placed at the top of the document) works PERFECTLY: $(window).load(function() { alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); HOWEVER when I comment out the 'alert': $(window).load(function() { //alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); Not only does the setting change NOT take place I also get this: document.getElementById('ip_details_graph').setParam is not a function WHAT GIVES!? I need to run that code after the amchart has finished loading but I just not sure how to do that! Maybe thats what the problem is. The ID of the SWF object is 'ip_details_graph' THANKS!! -- View this message in context:http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Jquery call works with 'alert' but no if i comment 'alert' out!
forgive me if I'm wrong but I thought that jquery had onload or load functions that detec when an element or document is finished loading? I tried without success maybe I'm misinformed. I would never go into jquery's innards ;) William-118 wrote: I doubt mucking about in the jQuery innards to change the behaviour of when the ready or load events fire will be easier than re-arranging your scripts so that setParam is defined before you call it... On Jan 28, 2:28 pm, RR_QQ rquiu...@leasethis.com wrote: I understand. However is there another option? How about with jquery allowing the object id containing the flash to finish loading before that code gets executed? How can I do that? That's probably easier but I am new to jquery and I just don't know how to do that! William-118 wrote: Well, I agree with the browser... DOMElement.setParam() is not a function. You might have another script in your page that is overloading the prototype to define a setParam function, which would explain the alert() behaviour. Scripts are always executed in document order, so your script snippet above will run, and then alert() will cause that scripts execution to halt, which will allow the other scripts to get their pending work done. Potential solutions: 1) put your scripts in the correct order 2) fake it, by delaying the execution of your setParam, hopefully long enough so that your other scripts can do their business: $(function () { setTimeout(function () { document.getElementById('ip_details_graph').setParam ('values.value.max','100'); },500); }); I would recommend solution #1. You will need to figure out what the correct ordering is. On Jan 28, 1:28 pm, RR_QQ rquiu...@leasethis.com wrote: Ok so I am using amcharts and I am trying to change a setting dynamically. The following codes (when placed at the top of the document) works PERFECTLY: $(window).load(function() { alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); HOWEVER when I comment out the 'alert': $(window).load(function() { //alert('TEST'); document.getElementById('ip_details_graph').setParam('values.value.max', '100'); }); Not only does the setting change NOT take place I also get this: document.getElementById('ip_details_graph').setParam is not a function WHAT GIVES!? I need to run that code after the amchart has finished loading but I just not sure how to do that! Maybe thats what the problem is. The ID of the SWF object is 'ip_details_graph' THANKS!! -- View this message in context:http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Jquery-call-works-with-%27alert%27-but-no-if-i-comment-%27alert%27-out%21-tp21715465s27240p21716894.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.