[jQuery] Re: KFManager v1.0
without license GPL, MIT. I'm happy when you want to use and develop KFM 2009/8/20 Meroe whme...@gmail.com Well yea. Let's say I want to put this into a commercial app. I need to know the type of license this was released under so I can make a decision and be legit The download has no license information..GPL? MIT? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ken Phan Sent: Wednesday, August 19, 2009 3:15 PM To: jQuery (English) Subject: [jQuery] Re: KFManager v1.0 u want licensing terms ? On Aug 19, 2:54 am, Meroe whme...@gmail.com wrote: What are the licensing terms? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ken Phan Sent: Tuesday, August 18, 2009 12:21 PM To: jQuery (English) Subject: [jQuery] KFManager v1.0 KFManager (Ken's File Manager) is a plugin of jquery. It uses AJAX to manage image files in a web browser and it was developed to help programmer gently in the file manager. It is easy to use demo http://trinhvietcuong.com/ken/index.html -- -- - Administrator : Ken Phan Websmater : www.goldengate.com.vn Listen to music is free : www.enghe.info Ajax pagination: www.goldengate.com.vn/pagination jQuery navigation: www.goldengate.com.vn/navigation MP3 Ajax Flash webplayer: www.goldengate.com.vn/mp3 Blog me: http://my.opera.com/kenphan19/blog/ --
[jQuery] Animate just works once?
Hi all I am testing a msn-look-a-like message box. So, when a message to a user is needed, the message-box shows up and disapears like a msn-message. The first time it works very well! But.starting it for a next time, there is no animation, the messagebox comes up right away, while after a few seconds it does disappears the msn-way! So my question is, what am i doing wrong?? I have tried several solutions (see code below) but none of them solves my problem! Thanks in advance for any hints! !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head script src=jquery/jquery-1.3.2.min.js/script script $(document).ready(function(){ $(#go1).click(function(){ // showing up textblock (animated msn-look) $(#block1).animate( { height:200px }, { queue:true, duration: 3000 } ) // waiting time: .animate( { borderLeftWidth:1px},3000 ) // disapearing textblock (animated msn-look) .slideUp(1000); // reset something, else next time showing up isn't animated, // while disappearing the msn-way still does?? //$this.css( { height:0px } ); // does not solve the problem //$this.css( { height:0px},5000 ); // does not solve the problem //.hide(5000) // does not solve the problem //.animate( { height:0px},5000 ) // does not solve the problem // new approach: // does not solve the problem //.slideUp(3000, function () { //$this.css( {height:0px}); }); // this does not solve the problem too: //$(#block1).css( {height:0px}); }); /script stylediv { position: absolute; display:none; background-color:#bca; width:200px; height:1.1em; text-align:center; border:2px solid red; margin:3px; font-size:14px; right: 0px; bottom:0px } button { font-size:10px; } /style /head body button id=go1Show message msn-look/button div id=block1msn-look msg.../div /body /html
[jQuery] unsubscribe
[jQuery] Re: sending form’s button’s value
Hello, i don't use this method to send my datas, but in my opinion, the value of the element of type button is not get by the serialize method. If you want to send the value of the button click, you can add that after the serialize. As you have a method by button, this works ;) data: $(this).closest('#REQUESTFORM').serialize()+'respond='+$(this).attr('value'), Maybe val() works on button too, but i'm not sure Pierre 2009/8/19 efet efetun...@gmail.com User's data posted once user click either of buttons with same name=respond different values Confirm and Ignore. My problem here, button's values are not posted when I use jquery as in the following codes. Is there a way to fix this? $([name='respond']).live('click', function() { $.ajax({ type: POST, data: $(this).closest ('#REQUESTFORM').serialize(), url: content/requests/index.cs.asp? Process=RespondRequests, success: function(output) { alert(output); //$(this).closest('#REQUESTFORM').html (output); }, error: function(xhr){ alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); } }); }); div class=tools form method=post action=content/ requests/index.cs.asp?Process=RespondRequests id=REQUESTFORM input type=hidden name=REQUESTID value=%=objRequests(REQUESTID)% input type=hidden name=BYID value=%=objRequests(BYID)% input type=hidden name=TOID value=%=objRequests(TOID)% input type=button name=respond value=Confirm class=btn_confirm / input type=button name=respond value=Ignore class=btn_ignore / /form
[jQuery] jQuery refresh class of elements
Hello, I've recently started using jQuery for a project that uses selective refreshing of elements on a web page. I found an article stating that the way to do it would be to just add a line such as the following: $(#id).load(location.href+ #id *,) in an setInterval function call and the elements will be loaded accordingly. I tried it and it works, but my question is how does one do that for a clas of elements. If I were to substitute the #id with something like element.class how do I prevent each element within that class to load all the other elements besides itself within the containing element? If someone has any clue to how this is done or maybe a workaround to this issue your help would be much appreciated.
[jQuery] Unobtrusive select field replacement?
Hi everyone, I am looking around for a good way to build an unobtrusive replacement for a select field. I haven't found anything that matches my requirements (or dreams?). Starting points, suggestions, links... any help would be greatly appreciated. I really don't want a groovy custom graphic widget. I just want it to look like the select is able to display images when the list is popped up. This is not a multi-select. Just a normal popup-type select. Dreams: • Invisible until clicked (so the browser select is visible). • Displays a pretty standard list of options... only each has a thumbnail image along with the filename. My main problems are: • How to build a select that will somehow hold the extra data needed. I'd tried to just stick the extra image into the options of the select but that would make the page invalid html. • How to deal with mouse-events so the popup list behaves well. Divs and javascript reminds me of painful times with Movieclips and Actionscript. :) As you might guess I have done some tests and am part of the way there... I thought it would be better to ask for advice now before I put too much time into it and work in the wrong direction. thanks Martin
[jQuery] Menu - SlideDown SlideUp
Hi all Im pretty new to the JQuery world, and am trying to modify the following code so that it slidesDown and slidesUp on hover (mouseover/ mouseout), however the mouseout isnt working properly as it dissapears completely rather than doing the slideUp effect JQuery Code: function menu(){ $( #nav li).hover(function(){ $(this).find('ul:first').css({visibility: visible,display: none}).slideDown('fast').show(); },function(){ $(this).find('ul:first').css({visibility: visible, display: none}).slideUp('slow'); }); } $(document).ready(function(){ menu(); }); CSS Code: #nav { list-style: none; margin: 0; padding-left: 8px; overflow:visible; } #nav ul { margin: 0; padding: 0; } #nav li { margin: 0; height: 25px; padding: 0; } #nav li a { display: block; line-height: 44px; margin: 0; padding: 0 20px 0 15px; font-size: 13px; font-family:Verdana, Geneva, sans-serif; color: #00; letter-spacing: -1px; } #nav li ul a { display: block; line-height: 44px; margin: 0; padding: 0 20px 0 15px; font-size: 10px; font-family:Verdana, Geneva, sans-serif; color: #00; letter-spacing: -1px; } #nav li ul { position: absolute; width: 150px; background-color:transparent; top: 42px; left: -999em; padding-top:8px; } #nav li:hover ul, #nav li.sfhover ul { left: auto; } #nav li li { padding: 0; width: 150px; } #nav li li a { height: 25px; line-height: 25px; color: #00F; background-color:#CCC; margin: 0; } #nav li li a:hover { border-top: 1px solid #131f27; background-color: #FFF; } #nav li:hover, #nav li.sfhover { position: static; } .lavaLamp { position: relative; height: 60px; padding: 0px 0px 0px 6px; overflow: hidden; } .lavaLamp li { float: left; padding-left:10px; list-style: none; padding-right: 10px; } #nav li.back { background:url(images/Right.gif) no-repeat top right; height: 50px; width:21px; z-index: -1; position: absolute; padding-right: 0px; } #nav li.back .left { background:url(images/Left.gif) no-repeat top left; height: 50px; margin-right: 21px; z-index: -1; } .lavaLampWithImage li a { z-index: 10; } #nav ul ul{ top:auto; } #nav li ul ul { margin:-34px 0 0 151px; } #nav li:hover ul ul, #nav li:hover ul ul ul, #nav li:hover ul ul ul ul { display:none; } #nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li li li li:hover ul{ display:block; } HTML Code: ul id=nav class=lavaLamp lia href=#Home/a/li lia href=#Products/a ul lia href=#Type1/a ul lia href=#Type1.1/a/li lia href=#Type1.2/a/li /ul /li lia href=#Type2/a/li /ul /li lia href=#Contact/a/li /ul Any help will be appreciated! Thanks
[jQuery] Re: overlay does not work in jquery ajax success
I struggled with this same problem for hours! I just figured it out this morning. If you download the uncompressed .js file for the overlay tool you can see what's happening. In the 'constructor' for the overlay, there is a w.load function that binds the click action and initializes the rest of the overlay. However, on ajax success the opportunity for the window.load function to be called has passed! In order to make this work you need to strip that code out. In the minimized version its a little harder to find. Essentially what you need to do is look for the w.load(function(){ {) (in the uncompressed version). Leave all the contents of the function, but remove it from w.load. Should put this as a note to the tools developers I'd call it a bug? On Aug 11, 1:21 pm, gabel gabel.del...@googlemail.com wrote: I use jQuery Tools and got a strange problem (jQuery Tools --http://flowplayer.org/tools/index.html) HTML code class=html button type=button rel=#overlay id=overlaystaticstatic/ button button type=button rel=#overlay id=overlaydynamicdynamic/ button /code Version where only the static overlay works code class=javascript $(document).ready(function(){ $(#overlaystatic).overlay({expose: '#6096D4'}); function createoverlay () { var datastring = somedata; $.ajax({ type: POST, url: check.php, data: datastring = + datastring , success: function(msg){ alert(msg); $(#overlaydynamic).overlay({expose: '#6096D4'}); } }); } createoverlay(); }); /code If I put the overloay code for the dynamicoverlay outside of the ajax it works fine code class=javascript $(document).ready(function(){ $(#overlaystatic).overlay({expose: '#6096D4'}); function createoverlay () { var datastring = somedata; $.ajax({ type: POST, url: check.php, data: datastring = + datastring , success: function(msg){ alert(msg); } }); $(#overlaydynamic).overlay({expose: '#6096D4'}); } createoverlay(); }); /code so why the line $(#overlaydynamic).overlay({expose: '#6096D4'}); does work in the function but not inside the jquery ajax.
[jQuery] Animation Vapour Trails
I've been trying to write an extension to the animate function to allow the animation of elements along a parameterised path (in the original motivation this was around the diameter of a circle) whilst keeping use of things like $.easing and $().stop(). I've managed to put something together that seems to work, except that in the basic example I have one of the animated elements leaves a trail behind it as it moves it certain browsers. It seems to work fine in IE6 and Opera(Win) but leaves a trail in FF 3.5.2, Chrome 2.0.172.40 and Safari 4.02. I'm assuming it's a rendering engine bug, but it's something I've never come across before, so if anyone has any sage advice about how to deal with it, or has any other feedback on the plugin in general then I'd be interested to hear.
[jQuery] Re: JQuery Cycle effects don't work in IE
The validation errors was what was causing the problem. Because I'm pulling the photos from a db, I needed the id number. I added a p, and then stripped off the p using javascript replace. Pulled the empty ul out and added it via JQuery before my Cycle function. Fully valid and the fade effect works again. Thanks for looking at it anyway. I knew it didn't validate, but I didn't think that IE would be so anal about not allowing JQuery to work properly. Chris On Aug 18, 11:26 am, amuhlou amysch...@gmail.com wrote: I checked it on a version of IE7 using VMware and am not seeing the fade transition working. There are, however, some validation errors you may want to clean up. the id attribute cannot start with a number, and it appears that your images for thecyclearea all have this in common. On Aug 18, 9:48 am, theosoft ccop...@gmail.com wrote: I have tried various things to get this to work inIE, and I'm not sure why it won't work. The shuffle effect works, but not properly. It works in all the other browsers just fine. I've uploaded the code to jsbin here:http://jsbin.com/icuko I need this solved by the end of the day tomorrow, so if someone wants to take a look at it, please let me know what you think. I've not loaded everything in there, but it should be enough to give you an idea of how it's supposed to to work. Thank you.
[jQuery] ajaxSubmit encoding problems
Hi all, I have a little problem here with ajaxSubmit when submitting a form. The point is that any special characters like á or ç (they are from latin, portuguese) are going to the server replaced by strange characters, like ç ... I`m sure it is just an encoding problem, so how can I set encoding after ajaxSubmit? Thanks in advance, Fabricio Braga
[jQuery] Simple Plugin for jQuery
I am trying to get a handle on creating a jQuery plugin. I have a function that I wrote a couple of years ago that returns a formatted email address. I want to turn that function into a jQuery plugin. Here is my function: [code] function makemailto(email,subject,text) { // Makes a nice mailto link var returnval; returnval = 'a href=mailto:' + email + '?' + email + '/a'; if (subject text) { returnval = 'a href=mailto:' + email + '?subject=' + subject + '' + text + '/a'; } else if (subject) { returnval = 'a href=mailto:' + email + '?subject=' + subject + '' + email + '/a'; } else if (text) { returnval = 'a href=mailto:' + email + '?' + text + '/a'; } return(returnval); } [/code] I cannot seem to figure out how to create a simple plugin that I can call like this: $.makemailto('some...@somewhere.com','Subject Here'); Any advice? Thanks, LJ Wilson
[jQuery] Hey ive got a question about a realy basic thing im trying to implement on wordpress with Gr
Hey ive got a question about a realy basic thing im trying to implement on wordpress with Graphpaperpress's Modularity theme. Here it is: script type=text/javascript $(document).ready(function() { alert('slickBox JQuery Loaded'); // hides the slickbox as soon as the DOM is ready // (a little sooner than page load) $('.slickbox').hide(); // toggles the slickbox on clicking the noted link $('a#slick-toggle').click(function() { $('.slickbox').slideToggle(400); return false; }); // closes the slickbox on clicking the noted link $('a#slick-close').click(function() { $('.slickbox').slideUp(400); return false; }); }); /script h2 p Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. smalla href=# id=slick- toggle name=slick-toggleRead More.../a/small /p div class=slickbox !--Start the Slickbox Dropdown-- hr p It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).smalla href=# id=slick-close name=slick-closeClose.../ a/small /p /div !--End the Slickbox Dropdown--/h2 Now the question is strange because the Alert box isn't even loading up or anything is there something wrong in the jquery?
[jQuery] Hey ive got a question about a realy basic thing im trying to implement
Hey ive got a question about a realy basic thing im trying to implement on wordpress with Graphpaperpress's Modularity theme. Here it is: script type=text/javascript $(document).ready(function() { alert('slickBox JQuery Loaded'); // hides the slickbox as soon as the DOM is ready // (a little sooner than page load) $('.slickbox').hide(); // toggles the slickbox on clicking the noted link $('a#slick-toggle').click(function() { $('.slickbox').slideToggle(400); return false; }); // closes the slickbox on clicking the noted link $('a#slick-close').click(function() { $('.slickbox').slideUp(400); return false; }); }); /script h2 p Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. smalla href=# id=slick- toggle name=slick-toggleRead More.../a/small /p div class=slickbox !--Start the Slickbox Dropdown-- hr p It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).smalla href=# id=slick-close name=slick-closeClose.../ a/small /p /div !--End the Slickbox Dropdown--/h2 Now the question is strange because the Alert box isn't even loading up or anything is there something wrong in the jquery?
[jQuery] Accordion Flickers in Firefox Only
Hey guys I seem to be having an issue with the accordion flickering in Firefox but not in IE. It happens mostly with the Expand All and Collapse All features. I am thinking it must be my CSS which I have altered to create a custom box around the content. Can anyone help me figure this one out? Here is the link to the page: http://www.thelocalchoice.state.va.us/sandbox/dhrm/customers/management.html
[jQuery] Novice problem, multiple distinct queries on one page.
I hope I'm in the right group this is a first. My office is new to using Jquery and on this problem we are all wandering around in the wilderness. We use IE, sharepoint and are doing web parts. On a single web part we need to do several queries on a list to fill several select/combo boxes. The data list I'm working with for self training and to narrow down the problems is: PLANT DEPTEMPLOYEE 1 1A EMP 1 1 1A EMP 2 1 1A EMP 3 1 1B EMP 4 1 1B EMP 5 1 1B EMP 6 1 1C EMP 7 1 1C EMP 8 1 1C EMP 9 2 2A EMP 10 2 2A EMP 11 2 2A EMP 12 2 2B EMP 13 2 2B EMP 14 2 2B EMP 15 2 2C EMP 16 I need query (1) to fill a select/combo box for PLANT (distinct value) that then unhides the DEPT select box. I have gotten a query to get the data and fill the select box but can't seem to find out how to make the query distinct. (See script below) Then with the selected value for Plant I needed a query (2) for DEPT. Followed by a query (3) for related employees. I can write individual Jquery code to do each list as individual web parts but writing one script (web part) to do 2 or more queries eludes me. The query done last is the one that produces a list. Could someone provide or point me to a example where this is done? Thanks for your effort and time. Here is the first query I used for Plant: script type=text/javascript src=https://psns.imfb.navy.mil/pages/ jquery-1.3.2.min.js/script script type=text/javascript $(document).ready(function() { var soapEnv = soapenv:Envelope xmlns:soapenv='http:// schemas.xmlsoap.org/soap/envelope/' \ soapenv:Body \ GetListItems xmlns='http://schemas.microsoft.com/ sharepoint/soap/' \ listNameDemo_Test_Data/listName \ viewFields \ ViewFields \ FieldRef Name='Plant' / \ FieldRef Name='Dept' / \ FieldRef Name='Employee' / \ /ViewFields \ /viewFields \ query \ Query \ OrderBy \ FieldRef Name='Plant' / \ FieldRef Name='Dept' / \ FieldRef Name='Employee' / \ /OrderBy \ /Query\ /query \ /GetListItems \ /soapenv:Body \ /soapenv:Envelope; $.ajax({ // Tell where the lists is located that is to be read url: /sites/C1230/C1237/tbbo/_vti_bin/lists.asmx, type: POST, dataType: xml, data: soapEnv, complete: GetSubjectParams, contentType: text/xml; charset=\utf-8\ }); }); function GetSubjectParams(xData, status) { $(xData.responseXML).find(z\\:row).each(function() { var strListItem = option value= strListItem = strListItem + option value=' strListItem = strListItem + $(this).attr(ows_Plant) strListItem = strListItem + ' strListItem = strListItem + $(this).attr(ows_Plant) strListItem = strListItem + /option //Put data into the list when it is unique and not already there $(#lstPlant).append(strListItem); }); // End of function //Hide the title line so we have more space for data //$(#onetidPageTitleAreaTable).hide(); // }; /script Table cellspacing=0 cellpadding=0 style=align:left; font-family:Times; background:LightGoldenRodYellow; background:GreenYellow; font-weight:bold; color:black; width=99% col align=left / th colspan=4 bSite Parameters And Subject Settings/b /th tr td width=25%nbsp;/td td width=25%/td td width=25%/td td width=25%/td /tr tr td style=background=Khaki select id=lstPlant style=align:left; font-family:Times; background=LightSkyBlue; font-weight:bold; color:black; width=90% option value=AllAll/option /select /td td style=background=Tan select id=lstDept style=align:left; font-family:Times; background=MediumTurquoise; font-weight:bold; color:black; width=90% option value=SomethingSomething/option /select /td td style=background=Coral select id=lstEmployee style=align:left; font-family:Times;
[jQuery] Re: (Validate) - How to apply validations on dynamically generated forms.
Hello !!! I have a problem like these but this solution wasnt enough to solve my problem... if you could help i will be so glad!! Take a look at my code: JS: $(function() { // valida o formulário $('#floculador').each(function(){ $(this).validate({ // define regras para os campos rules: { floculador.vazao: { required: true, number: true, min:0.001 }, floculador.comprimento: { required: true, number: true, min: 0.01 }, (so go on...) JSP: have dynamic input fields starting with just one...so when I add them and later click to send (and the validate acts) just the first works fine... If i click to send and there is just one (the original input field), and add later the validation gets all fields... can you help me? thanks a lot! Gustavo On 7 jul, 12:36, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: $(.commForm).each(function() { $(this).validate(); }); The call to validate works only with the first selected element, so you have to do an explicit loop. Jörn On Tue, Jul 7, 2009 at 3:34 PM, mnaveedmnaveed...@gmail.com wrote: Hi, I am using the JQuery validation plug in for form validations. My page contains a loop in which dynamic forms are generated and within each form some text fields are also dynamically generated. I have assigned the id and name attributes both to form and fields with dynamically appending a value. Now I want to apply the validation on all these form, please note that each form contains its own submit button. I have tried using the following selector, $('[class^=commForm]').validate(); // I assigned a class 'commForm' to all the dynamic form. $('[id^=commForm]').validate(); // I assigned id which starts with 'commForm' to all the dynamic form. but none of the above works. Can anyone please help me in this? Thanks.
[jQuery] Getting form field values
I have a simple set of checkboxes: input name=day1 type=checkbox value=sun / Sun input name=day2 type=checkbox value=mon / Mon input name=day3 type=checkbox value=tue / Tue input name=day4 type=checkbox value=wed / Wed input name=day5 type=checkbox value=thu / Thu input name=day6 type=checkbox value=fri / Fri input name=day7 type=checkbox value=sat / Sat When the state of one of them changes I want to check the state of all of them. So far I have: $(document).ready(function() { $(input[name^='day']).change(function () { }); }); My question is how do I get the value of each of the check boxes? It seems like all the commands I see in the jQuery documentation only give you the value of the first matched element? Do I have to use some sort of for loop? Thanks for the help.
[jQuery] new site on the sites using jquery list?
Hi all- It's been a rough month (lots of changes to be made) but, we've converted a lot of the javascript functions on FunAdvice to use jquery now :) Can we get added to this page, please? http://docs.jquery.com/Sites_Using_jQuery Thanks.
[jQuery] Re: KFManager v1.0
On your tinyMce page : http://trinhvietcuong.com/ken/tinymce.html you have KFManager for FCKeditor as page label... -- Cyril Lopez Développeur web www.nethik.fr 2009/8/20 Ken kenpha...@gmail.com without license GPL, MIT. I'm happy when you want to use and develop KFM 2009/8/20 Meroe whme...@gmail.com Well yea. Let's say I want to put this into a commercial app. I need to know the type of license this was released under so I can make a decision and be legit The download has no license information..GPL? MIT? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ken Phan Sent: Wednesday, August 19, 2009 3:15 PM To: jQuery (English) Subject: [jQuery] Re: KFManager v1.0 u want licensing terms ? On Aug 19, 2:54 am, Meroe whme...@gmail.com wrote: What are the licensing terms? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ken Phan Sent: Tuesday, August 18, 2009 12:21 PM To: jQuery (English) Subject: [jQuery] KFManager v1.0 KFManager (Ken's File Manager) is a plugin of jquery. It uses AJAX to manage image files in a web browser and it was developed to help programmer gently in the file manager. It is easy to use demo http://trinhvietcuong.com/ken/index.html -- -- - Administrator : Ken Phan Websmater : www.goldengate.com.vn Listen to music is free : www.enghe.info Ajax pagination: www.goldengate.com.vn/pagination jQuery navigation: www.goldengate.com.vn/navigation MP3 Ajax Flash webplayer: www.goldengate.com.vn/mp3 Blog me: http://my.opera.com/kenphan19/blog/ --
[jQuery] [validate] NOT equal to rule??
re: http://docs.jquery.com/Plugins/Validation/Methods/equalTo#other Is there a way to specify a rule that a field be NOT equal to? i.e. I have a watermark in the name field set as Enter your name - I want to validate that Enter your name is NOT the value of this field. Thanks for the help!
[jQuery] any toolkit to validata the 'form' of Json text-string?
I just use the Regular Expression, which my friend give me: function checkJsonFormat(text){ return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/(\ \.|[^\\])*/g, ''))); } Well, I can't clear it very much! And it's only allowed double quotes but I wanne use single quote ' sometimes in some case. So any boy can provide the usefull toolkit or idea to check the form of JSON? Really Appreciate. Mead Lai
[jQuery] using attr() on html element
I'm trying to turn the border for input fields on (or off). In my css I have border-style:none, and I want to turn the border back on if the first input is empty. $(input[type='text']).each(function() { $(this).attr(border-style, inset); }); The above code loops through the correct set of text input fields, but the border is not turned back on? I've been using jquery for a couple of weeks and use javascript infrequently, so jquery is very helpful in implementing my projects. Is the css overiding what I want to happen, or am I not using the attr () method correctly? I've also tried the opposite in not having css turn the border off, and use the attr() to turn it off, so it seem like an attr() usage issue to me? Thanks, Terry
[jQuery] Get directions on Google map with jquery
Hi guys, I am using a google maps implementation in an asp.net page. Essentially i have a business with its location shown on a google map on the page. On the asp.net side i just return instructions based on the locations properties. let me show you my script foreach(GoogleMapLocation g in profileElement.GetGoogleMapLocations()) { % script type=text/javascript $(document).ready(function() { if(GBrowserIsCompatible()) { var map = new GMap2 (document.getElementById('map_canvas')); map.addControl(new GSmallMapControl ()); map.setCenter(new GLatLng( %=g.GetLatitude()%, %=g.GetLongtitude ()%), %=g.GetZoomLevel()%); var point = new GLatLng( %=g.GetLatitude()%, %=g.GetLongtitude() %); var freeIcon = new GIcon(); zIcon.image = http://www.mysite.com/ images/map/zpointer.png; zIcon.shadow = http://www.mysite.com/ images/map/zshadow.png; zIcon.iconSize = new GSize(20, 32); zIcon.shadowSize = new GSize(25, 32); zIcon.iconAnchor = new GPoint(10, 31); zIcon.infoWindowAnchor = new GPoint(9, 2); zIcon.infoShadowAnchor = new GPoint (18, 25); var premiumIcon = new GIcon(); FirstIcon.image = http:// www.mysite.com/images/map/ Firstpointer.png; FirstIcon.shadow = http:// www.mysite.com/images/map/ Firstshadow.png; FirstIcon.iconSize = new GSize(20, 32); FirstIcon.shadowSize = new GSize(25, 32); FirstIcon.iconAnchor = new GPoint(10, 31); FirstIcon.infoWindowAnchor = new GPoint (9, 2); FirstIcon.infoShadowAnchor = new GPoint (18, 25); map.addOverlay(new GMarker(point, { title: ' %=profileElement.GetTitle().Replace(', \\')%', icon: %= (profileElement.GetStatus() == ProfileStatus.Premium) ? FirstIcon : zIcon% })); } }); /script div class=rightBoxInside div id=map_canvas style=width: 250px; height: 250px/div /div% } % so %=g.GetLatitude()%, %=g.GetLongtitude()% gives me the lat long for the business. Now i want to add the ability for a user to get directions (gdir) but im not sure how to do that, can anyone help? know i need a form entry to collec the users startlocation and a submit to postback to this page but im not sure how to implement. thanks, ind1g3n
[jQuery] jQuery Career Opportunity
Hi I am currently recruiting for a Front-End Web Developer with solid jQuery knowledge for an established, highly successful Web 2.0 project to add additional dynamic elements to the user interface of a commercial web application. This is an ongoing permanent internal opening with excellent earning potential, with the possibility of an initial six month freelance contract. The project is based in Berlin, Germany, the team is international and the project language is English. Berlin is a well connected, vibrant capital city with a high standard of living and is very economical compared to most other European cities. *If you are not an EU citizen, the company will sponsor the necessary work permits for the right candidate.* *Skills requirements:* Solid knowledge of the jQuery framework (X)HTML/CSS Ajax Multiple browser experience * Further desirable experience:* Agile development methodologies (SCRUM) Scripting languages, especially Ruby MVC frameworks, especially Ruby on Rails If you would like to know more, please reply to this email with your skills profile or CV, an indication of your current earnings, and the date your current contract ends or your notice period. Feel free pass this email to any friends or colleagues who may also be interested - recommendations are always welcome. Best regards Justin JOHN Web 2.0 Development CIS - Capitol International Services Ltd Office: +34 963943500 Mobile: +34 664498120 Fax:+34 961464120 Skype: justin-john www.capitolinternational.com www.xing.com/profile/Justin_John www.linkedin.com/in/justinjohn UK Registered Office: 189 Bickenhall House, Baker Street, London W1U 6BX, United Kingdom European Sales Office: Avenida Marques de Sotelo 5-17ª, 46002 Valencia, España
[jQuery] Orange Color is not Visible in Slider Range
Hi! Iam newbie to jQuery UI. Kindly visit following link : http://vibersol.com/ajaxsearch/ There is slider (with ranges) on top. I just used all default files and settings. What I am doing wrong that Orange color is not visible between range. Can some one guide me how can Orange Color (Default) can be put/visible there. Thanks in advance
[jQuery] Re: Animation Vapour Trails
Apologies, I missed the link: http://in.tellig.net/jquery.animateparam/jquery.animateparam.js and http://in.tellig.net/jquery.animateparam/ for an example. On Aug 19, 2:08 pm, Leonard Martin leonard.mar...@gmail.com wrote: I've been trying to write an extension to the animate function to allow the animation of elements along a parameterised path (in the original motivation this was around the diameter of a circle) whilst keeping use of things like $.easing and $().stop(). I've managed to put something together that seems to work, except that in the basic example I have one of the animated elements leaves a trail behind it as it moves it certain browsers. It seems to work fine in IE6 and Opera(Win) but leaves a trail in FF 3.5.2, Chrome 2.0.172.40 and Safari 4.02. I'm assuming it's a rendering engine bug, but it's something I've never come across before, so if anyone has any sage advice about how to deal with it, or has any other feedback on the plugin in general then I'd be interested to hear.
[jQuery] Re: using attr() on html element
I may be wrong here but don't you want to use the css reference so it should be $(this).css(border-style, inset); there is no html attribute called border-style, to style a html tag you use the style attribute like input type=text style=border- style: inset On Aug 20, 3:44 am, Terry tgs154...@yahoo.com wrote: I'm trying to turn the border for input fields on (or off). In my css I have border-style:none, and I want to turn the border back on if the first input is empty. $(input[type='text']).each(function() { $(this).attr(border-style, inset); }); The above code loops through the correct set of text input fields, but the border is not turned back on? I've been using jquery for a couple of weeks and use javascript infrequently, so jquery is very helpful in implementing my projects. Is the css overiding what I want to happen, or am I not using the attr () method correctly? I've also tried the opposite in not having css turn the border off, and use the attr() to turn it off, so it seem like an attr() usage issue to me? Thanks, Terry
[jQuery] Extend() element then Add() to another element
I would like to do the following: -- var many = $([]) for(){ var one = $('div/div') .data('stuff',true) .extend({ 'test':function() }) many = many.add(one) one.data('stuff') //pass one.test() //pass } many.eq(0).data('stuff') //pass many.eq(0).test() //FAIL, test function does not exist -- I would like test() to succeed, how can i accomplish this? Thanks in advance, Robin
[jQuery] Re: overlay does not work in jquery ajax success
I struggled with this same problem for hours! I just figured it out this morning. If you download the uncompressed .js file for the overlay tool you can see what's happening. In the 'constructor' for the overlay, there is a w.load function that binds the click action and initializes the rest of the overlay. However, on ajax success the opportunity for the window.load function to be called has passed! In order to make this work you need to strip that code out. In the minimized version its a little harder to find. Essentially what you need to do is look for the w.load(function(){ {) (in the uncompressed version). Leave all the contents of the function, but remove it from w.load. Should put this as a note to the tools developers I'd call it a bug? On Aug 11, 1:21 pm, gabel gabel.del...@googlemail.com wrote: I use jQuery Tools and got a strange problem (jQuery Tools --http://flowplayer.org/tools/index.html) HTML code class=html button type=button rel=#overlay id=overlaystaticstatic/ button button type=button rel=#overlay id=overlaydynamicdynamic/ button /code Version where only the static overlay works code class=javascript $(document).ready(function(){ $(#overlaystatic).overlay({expose: '#6096D4'}); function createoverlay () { var datastring = somedata; $.ajax({ type: POST, url: check.php, data: datastring = + datastring , success: function(msg){ alert(msg); $(#overlaydynamic).overlay({expose: '#6096D4'}); } }); } createoverlay(); }); /code If I put the overloay code for the dynamicoverlay outside of the ajax it works fine code class=javascript $(document).ready(function(){ $(#overlaystatic).overlay({expose: '#6096D4'}); function createoverlay () { var datastring = somedata; $.ajax({ type: POST, url: check.php, data: datastring = + datastring , success: function(msg){ alert(msg); } }); $(#overlaydynamic).overlay({expose: '#6096D4'}); } createoverlay(); }); /code so why the line $(#overlaydynamic).overlay({expose: '#6096D4'}); does work in the function but not inside the jquery ajax.
[jQuery] click-event-handler for dynamically created a-elements?
Hello, I've been working with jQuery about 20 hours now. I like it. I am looking for a demo of putting an a-element inside a div-element. This seems to work: $(#div99)[0].innerHTML = a id='aInDiv99' href='#'I am in div99/ a; I'd like to handle its click-event. I wrote this: $(a#aInDiv99).click(function(event){alert(hello world);}); The click event does not fire when I click 'aInDiv99' Is there a recipe for writing a click-event-handler for dynamically created a-elements? Oh, here is my world: - jquery-1.3.2.js - Safari 4.0.3 - Firefox 3.5.2 -Audrey
[jQuery] Problem with Ajax callback function in jQuery
I have Javascript code that looks like this: var data1; $.post('save_search.php', formData, function(data) { data1 = data; } ); jsonData = eval('(' + data1 + ')'); if (jsonData.return_status.search(successful) -1) $('#msg_div').html(font color=redSearch was saved/font); else $('#msg_div').html(font color=redSearch was not saved. Try saving again./font); +++ data1 comes up as undefined in the statement jsonData = eval('(' + data1 + ')'); even though data is a perfectly correct JSON string *inside* the callback function! I can put the eval statement inside the callback function and it will form a good JSON object, like this: jsonData = eval('(' + data + ')'); I'm simply trying to get my Ajax response data to the outside of my callback function so I can use it in other Javascript code. Does anyone know what is wrong? I've never seen an ordinary function behave this way.
[jQuery] Re: KFManager v1.0
great work Ken on the mce page the normal mce manager opens for me - and as Cyril said the page is title FCK on the fck page you open KFManager by clicking in the text box above the editor whereas the mce example does not have a way of opening kfmanager it would be better to replace normal function of the image icon (and other media too eg flash) witht the kfmanager - S 2009/8/20 Cyril Lopez loveisthe...@gmail.com On your tinyMce page : http://trinhvietcuong.com/ken/tinymce.html you have KFManager for FCKeditor as page label... -- Cyril Lopez Développeur web www.nethik.fr 2009/8/20 Ken kenpha...@gmail.com without license GPL, MIT. I'm happy when you want to use and develop KFM 2009/8/20 Meroe whme...@gmail.com Well yea. Let's say I want to put this into a commercial app. I need to know the type of license this was released under so I can make a decision and be legit The download has no license information..GPL? MIT? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ken Phan Sent: Wednesday, August 19, 2009 3:15 PM To: jQuery (English) Subject: [jQuery] Re: KFManager v1.0 u want licensing terms ? On Aug 19, 2:54 am, Meroe whme...@gmail.com wrote: What are the licensing terms? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ken Phan Sent: Tuesday, August 18, 2009 12:21 PM To: jQuery (English) Subject: [jQuery] KFManager v1.0 KFManager (Ken's File Manager) is a plugin of jquery. It uses AJAX to manage image files in a web browser and it was developed to help programmer gently in the file manager. It is easy to use demo http://trinhvietcuong.com/ken/index.html -- -- - Administrator : Ken Phan Websmater : www.goldengate.com.vn Listen to music is free : www.enghe.info Ajax pagination: www.goldengate.com.vn/pagination jQuery navigation: www.goldengate.com.vn/navigation MP3 Ajax Flash webplayer: www.goldengate.com.vn/mp3 Blog me: http://my.opera.com/kenphan19/blog/ --
[jQuery] Re: .html() ignoring updated input value
Hi guys, thanks for the help! I have a lighbox that posts via ajax some params. If there is an error, the window has a back button and on press it shows the latest saved lighbox content. If it is a form, then should be already compiled or can be really annoiyng recompile it... I could then serialize the inputs and then cycle the form inputs and fill them with the serialized object... what do you think about it? On 19 Ago, 03:48, James james.gp@gmail.com wrote: You can use serializeArray() to serialize all the form info into an object.http://docs.jquery.com/Ajax/serializeArray For what purpose are you saving the state of the form? Maybe there are workarounds depending on what you're trying to achieve. On Aug 18, 7:29 am, resetstudio navy...@gmail.com wrote: Hi everybody, how are you? I have to save the state of a form in a var before submitting it with the whole html, but if I alert the var, I get the original html without the updated input fields. Example: I have div input type='text' name='test'/ /div and I fill that field with hahahah, on $(div).html() i get input type='text' name='test'/ and not input type='text' name='test' value='hahahah'/. Can someone help me? Tank you!
[jQuery] Re: Detecting Selected Text
Chris Jordan ha scritto: Thanks for the response Richard. I'll check out these links. :o) Hi, I saw this plugin http://plugins.jquery.com/project/a-tools and I remembered this message... I think it's what you were looking for. Bye -- gianiaz.net - web solutions via piedo, 58 - 23020 tresivio (so) - italy +39 347 7196482
[jQuery] Re: Hey ive got a question about a realy basic thing im trying to implement on wordpress with Gr
try converting "$" to "jQuery" in all of your functions, theme may be using noConflict bmo...@pushthefuture.org wrote: Hey ive got a question about a realy basic thing im trying to implement on wordpress with Graphpaperpress's Modularity theme. Here it is: script type="text/_javascript_" $(document).ready(function() { alert('slickBox JQuery Loaded'); // hides the slickbox as soon as the DOM is ready // (a little sooner than page load) $('.slickbox').hide(); // toggles the slickbox on clicking the noted link $('a#slick-toggle').click(function() { $('.slickbox').slideToggle(400); return false; }); // closes the slickbox on clicking the noted link $('a#slick-close').click(function() { $('.slickbox').slideUp(400); return false; }); }); /script h2 p Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. smalla href="" id="slick- toggle" name="slick-toggle"Read More.../a/small /p div class="slickbox" !--Start the Slickbox Dropdown-- hr p It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).smalla href="" id="slick-close" name="slick-close"Close.../ a/small /p /div !--End the Slickbox Dropdown--/h2 Now the question is strange because the Alert box isn't even loading up or anything is there something wrong in the jquery?
[jQuery] Re: Problem with Ajax callback function in jQuery
From the looks of it, why don't you use the $.ajax function and do your stuff on success? Seems like an easier way to structure things. Sometimes a variable used in a function that you want to use elsewhere has to be stored somewhere as it won't be recognized globally. Check http://docs.jquery.com/Core/data#name for more info.
[jQuery] Re: Get directions on Google map with jquery
Hi this requires using ajax ( either jQuery or google code) to send/retrieve the information which also needs to be tied into gmap code which is part of the Google map API. Google has to geocode both locations and return the directions. Once directions returned jQuery can be helpful for displaying them If you need someone to put this module together I'd be happy to do it for you. ind1g3n wrote: Hi guys, I am using a google maps implementation in an asp.net page. Essentially i have a business with its location shown on a google map on the page. On the asp.net side i just return instructions based on the locations properties. let me show you my script foreach(GoogleMapLocation g in profileElement.GetGoogleMapLocations()) { % script type="text/_javascript_" $(document).ready(function() { if(GBrowserIsCompatible()) { var map = new GMap2 (document.getElementById('map_canvas')); map.addControl(new GSmallMapControl ()); map.setCenter(new GLatLng( %=g.GetLatitude()%, %=g.GetLongtitude ()%), %=g.GetZoomLevel()%); var point = new GLatLng( %=g.GetLatitude()%, %=g.GetLongtitude() %); var freeIcon = new GIcon(); zIcon.image = "http://www.mysite.com/ images/map/zpointer.png"; zIcon.shadow = "http://www.mysite.com/ images/map/zshadow.png"; zIcon.iconSize = new GSize(20, 32); zIcon.shadowSize = new GSize(25, 32); zIcon.iconAnchor = new GPoint(10, 31); zIcon.infoWindowAnchor = new GPoint(9, 2); zIcon.infoShadowAnchor = new GPoint (18, 25); var premiumIcon = new GIcon(); FirstIcon.image = "http:// www.mysite.com/images/map/ Firstpointer.png"; FirstIcon.shadow = "http:// www.mysite.com/images/map/ Firstshadow.png"; FirstIcon.iconSize = new GSize(20, 32); FirstIcon.shadowSize = new GSize(25, 32); FirstIcon.iconAnchor = new GPoint(10, 31); FirstIcon.infoWindowAnchor = new GPoint (9, 2); FirstIcon.infoShadowAnchor = new GPoint (18, 25); map.addOverlay(new GMarker(point, { title: ' %=profileElement.GetTitle().Replace("'", "\\'")%', icon: %= (profileElement.GetStatus() == ProfileStatus.Premium) ? "FirstIcon" : "zIcon"% })); } }); /script div class="rightBoxInside" div id="map_canvas" style="width: 250px; height: 250px"/div /div% } % so %=g.GetLatitude()%, %=g.GetLongtitude()% gives me the lat long for the business. Now i want to add the ability for a user to get directions (gdir) but im not sure how to do that, can anyone help? know i need a form entry to collec the users startlocation and a submit to postback to this page but im not sure how to implement. thanks, ind1g3n
[jQuery] Re: Orange Color is not Visible in Slider Range
You don't have a range slider, you have a multi-handle/value slider, where the handles can cross each other and are unrelated. And range: true to your slider init: jQuery('#slider').slider({ range: true, ... }); See http://docs.jquery.com/UI/Slider#option-range Also, since you're specifying values: [75, 300], no need to specify value: 100. If you have any further questions about slider or another jQuery UI plugin, note there's a dedicated list for those: http://groups.google.com/group/jquery-ui - Richard On Thu, Aug 20, 2009 at 7:29 AM, Bluesapphire ahmadsaa...@gmail.com wrote: Hi! Iam newbie to jQuery UI. Kindly visit following link : http://vibersol.com/ajaxsearch/ There is slider (with ranges) on top. I just used all default files and settings. What I am doing wrong that Orange color is not visible between range. Can some one guide me how can Orange Color (Default) can be put/visible there. Thanks in advance
[jQuery] Re: Problem with Ajax callback function in jQuery
The trouble is that the $.post is run asynchronously so anything after the $.post will be executed before the callback function. If you want the returned data to be available outside the callback then it will have to be inside a function which is called from within your callback method. e.g. var data1; $.post('save_search.php', formData, function(data) { data1 = data; handle(); } ); function handle() { jsonData = eval('(' + data1 + ')'); if (jsonData.return_status.search(successful) -1) $('#msg_div').html(font color=redSearch was saved/font); else $('#msg_div').html(font color=redSearch was not saved. Try saving again./font); } On Aug 19, 11:33 pm, dkomo872 dkomo...@comcast.net wrote: I have Javascript code that looks like this: var data1; $.post('save_search.php', formData, function(data) { data1 = data; } ); jsonData = eval('(' + data1 + ')'); if (jsonData.return_status.search(successful) -1) $('#msg_div').html(font color=redSearch was saved/font); else $('#msg_div').html(font color=redSearch was not saved. Try saving again./font); +++ data1 comes up as undefined in the statement jsonData = eval('(' + data1 + ')'); even though data is a perfectly correct JSON string *inside* the callback function! I can put the eval statement inside the callback function and it will form a good JSON object, like this: jsonData = eval('(' + data + ')'); I'm simply trying to get my Ajax response data to the outside of my callback function so I can use it in other Javascript code. Does anyone know what is wrong? I've never seen an ordinary function behave this way.
[jQuery] Re: any toolkit to validata the 'form' of Json text-string?
json2.js would help http://www.json.org/js.html in particular the .parse method On Aug 20, 1:42 am, Mead Lai laiqi...@gmail.com wrote: I just use the Regular Expression, which my friend give me: function checkJsonFormat(text){ return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/(\ \.|[^\\])*/g, ''))); } Well, I can't clear it very much! And it's only allowed double quotes but I wanne use single quote ' sometimes in some case. So any boy can provide the usefull toolkit or idea to check the form of JSON? Really Appreciate. Mead Lai
[jQuery] Re: Problem with Ajax callback function in jQuery
Does anyone know what is wrong? I've never seen an ordinary function behave this way. That's because $.post (and the resultant $.ajax) isn't ordinary, it's an asynchronous call and when you hit the line jsonData = eval('(' + data + ')'); the script isn't back from the post call yet you need to learn about callbacks to better your code to take full advantage of async behavior another tip, if you are doing a post and looking to get back JSON, then use something like: var Options = { type = POST, url = save_search.php, processData = true, data = formData, dataType = json, success = SaveSearch_Success, error = SaveSearch_Error }; $.ajax(Options); and outside all that, here are your functions outside the ajax call function SaveSearch_Success(data) { // data = your result in JSON already }; function SaveSearch_Error(x,y,z) { // x.responseText will have server side error message };
[jQuery] Re: Problem with Ajax callback function in jQuery
On Aug 20, 7:01 am, Leonard Martin leonard.mar...@gmail.com wrote: The trouble is that the $.post is run asynchronously so anything after the $.post will be executed before the callback function. If you want the returned data to be available outside the callback then it will have to be inside a function which is called from within your callback method. e.g. var data1; $.post('save_search.php', formData, function(data) { data1 = data; handle(); } ); function handle() { jsonData = eval('(' + data1 + ')'); if (jsonData.return_status.search(successful) -1) $('#msg_div').html(font color=redSearch was saved/font); else $('#msg_div').html(font color=redSearch was not saved. Try saving again./font); } Sadly, I talready ried this and hit what appears to be another problem. handle() (or my equivalent function) came up as undefined according to Firebug when I tried to call it inside the callback function. It may be because my Javascript code is within the body of the HTML file (due to reasons out of my control) rather than the head. Maybe I can't use functions this way inside body. Or maybe it's same old asynchronous problem with Ajax.
[jQuery] Re: click-event-handler for dynamically created a-elements?
You might also want to check go to http://api.jquery.com and check out the live method under Events--Live Events. On Aug 20, 9:43 am, ak732 ask...@gmail.com wrote: There are a lot of ways to do this, here are a couple: $(#div99).append(a id='alnDiv99' href='#'I am in div99/a).click (function(){alert(hello world);}); $(a/).attr({id:alnDiv99, href:#}).text(I am in div99).click (function(){alert(hello world);}).appendTo(#div99); On Aug 20, 6:42 am, Audrey A Lee audrey.lee.is...@gmail.com wrote: Hello, I've been working with jQuery about 20 hours now. I like it. I am looking for a demo of putting an a-element inside a div-element. This seems to work: $(#div99)[0].innerHTML = a id='aInDiv99' href='#'I am in div99/ a; I'd like to handle its click-event. I wrote this: $(a#aInDiv99).click(function(event){alert(hello world);}); The click event does not fire when I click 'aInDiv99' Is there a recipe for writing a click-event-handler for dynamically created a-elements? Oh, here is my world: - jquery-1.3.2.js - Safari 4.0.3 - Firefox 3.5.2 -Audrey
[jQuery] Re: using attr() on html element
Try borderStyle instead of border-style and you should be okay. On Aug 19, 10:44 pm, Terry tgs154...@yahoo.com wrote: I'm trying to turn the border for input fields on (or off). In my css I have border-style:none, and I want to turn the border back on if the first input is empty. $(input[type='text']).each(function() { $(this).attr(border-style, inset); }); The above code loops through the correct set of text input fields, but the border is not turned back on? I've been using jquery for a couple of weeks and use javascript infrequently, so jquery is very helpful in implementing my projects. Is the css overiding what I want to happen, or am I not using the attr () method correctly? I've also tried the opposite in not having css turn the border off, and use the attr() to turn it off, so it seem like an attr() usage issue to me? Thanks, Terry
[jQuery] Re: Problem with Ajax callback function in jQuery
Try doing this and see if it works: style type=text/css#msg_div {font-color:red;}/style $.post('save_search.php', formData, function(data) { jsonData = eval('(' + data + ')'); if (jsonData.return_status.search(successful) -1) { $('#msg_div').html(Search was saved); } else { $('#msg_div').html(Search was not saved. Try saving again.); } } ); If it works, but you want to be able to reuse the callback Fn, then do it this way: style type=text/css#msg_div {font-color:red;}/style function saveSearchFn(data) { jsonData = eval('(' + data + ')'); if (jsonData.return_status.search(successful) -1) { $('#msg_div').html(Search was saved); } else { $('#msg_div').html(Search was not saved. Try saving again.); } } $.post('save_search.php', formData, safeSearchFn); On Aug 20, 9:34 am, dkomo872 dkomo...@comcast.net wrote: On Aug 20, 7:01 am, Leonard Martin leonard.mar...@gmail.com wrote: The trouble is that the $.post is run asynchronously so anything after the $.post will be executed before the callback function. If you want the returned data to be available outside the callback then it will have to be inside a function which is called from within your callback method. e.g. var data1; $.post('save_search.php', formData, function(data) { data1 = data; handle(); } ); function handle() { jsonData = eval('(' + data1 + ')'); if (jsonData.return_status.search(successful) -1) $('#msg_div').html(font color=redSearch was saved/font); else $('#msg_div').html(font color=redSearch was not saved. Try saving again./font); } Sadly, I talready ried this and hit what appears to be another problem. handle() (or my equivalent function) came up as undefined according to Firebug when I tried to call it inside the callback function. It may be because my Javascript code is within the body of the HTML file (due to reasons out of my control) rather than the head. Maybe I can't use functions this way inside body. Or maybe it's same old asynchronous problem with Ajax.
[jQuery] Re: Problem with Ajax callback function in jQuery
On Aug 20, 6:59 am, MorningZ morni...@gmail.com wrote: Does anyone know what is wrong? I've never seen an ordinary function behave this way. That's because $.post (and the resultant $.ajax) isn't ordinary, it's an asynchronous call and when you hit the line jsonData = eval('(' + data + ')'); the script isn't back from the post call yet you need to learn about callbacks to better your code to take full advantage of async behavior another tip, if you are doing a post and looking to get back JSON, then use something like: var Options = { type = POST, url = save_search.php, processData = true, data = formData, dataType = json, success = SaveSearch_Success, error = SaveSearch_Error}; $.ajax(Options); and outside all that, here are your functions outside the ajax call function SaveSearch_Success(data) { // data = your result in JSON already}; function SaveSearch_Error(x,y,z) { // x.responseText will have server side error message }; How does this get around the asynchronous problem though? If I try to put and use the JSON object outside of SaveSearch_Success, won't I hit the same problem I already have?
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
Hey dude, I never create and add closing elements, jQuery will usually always do this automatically. I would just do something like: $(function() { var div = $(div).addClass(scrollablePost); $('.page-od-9 .postmetadata').appendTo(div); div.insertBefore('.page-id-9 h2'); }); That would be the approach I tried :D On Aug 20, 3:06 pm, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] Re: Dropdown menu Issue
Okay, so this work but I got another question... When the menu is animating down or up, if you move off it jumps to the end and starts the animation the other way, is there a way to make it just start sliding up from where it is? On Aug 13, 5:45 pm, Xenongasman xenongas...@gmail.com wrote: Actually the answer is a lot simpler than I thought and something I should have found a lot sooner. I just needed to pass in parameters to stop() as is shown below: script language=JavaScript $(function(){ $('#menu li').hover( function() { $(this).find('ul:first').css({display:none}).stop (0,1).slideDown(); }, function(){ $(this).find('ul:first').stop(0,1).slideUp(); }); }); /script On Aug 12, 3:58 pm, amuhlou amysch...@gmail.com wrote: perhaps something like unbinding the hover would work http://docs.jquery.com/Events/unbind On Aug 12, 12:29 pm, Xenongasman xenongas...@gmail.com wrote: Any ideas? On Aug 8, 2:18 pm, Xenongasman xenongas...@gmail.com wrote: Yes it does work fine, except that the animations will repeat themselves if you move on and off again quickly. So to remedy that I changed the script to: script language=JavaScript $(function(){ $('#menu li').hover( function() { $(this).find('ul:first').css({display:none}).stop().slideDown (); }, function(){ $(this).find('ul:first').stop().slideUp('slow'); }); }); /script Then try it and move over one menu then the other very quickly and you'll see what i explained. And it also adds a artifact in IE7. I suppose i could leave it as is and not use stop() but I just wanted to know if someone knew how to fix this.
[jQuery] Re: Problem with Ajax callback function in jQuery
On Aug 20, 6:26 am, Chrazy cwolg...@gmail.com wrote: From the looks of it, why don't you use the $.ajax function and do your stuff on success? Seems like an easier way to structure things. Sometimes a variable used in a function that you want to use elsewhere has to be stored somewhere as it won't be recognized globally. Checkhttp://docs.jquery.com/Core/data#namefor more info. Ok. I didn't know about the $.ajax function. I'll look into it.
[jQuery] Re: Animation Vapour Trails
Might have something to do with cleartype? Leonard Martin wrote: Apologies, I missed the link: http://in.tellig.net/jquery.animateparam/jquery.animateparam.js and http://in.tellig.net/jquery.animateparam/ for an example. On Aug 19, 2:08 pm, Leonard Martin leonard.mar...@gmail.com wrote: I've been trying to write an extension to the animate function to allow the animation of elements along a parameterised path (in the original motivation this was around the diameter of a circle) whilst keeping use of things like $.easing and $().stop(). I've managed to put something together that seems to work, except that in the basic example I have one of the animated elements leaves a trail behind it as it moves it certain browsers. It seems to work fine in IE6 and Opera(Win) but leaves a trail in FF 3.5.2, Chrome 2.0.172.40 and Safari 4.02. I'm assuming it's a rendering engine bug, but it's something I've never come across before, so if anyone has any sage advice about how to deal with it, or has any other feedback on the plugin in general then I'd be interested to hear.
[jQuery] Re: Dropdown menu Issue
I think if you reverse the parameters you're passing to stop() then that should achieve what you're after. You want to clear the queue (true for first parameter) but stop the animation where it is, not go to the end (false for second paramter). On Aug 20, 3:16 pm, Xenongasman xenongas...@gmail.com wrote: Okay, so this work but I got another question... When the menu is animating down or up, if you move off it jumps to the end and starts the animation the other way, is there a way to make it just start sliding up from where it is? On Aug 13, 5:45 pm, Xenongasman xenongas...@gmail.com wrote: Actually the answer is a lot simpler than I thought and something I should have found a lot sooner. I just needed to pass in parameters to stop() as is shown below: script language=JavaScript $(function(){ $('#menu li').hover( function() { $(this).find('ul:first').css({display:none}).stop (0,1).slideDown(); }, function(){ $(this).find('ul:first').stop(0,1).slideUp(); }); }); /script On Aug 12, 3:58 pm, amuhlou amysch...@gmail.com wrote: perhaps something like unbinding the hover would work http://docs.jquery.com/Events/unbind On Aug 12, 12:29 pm, Xenongasman xenongas...@gmail.com wrote: Any ideas? On Aug 8, 2:18 pm, Xenongasman xenongas...@gmail.com wrote: Yes it does work fine, except that the animations will repeat themselves if you move on and off again quickly. So to remedy that I changed the script to: script language=JavaScript $(function(){ $('#menu li').hover( function() { $(this).find('ul:first').css({display:none}).stop().slideDown (); }, function(){ $(this).find('ul:first').stop().slideUp('slow'); }); }); /script Then try it and move over one menu then the other very quickly and you'll see what i explained. And it also adds a artifact in IE7. I suppose i could leave it as is and not use stop() but I just wanted to know if someone knew how to fix this.
[jQuery] Re: click-event-handler for dynamically created a-elements?
There are a lot of ways to do this, here are a couple: $(#div99).append(a id='alnDiv99' href='#'I am in div99/a).click (function(){alert(hello world);}); $(a/).attr({id:alnDiv99, href:#}).text(I am in div99).click (function(){alert(hello world);}).appendTo(#div99); On Aug 20, 6:42 am, Audrey A Lee audrey.lee.is...@gmail.com wrote: Hello, I've been working with jQuery about 20 hours now. I like it. I am looking for a demo of putting an a-element inside a div-element. This seems to work: $(#div99)[0].innerHTML = a id='aInDiv99' href='#'I am in div99/ a; I'd like to handle its click-event. I wrote this: $(a#aInDiv99).click(function(event){alert(hello world);}); The click event does not fire when I click 'aInDiv99' Is there a recipe for writing a click-event-handler for dynamically created a-elements? Oh, here is my world: - jquery-1.3.2.js - Safari 4.0.3 - Firefox 3.5.2 -Audrey
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
Cheers Dan, but that doesn't close the div class=scrollablePost properly: http://twitpic.com/el8q8 :[ L On Aug 20, 3:15 pm, DanWellman danwell...@gmail.com wrote: Hey dude, I never create and add closing elements, jQuery will usually always do this automatically. I would just do something like: $(function() { var div = $(div).addClass(scrollablePost); $('.page-od-9 .postmetadata').appendTo(div); div.insertBefore('.page-id-9 h2'); }); That would be the approach I tried :D On Aug 20, 3:06 pm, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] jquery license - what do my company have to do
Hi everyone, For the latest project I have lead (which is a java web project) I have included some jquery,jqueryui and 1 or 2 jquery plugins, knowing that the MIT license allow us to use it even for commercial use. Now that the v1 is almost done. We are wondering what exactly we have to do to be legal. MIT license says: on the condition that the license is distributed with that software. what does that mean exactly? Do we need to write a line in our docu saying: use jquery,..., which is under MIT license? Do we have to write on the pages with our copyright that we use jquery with the little ©? Do we have to do something else? Thanks for the explanations. Antoine
[jQuery] Re: Problem with Ajax callback function in jQuery
and just to note success = SaveSearch_Success, should look just like that... it shouldn't be success = SaveSearch_Success(), or success = SaveSearch_Success(data), or *anything else*... it already knows to pass the resultant JSON to the function On Aug 20, 9:34 am, dkomo872 dkomo...@comcast.net wrote: On Aug 20, 7:01 am, Leonard Martin leonard.mar...@gmail.com wrote: The trouble is that the $.post is run asynchronously so anything after the $.post will be executed before the callback function. If you want the returned data to be available outside the callback then it will have to be inside a function which is called from within your callback method. e.g. var data1; $.post('save_search.php', formData, function(data) { data1 = data; handle(); } ); function handle() { jsonData = eval('(' + data1 + ')'); if (jsonData.return_status.search(successful) -1) $('#msg_div').html(font color=redSearch was saved/font); else $('#msg_div').html(font color=redSearch was not saved. Try saving again./font); } Sadly, I talready ried this and hit what appears to be another problem. handle() (or my equivalent function) came up as undefined according to Firebug when I tried to call it inside the callback function. It may be because my Javascript code is within the body of the HTML file (due to reasons out of my control) rather than the head. Maybe I can't use functions this way inside body. Or maybe it's same old asynchronous problem with Ajax.
[jQuery] Re: Problem with Ajax callback function in jQuery
the code i posted should have no problem working as long as it is used properly... without seeing your actual HTML and where stuff is and what gets called, it's impossible to help completely. and the body/head thing won't matter that much as long as document.ready is used... but even that's a guess without seeing what is really going on with the HTML On Aug 20, 9:34 am, dkomo872 dkomo...@comcast.net wrote: On Aug 20, 7:01 am, Leonard Martin leonard.mar...@gmail.com wrote: The trouble is that the $.post is run asynchronously so anything after the $.post will be executed before the callback function. If you want the returned data to be available outside the callback then it will have to be inside a function which is called from within your callback method. e.g. var data1; $.post('save_search.php', formData, function(data) { data1 = data; handle(); } ); function handle() { jsonData = eval('(' + data1 + ')'); if (jsonData.return_status.search(successful) -1) $('#msg_div').html(font color=redSearch was saved/font); else $('#msg_div').html(font color=redSearch was not saved. Try saving again./font); } Sadly, I talready ried this and hit what appears to be another problem. handle() (or my equivalent function) came up as undefined according to Firebug when I tried to call it inside the callback function. It may be because my Javascript code is within the body of the HTML file (due to reasons out of my control) rather than the head. Maybe I can't use functions this way inside body. Or maybe it's same old asynchronous problem with Ajax.
[jQuery] Re: Animation Vapour Trails
I don't think so. I tried it with ClearType enabled and disbaled and the effect was the same either way. It also seems not to affect MSIE, only Gecko and Webkit. On Aug 20, 2:49 pm, Liam Potter radioactiv...@gmail.com wrote: Might have something to do with cleartype? Leonard Martin wrote: Apologies, I missed the link: http://in.tellig.net/jquery.animateparam/jquery.animateparam.js and http://in.tellig.net/jquery.animateparam/for an example. On Aug 19, 2:08 pm, Leonard Martin leonard.mar...@gmail.com wrote: I've been trying to write an extension to the animate function to allow the animation of elements along a parameterised path (in the original motivation this was around the diameter of a circle) whilst keeping use of things like $.easing and $().stop(). I've managed to put something together that seems to work, except that in the basic example I have one of the animated elements leaves a trail behind it as it moves it certain browsers. It seems to work fine in IE6 and Opera(Win) but leaves a trail in FF 3.5.2, Chrome 2.0.172.40 and Safari 4.02. I'm assuming it's a rendering engine bug, but it's something I've never come across before, so if anyone has any sage advice about how to deal with it, or has any other feedback on the plugin in general then I'd be interested to hear.
[jQuery] 'Wrapping' some (not just 1 pair) HTML elements in a div?
Yo guys, I need to wrap this chuck of HTML in a div: http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] Re: Getting form field values
You could do it in a loop using each(): $(input[name^='day']).each(function() { if ($(this).is(:checked)) { // do whatever } }); On Aug 19, 5:20 pm, blcArmadillo blackarmadi...@gmail.com wrote: I have a simple set of checkboxes: input name=day1 type=checkbox value=sun / Sun input name=day2 type=checkbox value=mon / Mon input name=day3 type=checkbox value=tue / Tue input name=day4 type=checkbox value=wed / Wed input name=day5 type=checkbox value=thu / Thu input name=day6 type=checkbox value=fri / Fri input name=day7 type=checkbox value=sat / Sat When the state of one of them changes I want to check the state of all of them. So far I have: $(document).ready(function() { $(input[name^='day']).change(function () { }); }); My question is how do I get the value of each of the check boxes? It seems like all the commands I see in the jQuery documentation only give you the value of the first matched element? Do I have to use some sort of for loop? Thanks for the help.
[jQuery] Re: Hey ive got a question about a realy basic thing im trying to implement
You're not seeing the alert? Did you remember to include the link to the jQuery library on the page first? On Aug 19, 4:17 pm, bmo...@pushthefuture.org bmo...@pushthefuture.org wrote: Hey ive got a question about a realy basic thing im trying to implement on wordpress with Graphpaperpress's Modularity theme. Here it is: script type=text/javascript $(document).ready(function() { alert('slickBox JQuery Loaded'); // hides the slickbox as soon as the DOM is ready // (a little sooner than page load) $('.slickbox').hide(); // toggles the slickbox on clicking the noted link $('a#slick-toggle').click(function() { $('.slickbox').slideToggle(400); return false; }); // closes the slickbox on clicking the noted link $('a#slick-close').click(function() { $('.slickbox').slideUp(400); return false; }); }); /script h2 p Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. smalla href=# id=slick- toggle name=slick-toggleRead More.../a/small /p div class=slickbox !--Start the Slickbox Dropdown-- hr p It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).smalla href=# id=slick-close name=slick-closeClose.../ a/small /p /div !--End the Slickbox Dropdown--/h2 Now the question is strange because the Alert box isn't even loading up or anything is there something wrong in the jquery?
[jQuery] Re: Animation Vapour Trails
I see the same thing on Ubuntu, so I guess it's some bug that's both in Gecko and Webkit (I see it in Firefox and in Chromium, not in Opera). There's slight differences between the way the artifacts are shown in both browsers. Your best bet might be to try and get in touch with somebody that's working on either Webkit or Mozilla through IRC or something. Jonathan Liam Potter wrote: Might have something to do with cleartype? Leonard Martin wrote: Apologies, I missed the link: http://in.tellig.net/jquery.animateparam/jquery.animateparam.js and http://in.tellig.net/jquery.animateparam/ for an example. On Aug 19, 2:08 pm, Leonard Martin leonard.mar...@gmail.com wrote: I've been trying to write an extension to the animate function to allow the animation of elements along a parameterised path (in the original motivation this was around the diameter of a circle) whilst keeping use of things like $.easing and $().stop(). I've managed to put something together that seems to work, except that in the basic example I have one of the animated elements leaves a trail behind it as it moves it certain browsers. It seems to work fine in IE6 and Opera(Win) but leaves a trail in FF 3.5.2, Chrome 2.0.172.40 and Safari 4.02. I'm assuming it's a rendering engine bug, but it's something I've never come across before, so if anyone has any sage advice about how to deal with it, or has any other feedback on the plugin in general then I'd be interested to hear. -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Re: Animation Vapour Trails
Can someone point me to where I might log a bug with Gecko or Webkit? I'm fairly new to this whole process. Thanks again. On Aug 20, 3:41 pm, Jonathan Vanherpe (T T NV) jonat...@tnt.be wrote: I see the same thing on Ubuntu, so I guess it's some bug that's both in Gecko and Webkit (I see it in Firefox and in Chromium, not in Opera). There's slight differences between the way the artifacts are shown in both browsers. Your best bet might be to try and get in touch with somebody that's working on either Webkit or Mozilla through IRC or something. Jonathan Liam Potter wrote: Might have something to do with cleartype? Leonard Martin wrote: Apologies, I missed the link: http://in.tellig.net/jquery.animateparam/jquery.animateparam.js and http://in.tellig.net/jquery.animateparam/for an example. On Aug 19, 2:08 pm, Leonard Martin leonard.mar...@gmail.com wrote: I've been trying to write an extension to the animate function to allow the animation of elements along a parameterised path (in the original motivation this was around the diameter of a circle) whilst keeping use of things like $.easing and $().stop(). I've managed to put something together that seems to work, except that in the basic example I have one of the animated elements leaves a trail behind it as it moves it certain browsers. It seems to work fine in IE6 and Opera(Win) but leaves a trail in FF 3.5.2, Chrome 2.0.172.40 and Safari 4.02. I'm assuming it's a rendering engine bug, but it's something I've never come across before, so if anyone has any sage advice about how to deal with it, or has any other feedback on the plugin in general then I'd be interested to hear. -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Re: KFManager v1.0
sorry. because the time busy, can the next time I will put it to MCE. 2009/8/20 Sam Sherlock sam.sherl...@gmail.com great work Ken on the mce page the normal mce manager opens for me - and as Cyril said the page is title FCK on the fck page you open KFManager by clicking in the text box above the editor whereas the mce example does not have a way of opening kfmanager it would be better to replace normal function of the image icon (and other media too eg flash) witht the kfmanager - S 2009/8/20 Cyril Lopez loveisthe...@gmail.com On your tinyMce page : http://trinhvietcuong.com/ken/tinymce.html you have KFManager for FCKeditor as page label... -- Cyril Lopez Développeur web www.nethik.fr 2009/8/20 Ken kenpha...@gmail.com without license GPL, MIT. I'm happy when you want to use and develop KFM 2009/8/20 Meroe whme...@gmail.com Well yea. Let's say I want to put this into a commercial app. I need to know the type of license this was released under so I can make a decision and be legit The download has no license information..GPL? MIT? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ken Phan Sent: Wednesday, August 19, 2009 3:15 PM To: jQuery (English) Subject: [jQuery] Re: KFManager v1.0 u want licensing terms ? On Aug 19, 2:54 am, Meroe whme...@gmail.com wrote: What are the licensing terms? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ken Phan Sent: Tuesday, August 18, 2009 12:21 PM To: jQuery (English) Subject: [jQuery] KFManager v1.0 KFManager (Ken's File Manager) is a plugin of jquery. It uses AJAX to manage image files in a web browser and it was developed to help programmer gently in the file manager. It is easy to use demo http://trinhvietcuong.com/ken/index.html -- -- - Administrator : Ken Phan Websmater : www.goldengate.com.vn Listen to music is free : www.enghe.info Ajax pagination: www.goldengate.com.vn/pagination jQuery navigation: www.goldengate.com.vn/navigation MP3 Ajax Flash webplayer: www.goldengate.com.vn/mp3 Blog me: http://my.opera.com/kenphan19/blog/ -- -- -- - Administrator : Ken Phan Websmater : www.goldengate.com.vn Listen to music is free : www.enghe.info Ajax pagination: www.goldengate.com.vn/pagination jQuery navigation: www.goldengate.com.vn/navigation MP3 Ajax Flash webplayer: www.goldengate.com.vn/mp3 Blog me: http://my.opera.com/kenphan19/blog/ --
[jQuery] Re: Dropdown menu Issue
Yeah technically that works, but the problem is the CSS does need to be reset after the animation finishes or else it cuts the menu off. I've uploaded a video to Youtube that will show what happens. Its still processing the upload but should be done soon: http://www.youtube.com/watch?v=Yll3q2O6MRI On Aug 20, 9:34 am, Leonard Martin leonard.mar...@gmail.com wrote: I think if you reverse the parameters you're passing to stop() then that should achieve what you're after. You want to clear the queue (true for first parameter) but stop the animation where it is, not go to the end (false for second paramter). On Aug 20, 3:16 pm, Xenongasman xenongas...@gmail.com wrote: Okay, so this work but I got another question... When the menu is animating down or up, if you move off it jumps to the end and starts the animation the other way, is there a way to make it just start sliding up from where it is? On Aug 13, 5:45 pm, Xenongasman xenongas...@gmail.com wrote: Actually the answer is a lot simpler than I thought and something I should have found a lot sooner. I just needed to pass in parameters to stop() as is shown below: script language=JavaScript $(function(){ $('#menu li').hover( function() { $(this).find('ul:first').css({display:none}).stop (0,1).slideDown(); }, function(){ $(this).find('ul:first').stop(0,1).slideUp(); }); }); /script On Aug 12, 3:58 pm, amuhlou amysch...@gmail.com wrote: perhaps something like unbinding the hover would work http://docs.jquery.com/Events/unbind On Aug 12, 12:29 pm, Xenongasman xenongas...@gmail.com wrote: Any ideas? On Aug 8, 2:18 pm, Xenongasman xenongas...@gmail.com wrote: Yes it does work fine, except that the animations will repeat themselves if you move on and off again quickly. So to remedy that I changed the script to: script language=JavaScript $(function(){ $('#menu li').hover( function() { $(this).find('ul:first').css({display:none}).stop().slideDown (); }, function(){ $(this).find('ul:first').stop().slideUp('slow'); }); }); /script Then try it and move over one menu then the other very quickly and you'll see what i explained. And it also adds a artifact in IE7. I suppose i could leave it as is and not use stop() but I just wanted to know if someone knew how to fix this.
[jQuery] Re: Getting form field values
You could use my Values plugin ( http://plugins.jquery.com/project/values ) and do: $(document).ready(function() { $(input[name^=day]).change(function () { var all = $('input[name^=day]').values(); for (var day in all) { if (all[day] !== null) { alert(all[day]+' was checked'); } } }); }); rather than just the value of the first matched one, this will give you all of their current values in a key-value object. On Wed, Aug 19, 2009 at 2:20 PM, blcArmadilloblackarmadi...@gmail.com wrote: I have a simple set of checkboxes: input name=day1 type=checkbox value=sun / Sun input name=day2 type=checkbox value=mon / Mon input name=day3 type=checkbox value=tue / Tue input name=day4 type=checkbox value=wed / Wed input name=day5 type=checkbox value=thu / Thu input name=day6 type=checkbox value=fri / Fri input name=day7 type=checkbox value=sat / Sat When the state of one of them changes I want to check the state of all of them. So far I have: $(document).ready(function() { $(input[name^='day']).change(function () { }); }); My question is how do I get the value of each of the check boxes? It seems like all the commands I see in the jQuery documentation only give you the value of the first matched element? Do I have to use some sort of for loop? Thanks for the help.
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
Don't you think I thought about using that straight away? How can I wrap a group of elements in the DOM when I don't know what elements will be there in first place. I'm aiming to wrap, essentially, a blog post, so: $(document).ready(function(){ $('h2').wrap('div class=scrollablePost/div'); }); // would be fine ...but try doing this: $(document).ready(function(){ $('h2bunchOfOtherElements?.../bunchOfOtherElements?div class=postmetadata/div').wrap('div class=scrollablePost/ div'); }); :| Thanks, L On Aug 20, 3:36 pm, ak732 ask...@gmail.com wrote: go to:http://api.jquery.com/and put wrap in the filter box On Aug 20, 10:06 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] unsubscribe
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
why would you be doing this with jquery anyway? ldexterldesign wrote: Don't you think I thought about using that straight away? How can I wrap a group of elements in the DOM when I don't know what elements will be there in first place. I'm aiming to wrap, essentially, a blog post, so: $(document).ready(function(){ $('h2').wrap('div class=scrollablePost/div'); }); // would be fine ...but try doing this: $(document).ready(function(){ $('h2bunchOfOtherElements?.../bunchOfOtherElements?div class=postmetadata/div').wrap('div class=scrollablePost/ div'); }); :| Thanks, L On Aug 20, 3:36 pm, ak732 ask...@gmail.com wrote: go to:http://api.jquery.com/and put wrap in the filter box On Aug 20, 10:06 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] ajaxSubmit encoding problems
Hi all, I have a little problem here with ajaxSubmit when submitting a form. The point is that any special characters like á or ç (they are from latin, portuguese) are going to the server replaced by strange characters, like ç ... I`m sure it is just an encoding problem, so how can I set encoding after ajaxSubmit? Thanks in advance, Fabricio Braga
[jQuery] Code Not Working on IE
I'm using to parse the response coming from '.aspx' page. Response comes in the form of 'text/xml', which is rendered very well in all browsers except the IE.:,( I did uploaded my code on the server but the problem exists. Can any body tell me what can be the problem how I can resolve it? Following is the JS Code: __ function GetXMLResponse(url) { var $urlToSend = url + random= + Math.floor(Math.random() * 11); $(document).ready(function() { $.ajax({ type: GET, url: search.aspx, data: $urlToSend, dataType: text/xml, success: function(xml1) { var xml; try { if (typeof xml1 == 'string') { xml = new ActiveXObject('Microsoft.XMLDOM'); xml.async = false; xml.loadXML(xml1); } } catch (e) { xml = xml1; } $(xml).find('newdataset').each(function() { if ($(this).find('datatable').length 1) { html = 'table cellspacing=0 style=table-layout: auto; width:100%; height:200px;trtd style=text-align:center; vertical-align:top; padding-top:10px;No Result Found/td/tr/table'; $('#gridBody').append($(html)); } else { $(xml).find('columns').each(function() { var html = 'table cellspacing=0 style=table-layout: auto; width:100%; height:100%;tr'; $(this).find('column').each(function(index) { if (index == 0) html += 'td style=width:90px;' + $(this).attr('displayName') + '/td'; else html += 'td' + $(this).attr('displayName') + '/td'; }); html += '/tr/html'; $('#gridHead').append($(html)); }); html = 'table cellspacing=0 style=table-layout: auto; width:100%; height:100%;'; $(this).find('datatable').each(function() { html += 'trtd style=width:80px; text-align:center; images/' + $(this).find('display_image').text() + ' /tdtd' + $(this).find('display_text').text() + '/td/tr'; }); html += '/table'; $('#gridBody').append($(html)); ; } }); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); } }); }); } __ Following the portion of xml which comes as a response: __ griddata columns rowIdColumn=display_id column name=display_image displayName=Introduction width=10% type=image alt=Summary/column column name=display_text displayName=Display Text width=90% type=text/column /columns newdataset datatable rowid1/rowid display_imagemyImage.jpg/display_image display_id1223/display_id display_textmy New Text/display_text year1998/year volumeasasf/volume pageno123/pageno /datatable recordsdatatable records_number1/records_number /recordsdatatable /newdataset /griddata __ -- View this message in context: http://www.nabble.com/Code-Not-Working-on-IE-tp25065530s27240p25065530.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: jquery license - what do my company have to do
Antoine Blanchard wrote: Hi everyone, For the latest project I have lead (which is a java web project) I have included some jquery,jqueryui and 1 or 2 jquery plugins, knowing that the MIT license allow us to use it even for commercial use. Now that the v1 is almost done. We are wondering what exactly we have to do to be legal. MIT license says: on the condition that the license is distributed with that software. what does that mean exactly? Do we need to write a line in our docu saying: use jquery,..., which is under MIT license? Do we have to write on the pages with our copyright that we use jquery with the little ©? Do we have to do something else? Thanks for the explanations. Antoine if you leave the comment on top of your js file intact, you'll be fine. -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
go to: http://api.jquery.com/ and put wrap in the filter box On Aug 20, 10:06 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] Re: Checkbox perpetually marked as checked
double == in your if statements might do the job. 2009/8/19 Nick Moy nick@gmail.com When the if else statements are removed, they are not perpetually checked. On Aug 19, 4:34 pm, labbit nick@gmail.com wrote: Hello, I'm trying to write an if else statement in javascript so that when a check box is checked, a table will appear, and when it is checked again, another box will appear. However, the checkbox is constantly marked as checked, and I do not know why. I did not set any checked attritube to false or true. What gives? function GetStoryPoints() { var ownerCheck; var creatorCheck; if (document.getElementById(ownCheck).checked = true) ownerCheck = true; else ownerCheck = false; if (document.getElementById(createCheck).checked = true) creatorCheck = true; else creatorCheck = false; if (ownerCheck creatorCheck) { $.post('/StoryPoint/ListSpecific?retrieveOwned=' + ownerCheck + 'retrieveCreated=' + creatorCheck + 'creatorID=' + $ (#UserList option:selected).attr(value), null, function(data) { $(#storyPointDetail).html(data); }, html); } else if (ownerCheck !creatorCheck) { $.post('/StoryPoint/ListSpecific?retrieveOwned=' + ownerCheck + 'retrieveCreated=' + creatorCheck + 'creatorID=' + $ (#UserList option:selected).attr(value), null, function(data) { $(#storyPointDetail).html(data); }, html); } else if (!ownerCheck creatorCheck) { $.post('/StoryPoint/ListSpecific?retrieveOwned=' + ownerCheck + 'retrieveCreated=' + creatorCheck + 'creatorID=' + $ (#UserList option:selected).attr(value), null, function(data) { $(#storyPointDetail).html(data); }, html); } }
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
I've asked myself this, but I'm in too deep now. It all goes back to a site structure stage believe it or not. I'm building a pretty unconventional layout from a client's design. I use progressive enhancement, so to go back into my PHP at this point would be a bad idea. Thanks, L On Aug 20, 5:24 pm, Liam Potter radioactiv...@gmail.com wrote: why would you be doing this with jquery anyway? ldexterldesign wrote: Don't you think I thought about using that straight away? How can I wrap a group of elements in the DOM when I don't know what elements will be there in first place. I'm aiming to wrap, essentially, a blog post, so: $(document).ready(function(){ $('h2').wrap('div class=scrollablePost/div'); }); // would be fine ...but try doing this: $(document).ready(function(){ $('h2bunchOfOtherElements?.../bunchOfOtherElements?div class=postmetadata/div').wrap('div class=scrollablePost/ div'); }); :| Thanks, L On Aug 20, 3:36 pm, ak732 ask...@gmail.com wrote: go to:http://api.jquery.com/andput wrap in the filter box On Aug 20, 10:06 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] $load- images in cache
I'm working with some large images that are in markup but being processed into queued animations. If image is already loaded but I call $load will it pull image from browser cache? I want to use the success to do some size processing
[jQuery] Re: Problem with Ajax callback function in jQuery
On Aug 20, 6:59 am, MorningZ morni...@gmail.com wrote: Does anyone know what is wrong? I've never seen an ordinary function behave this way. That's because $.post (and the resultant $.ajax) isn't ordinary, it's an asynchronous call and when you hit the line jsonData = eval('(' + data + ')'); the script isn't back from the post call yet you need to learn about callbacks to better your code to take full advantage of async behavior another tip, if you are doing a post and looking to get back JSON, then use something like: var Options = { type = POST, url = save_search.php, processData = true, data = formData, dataType = json, success = SaveSearch_Success, error = SaveSearch_Error}; $.ajax(Options); and outside all that, here are your functions outside the ajax call function SaveSearch_Success(data) { // data = your result in JSON already}; function SaveSearch_Error(x,y,z) { // x.responseText will have server side error message }; Ok, I finally got $.ajax(Options) to work, but only after some difficulties. First of all, your Options above needs to look like this (it's an object): var Options = { type : POST, url : save_search.php, processData : true, data : formData, dataType : json, success : SaveSearch_Success, error : SaveSearch_Error }; Secondly, this still produces an asynchronous call to SaveSearch_Success, so I still hit my original probelm with data1 being undefined because Javascript rushes ahead without waiting for the Ajax request to complete. Only when I added the following option to Options: async: false did I finally get good data in data1 outside of SaveSearch_Success. The above option produces a *synchronous* Ajax request where Javascript waits until the request is complete. That's okay with me because the request to save_search.php is very fast anyway. Finally, this code snippet results in no arguments being sent to save_search.php: + var formData; var Options = { type : POST, url : saved_search.php, processData : true, data : formData, dataType : json, success : SaveSearch_Success, error : SaveSearch_Error, async: false }; formData = $('#form1').serialize(); $.ajax(Options); + You have to define the Options object *after* putting the arguments into formData like this: + var formData = $('#form1').serialize(); var Options = { type : POST, url : saved_search.php, processData : true, data : formData, dataType : json, success : SaveSearch_Success, error : SaveSearch_Error, async: false }; $.ajax(Options); + Javascript is just *so* cool! But thanks for your help. I can continue on and get something productive done now.
[jQuery] Re: jQuery internals and exception handling
Uh - what I meant was that what I posted *above* (not below) was stupid. The irony is killing me.
[jQuery] Re: Simple Plugin for jQuery
instead, it must to be something like $.makemailto({opts}) read this http://snook.ca/archives/javascript/jquery_plugin/ - Original Message - From: ElJayWilson eljaywil...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Sent: Wednesday, August 19, 2009 1:54 PM Subject: [jQuery] Simple Plugin for jQuery I am trying to get a handle on creating a jQuery plugin. I have a function that I wrote a couple of years ago that returns a formatted email address. I want to turn that function into a jQuery plugin. Here is my function: [code] function makemailto(email,subject,text) { // Makes a nice mailto link var returnval; returnval = 'a href=mailto:' + email + '?' + email + '/a'; if (subject text) { returnval = 'a href=mailto:' + email + '?subject=' + subject + '' + text + '/a'; } else if (subject) { returnval = 'a href=mailto:' + email + '?subject=' + subject + '' + email + '/a'; } else if (text) { returnval = 'a href=mailto:' + email + '?' + text + '/a'; } return(returnval); } [/code] I cannot seem to figure out how to create a simple plugin that I can call like this: $.makemailto('some...@somewhere.com','Subject Here'); Any advice? Thanks, LJ Wilson
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
lewis, First, use pastebin.com or something like next time, it'll help us help you. So, you need to wrap each group of h2 + div + p + p.postmetadata Check out http://snipplr.com/view/4746/jquery--nextuntil/ and you should be able to do something like: $('h2').nextUntil('.scrollablePost').wrap('div') If that does not work, maybe $('h2') .each(function(){ $(this).nextUntil('.scrollablePost').wrap('div') }); If that still does now work, can you post your code to pastebin so I have something work with? On Aug 20, 10:55 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Don't you think I thought about using that straight away? How can I wrap a group of elements in the DOM when I don't know what elements will be there in first place. I'm aiming to wrap, essentially, a blog post, so: $(document).ready(function(){ $('h2').wrap('div class=scrollablePost/div'); }); // would be fine ...but try doing this: $(document).ready(function(){ $('h2bunchOfOtherElements?.../bunchOfOtherElements?div class=postmetadata/div').wrap('div class=scrollablePost/ div'); }); :| Thanks, L On Aug 20, 3:36 pm, ak732 ask...@gmail.com wrote: go to:http://api.jquery.com/andput wrap in the filter box On Aug 20, 10:06 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] Re: Problem with Ajax callback function in jQuery
Just be aware that doing the ajax call synchronously will block (lock up) the browser until the request/response completes. This is typically okay when running locally, but can be very noticeable when running on slower connections (e.g. shared hosting). There's no reason why you cannot do this asynchronously. You just need to handle the dom updating inside (or in a sub-function of) the success handler function. On Aug 20, 1:13 pm, dkomo872 dkomo...@comcast.net wrote: On Aug 20, 6:59 am, MorningZ morni...@gmail.com wrote: Does anyone know what is wrong? I've never seen an ordinary function behave this way. That's because $.post (and the resultant $.ajax) isn't ordinary, it's an asynchronous call and when you hit the line jsonData = eval('(' + data + ')'); the script isn't back from the post call yet you need to learn about callbacks to better your code to take full advantage of async behavior another tip, if you are doing a post and looking to get back JSON, then use something like: var Options = { type = POST, url = save_search.php, processData = true, data = formData, dataType = json, success = SaveSearch_Success, error = SaveSearch_Error}; $.ajax(Options); and outside all that, here are your functions outside the ajax call function SaveSearch_Success(data) { // data = your result in JSON already}; function SaveSearch_Error(x,y,z) { // x.responseText will have server side error message }; Ok, I finally got $.ajax(Options) to work, but only after some difficulties. First of all, your Options above needs to look like this (it's an object): var Options = { type : POST, url : save_search.php, processData : true, data : formData, dataType : json, success : SaveSearch_Success, error : SaveSearch_Error }; Secondly, this still produces an asynchronous call to SaveSearch_Success, so I still hit my original probelm with data1 being undefined because Javascript rushes ahead without waiting for the Ajax request to complete. Only when I added the following option to Options: async: false did I finally get good data in data1 outside of SaveSearch_Success. The above option produces a *synchronous* Ajax request where Javascript waits until the request is complete. That's okay with me because the request to save_search.php is very fast anyway. Finally, this code snippet results in no arguments being sent to save_search.php: + var formData; var Options = { type : POST, url : saved_search.php, processData : true, data : formData, dataType : json, success : SaveSearch_Success, error : SaveSearch_Error, async: false }; formData = $('#form1').serialize(); $.ajax(Options); + You have to define the Options object *after* putting the arguments into formData like this: + var formData = $('#form1').serialize(); var Options = { type : POST, url : saved_search.php, processData : true, data : formData, dataType : json, success : SaveSearch_Success, error : SaveSearch_Error, async: false }; $.ajax(Options); + Javascript is just *so* cool! But thanks for your help. I can continue on and get something productive done now.
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
I didn't understand from your original post that you wanted to wrap a series of elements where the series was of indeterminate length. From what you posted in reply, it looks like Benjamin's answer will work, although if I understand correctly, .postmetadata is the marker class marking the final element to be wrapped and you want the div you wrap it with to be of class .scrollablePost. So maybe... $(h2).nextUntil(.postmetadata).wrap(div class=''scrollablePost); Except that at a quick glance, I don't think nextUntil includes the matching element - but if not, it should be easy enough to modify so it does. On Aug 20, 10:55 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Don't you think I thought about using that straight away? How can I wrap a group of elements in the DOM when I don't know what elements will be there in first place. I'm aiming to wrap, essentially, a blog post, so: $(document).ready(function(){ $('h2').wrap('div class=scrollablePost/div'); }); // would be fine ...but try doing this: $(document).ready(function(){ $('h2bunchOfOtherElements?.../bunchOfOtherElements?div class=postmetadata/div').wrap('div class=scrollablePost/ div'); }); :| Thanks, L On Aug 20, 3:36 pm, ak732 ask...@gmail.com wrote: go to:http://api.jquery.com/andput wrap in the filter box On Aug 20, 10:06 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] Re: $load- images in cache
found better method using combination of image load plugin http://letmehaveblog.blogspot.com/2006/08/simple-jquery-plugin-to-load-images.html and natve onload handlers to get first few images started Charlie wrote: I'm working with some large images that are in markup but being processed into queued animations. If image is already loaded but I call $load will it pull image from browser cache? I want to use the success to do some size processing
[jQuery] Re: Getting form field values
I'm assuming you want the current value of the checked checboxes. Just use .serialize() var inputs = $(input[name^='day']).change(function () { console.log(inputs.serialize()); }); the output of serialize() is a query string, just split on '' for an array of key=value that you can then process further as desired: var inputs = $(input[name^='day']).change(function () { $.each(inputs.serialize().split(''),function(i,d){ d = d.split('='); d[0]; //the key. eg day2 d[1]; //the value eg mon }); }); On Aug 20, 7:34 am, Nathan Bubna nbu...@gmail.com wrote: You could use my Values plugin (http://plugins.jquery.com/project/values) and do: $(document).ready(function() { $(input[name^=day]).change(function () { var all = $('input[name^=day]').values(); for (var day in all) { if (all[day] !== null) { alert(all[day]+' was checked'); } } }); }); rather than just the value of the first matched one, this will give you all of their current values in a key-value object. On Wed, Aug 19, 2009 at 2:20 PM, blcArmadilloblackarmadi...@gmail.com wrote: I have a simple set of checkboxes: input name=day1 type=checkbox value=sun / Sun input name=day2 type=checkbox value=mon / Mon input name=day3 type=checkbox value=tue / Tue input name=day4 type=checkbox value=wed / Wed input name=day5 type=checkbox value=thu / Thu input name=day6 type=checkbox value=fri / Fri input name=day7 type=checkbox value=sat / Sat When the state of one of them changes I want to check the state of all of them. So far I have: $(document).ready(function() { $(input[name^='day']).change(function () { }); }); My question is how do I get the value of each of the check boxes? It seems like all the commands I see in the jQuery documentation only give you the value of the first matched element? Do I have to use some sort of for loop? Thanks for the help.
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
Cheers for your help Ben. I'll crack on with this in the morning and update this post with how I get on. Thanks, L On Aug 20, 4:50 pm, Benjamin Sterling benjamin.sterl...@kenzomedia.com wrote: lewis, First, use pastebin.com or something like next time, it'll help us help you. So, you need to wrap each group of h2 + div + p + p.postmetadata Check outhttp://snipplr.com/view/4746/jquery--nextuntil/ and you should be able to do something like: $('h2').nextUntil('.scrollablePost').wrap('div') If that does not work, maybe $('h2') .each(function(){ $(this).nextUntil('.scrollablePost').wrap('div') }); If that still does now work, can you post your code to pastebin so I have something work with? On Aug 20, 10:55 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Don't you think I thought about using that straight away? How can I wrap a group of elements in the DOM when I don't know what elements will be there in first place. I'm aiming to wrap, essentially, a blog post, so: $(document).ready(function(){ $('h2').wrap('div class=scrollablePost/div'); }); // would be fine ...but try doing this: $(document).ready(function(){ $('h2bunchOfOtherElements?.../bunchOfOtherElements?div class=postmetadata/div').wrap('div class=scrollablePost/ div'); }); :| Thanks, L On Aug 20, 3:36 pm, ak732 ask...@gmail.com wrote: go to:http://api.jquery.com/andputwrap; in the filter box On Aug 20, 10:06 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] Re: 'Wrapping' some (not just 1 pair) HTML elements in a div?
http://is.gd/2qubA basically I need to do this client-side. I've taken your advice (I normally pseudo the JS I need in HTML/PHP beforehand anyway (I'll admit I'm not as good with jQuery as some of you on here)), but on this occasion I'm working with a post loop. It's not gonna be worth my time to go hacking at that if I can solve it client-side with some jQuery. I hope you get my drift. Thanks, L On Aug 20, 5:24 pm, Liam Potter radioactiv...@gmail.com wrote: why would you be doing this with jquery anyway? ldexterldesign wrote: Don't you think I thought about using that straight away? How can I wrap a group of elements in the DOM when I don't know what elements will be there in first place. I'm aiming to wrap, essentially, a blog post, so: $(document).ready(function(){ $('h2').wrap('div class=scrollablePost/div'); }); // would be fine ...but try doing this: $(document).ready(function(){ $('h2bunchOfOtherElements?.../bunchOfOtherElements?div class=postmetadata/div').wrap('div class=scrollablePost/ div'); }); :| Thanks, L On Aug 20, 3:36 pm, ak732 ask...@gmail.com wrote: go to:http://api.jquery.com/andput wrap in the filter box On Aug 20, 10:06 am, ldexterldesign m...@ldexterldesign.co.uk wrote: Yo guys, I need to wrap this chuck of HTML in a div:http://is.gd/2qatX Any thoughts? $(document).ready(function(){ $('div class=scrollablePost').insertBefore('.page-id-9 h2'); $('/div').insertAfter('.page-id-9 .postmetadata'); }); ...just pumps out div class=scrollablePost / at both ends, as you'll see from the above screenshot. Thanks, L
[jQuery] Re: jQuery internals and exception handling
I now see that jQuery has an error event handler. So a lot of what I posted below is, well, just stupid. However in some quick testing, there appear to be some problems with the error event. It's not working the same way for IE7 and FF3.5x. Some differences: The jQuery docs indicate that the error handler will be passed: the error msg, url and line. This does happen in IE7, but isn't happening in FF3.5x. in FF, the handler is being passed the event object. Also, in FF3.5x, some, if not all, the exceptions thrown inside of other event handlers are not getting caught and passed on to the $ (window).error handler. This seems to comport with the known FF/ mozilla bug as reported here: https://bugzilla.mozilla.org/show_bug.cgi?id=312448 Looking at the jQuery code (1.3.2), it seems like error is simply being treated like any other event. Which seems is insufficient, at least based on my limited testing so far.
[jQuery] Re: jQuery internals and exception handling
On Aug 19, 11:04 pm, ak732 ask...@gmail.com wrote: ofn.apply(this, arguments); Be aware that the arguments object is-not-a Array (it's an object with a length property), and i don't think there's a guaranty that that apply() will handle that special case. Also be aware that apply takes a list of args, like foo.apply(this,arg1,arg2,arg3), whereas call () takes the args as a single array: foo.call(this,[arg1,arg2,arg3]). i suspect that's what you actually want here. The normal workaround for converting 'arguments' to an array looks something like: var av = Array.prototype.slice.apply(arguments,[0]); myfunc.apply( this, av ); sense? It could do what it does for other areas of Javascript which is mitigate the browser differences. To be complete, it would need to employ onerror, add a try-catch block to document.ready(), and do something similar to the above for event handlers (only in mozilla). Thoughts? Is this just stupid? While i agree with the last bit that it might help improve the overall quality of jQuery client apps, my suspicions are that: a) Many people will bitch and moan about a perceived performance penalty for using try/catch (i know C++ people often bitch about it). b) Your solution seems like such an easy thing to do, that the jQuery devs would be justified in saying, just do what you just demonstrated. That said, having a public jQuery API which swaps out .bind() with an impl like yours might be a good idea. In any case, i will certainly give this a try in a jQuery-based application framework i'm working on. :)
[jQuery] How to create XML
Hi All I need to create XML, for example, this is (simplified) what I have to do: var x = jQuery.makeXML('myXMLversion8.1/version/myXML) ; // this line is my problem!! console.log(Version = %s, $('version', x).text() ) ; Is this possible and what is the best way to do this ? cheers
[jQuery] Re: jQuery internals and exception handling
On Aug 20, 9:17 pm, Stephan Beal sgb...@googlemail.com wrote: that apply() will handle that special case. Also be aware that apply takes a list of args, like foo.apply(this,arg1,arg2,arg3), whereas call () takes the args as a single array: foo.call(this,[arg1,arg2,arg3]). Sorry, that's exactly backwards: apply() takes an array and call() takes a list. See: http://devlicio.us/blogs/sergio_pereira/archive/2009/02/09/javascript-5-ways-to-call-a-function.aspx
[jQuery] Re: setData and extraParams problem
What exact version of the autocomplete plugin are you using? Have you tried autocomplete(option, extraParams, ...) instead of setData? Jörn On Sat, Aug 8, 2009 at 6:19 PM, pankajpankaj1...@gmail.com wrote: Actually this part was working previously.I found one difference here, maybe that help us to find out the actual root cause. Please let me know if any of you are aware of this issue. Here is OLD and NEW difference of calling auto-completion. = OLD: // Pass along field dependency values to filter auto-completion list. $textbox.focus(function() { var fieldname = this.id; $(this).flushCache(); params = { fname:fieldname }; $(this).setOptions({ extraParams:add_deps(autocomplete_drilldowns, fieldname, params) }); }); NEW: // Pass along field dependency values to filter auto-completion list. $textbox.focus(function() { var fieldname = this.id.replace(/([{}])/g, '\\$1'); $(this).autocomplete('flushCache'); params = { fname:fieldname }; $(this).autocomplete('setData', { extraParams:add_deps (autocomplete_drilldowns, fieldname, params) }); }); === Is this causing any issue? Thanks On Aug 8, 2:19 pm, pankaj pankaj1...@gmail.com wrote: Hi All, When I do focus is on the autocompletion textbox, that triggers the function right below where the autocompletion plugin is initialized , which is supposed to add the key=value values to form the remote url. Based on this remote url I am getting the filtered output, which will list out in the autocompletion textbox but its not adding key=value. So I am getting all the list. I think the setData is not setting the extraParams. help? For example: If i select one field in the Html form say product xyz and based on this the release field should 3 values 1.1 | 1.2 | 1.3, but it displays all the list (almost 300 values). Its because when i select something in the autocompletion textbox then the url format should be something like this: http://mdx.lt.com/xyz/abc/ac-list?q=1.limit=300timestamp=1249677100...{1}product=mmm Instead of the above it is formating as. Here product field is missing, due to which it displays all the release value. http://mdx.lt.com/xyz/abc/ac-list?q=1.limit=300timestamp=1249677100...{1}. This is my autocomplete call: $field.autocomplete({ url:ac_url, cacheLength:1, matchContains:true, max:300, width:'50%', scrollHeight:320, minChars:1, extraParams:{ fname:fieldname }, formatItem: function(data, i, max, value, term) { // data will be an array of value, description return 'span class=ui-autocomplete-value' + value + '/spanspan class=ui-autocomplete-info' + data[1] + '/ span'; } }); $field.autocomplete('result', function() { $field.change(); // Notify mass edit that the field's value has changed. $field.blur(); // Trigger auto-set. }); }); // Pass along field dependency values to filter auto-completion list. $textbox.focus(function() { var fieldname = this.id.replace(/([{}])/g, '\\$1'); $(this).autocomplete('flushCache'); params = { fname:fieldname }; $(this).autocomplete('setData', { extraParams:add_deps (autocomplete_drilldowns, fieldname, params) }); }); What is the right way to see what the above function (add_deps) is returning? Any help will be greatly appreciated. Thanks,
[jQuery] Re: jquery license - what do my company have to do
On Aug 20, 3:51 pm, Antoine Blanchard antoine...@gmail.com wrote: Do we need to write a line in our docu saying: use jquery,..., which is under MIT license? The MIT license is explained very briefly and clearly at: http://en.wikipedia.org/wiki/MIT_License You don't need to do anything special except accept the fact that you needn't do anything special. That is in stark contrast to the GPL license, which can optionally be used with jQuery. The documentation clause is from the BSD family of licenses and is quite interesting, because if you simply redistribute the original source files you are already complying with it by including those source files in the documentation and/or other materials provided with the distribution. As long as the source file IS part of the distribution, you don't need to add it to your docs or About dialog because of the and/OR part.
[jQuery] jquery menu that works with ie6 (plugin?)
Can anyone recommend a jquery menu plug that works with ie6? I have a menu done with uls and lis with pure css. It doesn't work with ie6 (because it's pure css.) I went through the list of jquery plugins, but most of them are fancy (as in iPod like menu and what have you...) I only need a simple straight-forward horizontal menu with vertical sub-level menus (multi level deep) all activated with a mouseover event (I suppose, I can control the event with which the menu is triggered.) At any rate, I just did not want to keep downloading, learning and trying different plugins; I just want to save time on this. Any help is appreciated. jake
[jQuery] Re: [autocomplete] how to clear hidden key field when user changes text value?
You could try this, similar to what the plugin does for the mustMatch option: $(.autocomplete).blur(function() { $(this).search(function(result) { if (!result) { // no match found, do something, eg. clearing other fields } }); }); Jörn On Thu, Aug 13, 2009 at 5:25 PM, Billybilly.swee...@gmail.com wrote: Hi all, I'm using autocomplete plugin, when the user types something the backend responds value and key information (for instance: John|76178 Mike|87252 Peter|87511 Using .result I'm setting the key in a hidden field in my form. $('#autocompleteTextboxId').result(function(event, data, formatted) { if (data) $('#autocompleteHiddenValueId').val(data[1]); }); But what if the user changes his mind and after choosing John types something else in the textbox (without actually chosing a new option from the autocomplete options) or even deletes the whole text? As things are now, the data previously set in the hidden field remains there. So the user might post the form thinking that his selection is blank, but the system actually thinks that he selected 76178. Is there a way to clear the hidden field when the user types something? I tried by setting some action to focus so that whenever the user focuses on the textbox the hidden value is cleared but it seems that after the user chooses a value in the autocomplete options, the plugin sets focus to the text field (hence making this action execute, thus clearing the hidden value everytime). $('#autocompleteTextboxId').focus(function() { $('#autocompleteHiddenValueId').val(''); }); It would be cool if we had something like .textChanged (similar to .result above) where we can do some action when the user changes the text on the field. Maybe some of the JS wizards here can suggest something. Thanks.
[jQuery] Re: [autocomplete] trigger event if user rejects all autocomplete otions
You could try this, similar to what the plugin does for the mustMatch option: $(.autocomplete).blur(function() { $(this).search(function(result) { if (!result) { // no match found, do something, eg. clearing other fields } }); }); Jörn On Tue, Aug 11, 2009 at 8:30 PM, Ashash.sea...@gmail.com wrote: Does anyone have a library or patch to call a handler if a user leaves an autocomplete field without choosing one of the autocomplete options - i.e. they've entered free text. I'm working with an app that populates multiple fields from a single auto-complete value, and our latest requirement is to clear out a bunch of fields if the user's entered something manually - rejecting autocomplete suggestions. My initial attempts at hooking into onkeyfoo and onblur haven't lead anywhere productive, and I'm hoping someone else has managed to overcome the gnarly event and timing dependencies involved with onkeyfoo and blur being used for standard autocomplete behaviour. Note: I'm working with http://plugins.jquery.com/project/autocompletex - but I'm happy to switch libraries and/or port functionality and patches over from another solution.
[jQuery] event handlers that run after the browser's default action
is there a way to set up a page so that a event handler function is bound to a DOM object and event but it runs _after_ the browser's default action is complete?
[jQuery] hide divs with float:left and show them again
Hi I have a site with a lot of small div-boxes (with images and movies within them) they are positioned with CSS and float:left. i created buttons, which show and hide either all images or all movies this works well. but when i switch between these options, the float-position of the divs goes crazy and every div-container is on one line for itself (instead of 5 on one line) does someone have an idea, how i can solve this problem? simon
[jQuery] slideToggle - form elements (checkbox) show before the animation IE6 and IE7
Hello all, Wondering if anyone has come across this issue I'm having with slideToggle and form elements on the show/hide content - all in IE6 and IE7. IE8 seems to be OK. I am using slideToggle to show/hide some form elements, checkboxes in my case. When the slideToggle is triggered, the checkboxes are immediately rendered, then the slideUp/Down animation occurs. Has anyone encountered this problem and is there a solution?
[jQuery] jQuery ready() not firing when page anchor in URL changes
It looks like jQuery's ready() function doesn't fire when the Back button is used if only the page anchor location in the URL changes. Example: Say you go to here http://mywebsite.com/#test1 then here http://mywebsite.com/#test2 and then use the Back button to go back to here http://mywebsite.com/#test1 and you have this code in the page script language=javascript type=text/javascript src=/ jquery.js/script script language=javascript type=text/javascript history.navigationMode = 'compatible'; $(document).ready( function() { if(document.location.hash){ var hashQueryString = document.location.hash; hashQueryString = hashQueryString.replace(#,); alert(hashQueryString); } }); You don't get the alert pop up when you use the Back button to go back to the #test2 URL. The ready() function fires when the Back button is used if the query string (i.e, php?var1=value1) changes but not for hash marks. Is this on purpose or is this a bug? And does anyone know a workaround? I'm trying to develop a way to get the Back button to go back to previous states of a page that were created by JavaScript/AJAX manipulations. Thanks!
[jQuery] Re: Problem with Ajax callback function in jQuery
On Aug 20, 11:53 am, ak732 ask...@gmail.com wrote: Just be aware that doing the ajax call synchronously will block (lock up) the browser until the request/response completes. This is typically okay when running locally, but can be very noticeable when running on slower connections (e.g. shared hosting). There's no reason why you cannot do this asynchronously. You just need to handle the dom updating inside (or in a sub-function of) the success handler function. Ok, I finally got the following function call working from inside the callback function: function foobar(jsonData) { alert(status = + jsonData.return_status); } function SaveSearch_Success(jsonData) { // data = your result in JSON already foobar(jsonData); } and this was with async: true set in the Options object. One of the problems I was having yesterday was that I kept getting an undefined function error every time I tried a function call inside the callback function using jQuery's $.post(). That's why I wanted to stick the Ajax request JSON return data into a global variable. I wanted to write code that would use it outside the callback. Now the undefined function error seems to have gone away. I have to write probably at least 100 lines of code to do DOM updating, and I didn't want to be stuck inside the callback function. Being able to call multiple functions from within the callback is exactly the right solution, and I can still keep Ajax requests asynchronous. On Aug 20, 1:13 pm, dkomo872 dkomo...@comcast.net wrote: On Aug 20, 6:59 am, MorningZ morni...@gmail.com wrote: Does anyone know what is wrong? I've never seen an ordinary function behave this way. That's because $.post (and the resultant $.ajax) isn't ordinary, it's an asynchronous call and when you hit the line jsonData = eval('(' + data + ')'); the script isn't back from the post call yet you need to learn about callbacks to better your code to take full advantage of async behavior another tip, if you are doing a post and looking to get back JSON, then use something like: var Options = { type = POST, url = save_search.php, processData = true, data = formData, dataType = json, success = SaveSearch_Success, error = SaveSearch_Error}; $.ajax(Options); and outside all that, here are your functions outside the ajax call function SaveSearch_Success(data) { // data = your result in JSON already}; function SaveSearch_Error(x,y,z) { // x.responseText will have server side error message }; Ok, I finally got $.ajax(Options) to work, but only after some difficulties. First of all, your Options above needs to look like this (it's an object): var Options = { type : POST, url : save_search.php, processData : true, data : formData, dataType : json, success : SaveSearch_Success, error : SaveSearch_Error }; Secondly, this still produces an asynchronous call to SaveSearch_Success, so I still hit my original probelm with data1 being undefined because Javascript rushes ahead without waiting for the Ajax request to complete. Only when I added the following option to Options: async: false did I finally get good data in data1 outside of SaveSearch_Success. The above option produces a *synchronous* Ajax request where Javascript waits until the request is complete. That's okay with me because the request to save_search.php is very fast anyway. Finally, this code snippet results in no arguments being sent to save_search.php: + var formData; var Options = { type : POST, url : saved_search.php, processData : true, data : formData, dataType : json, success : SaveSearch_Success, error : SaveSearch_Error, async: false }; formData = $('#form1').serialize(); $.ajax(Options); + You have to define the Options object *after* putting the arguments into formData like this: + var formData = $('#form1').serialize(); var Options = { type : POST, url : saved_search.php, processData : true, data : formData, dataType : json, success : SaveSearch_Success, error : SaveSearch_Error, async: false }; $.ajax(Options); + Javascript is just *so* cool! But thanks for your help. I can continue on and get something productive done now.