Re: [jQuery] FOUND THE SOLUTION FOR ROUNDIES FOR IE8 !!!!!!
SPECTACULAR NEWS! So, um ... don't keep us in suspense. On Sun, Feb 21, 2010 at 2:45 PM, Erik eriks...@mac.com wrote: For months I couldn't figure this out and I found the answer dd_roundies can now work with IE8!!! Erik
Re: [jQuery] DD_roundies
Anchors are inline elements. Try giving it display: block (or inline-block). On Thu, Feb 4, 2010 at 7:12 PM, Erik eriks...@mac.com wrote: Hello everyone... I'm using DD_roundies for IE round corners and it works great. BUT, I cant seen to figure out how to make the following work: a class=a2 href=test.htm/a .a2 {width: 100px; height: 100px; background-image: src=/img/a2.png no repeat; float:left; border:1px; border-color:#000;} .a2:hover {background-position: -100px;} DD_roundies.addRule('.a2', 6px');
[jQuery] 1.4.1 bug? jwysiwyg uncaught exception
jquery-1.4.1 Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100106 Ubuntu/9.10 (karmic) Firefox/3.5.7 Using Scott Storborg's fork of jwysiwyg [1], when loading a form through $.ajax() the editor area cannot get focus. If I open the source pane and type in there, once I then close the pane, the text will appear inside the editor. However, I cannot do anything with the text. It seems that all keydown events are ignored. The script that is returned by the AJAX call is: $(function() {$('#CommentBody').wysiwyg({ controls: { // lots of key: val pairs ... } }); If I click on one of the buttons, I get the following error: uncaught exception: [Exception... Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand] nsresult: 0x80004005 (NS_ERROR_FAILURE) location: JS frame :: http://mi_mtl.apollo/js/lib/jquery.wysiwyg.storborg.js :: anonymous :: line 595 data: no] anonymous(form#CommentAddForm add, handle, Object name=data)jquery-1.4.1.js (line 1020) anonymous(form#CommentAddForm add, submit, function(), Object name=data)jquery-1.4.1.js (line 1572) anonymous()jquery-1.4.1.js (line 2331) anonymous([form#CommentAddForm add selector=form context=document], function(), Object name=args)jquery-1.4.1.js (line 572) anonymous(function(), Object name=args)jquery-1.4.1.js (line 240) anonymous(submit, Object name=data, function())jquery-1.4.1.js (line 2330) anonymous(function())jquery-1.4.1.js (line 2495) anonymous(textarea#CommentBody, Object)jquery.w...orborg.js (line 428) Wysiwyg(textarea#CommentBody, Object)jquery.w...orborg.js (line 110) Wysiwyg(textarea#CommentBody, Object)jquery.w...orborg.js (line 111) anonymous()jquery.w...orborg.js (line 103) anonymous([textarea#CommentBody length=1 0=textarea#CommentBody context=document], function(), Object name=args)jquery-1.4.1.js (line 572) anonymous(function(), Object name=args)jquery-1.4.1.js (line 240) anonymous(Object)jquery.w...orborg.js (line 101) anonymous()language:en (line 41) anonymous(function())jquery-1.4.1.js (line 250) anonymous(function(), Object name=context)jquery-1.4.1.js (line 160) anonymous(function(), Object name=context) If I add some text through the source pane, select it, and then click the bold button, I get this: uncaught exception: [Exception... Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand] nsresult: 0x80004005 (NS_ERROR_FAILURE) location: JS frame :: http://mi_mtl.apollo/js/lib/jquery.wysiwyg.storborg.js :: anonymous :: line 595 data: no] anonymous(html, handle, Object name=data)jquery-1.4.1.js (line 1020) anonymous(Object type=focus timeStamp=1264904061090, [Object type=focus timeStamp=1264904061090 0=Object], html)jquery-1.4.1.js (line 1805) anonymous(Object type=focus timeStamp=1264904061090, [Object type=focus timeStamp=1264904061090 0=Object], body)jquery-1.4.1.js (line 1824) anonymous()jquery-1.4.1.js (line 2352) anonymous([body 0=body context=body length=1 jquery=1.4.1], function(), Object name=args)jquery-1.4.1.js (line 572) anonymous(function(), Object name=args)jquery-1.4.1.js (line 240) anonymous(focus, Object name=data)jquery-1.4.1.js (line 2351) anonymous(Object name=fn)jquery-1.4.1.js (line 2495) anonymous()jquery.w...orborg.js (line 491) anonymous(Object originalEvent=Event focus type=focus)jquery-1.4.1.js (line 1884) anonymous()jquery-1.4.1.js (line 1579) When I load the editor in a plain page (no AJAX) all is good. I suspect this may be a jQuery bug with the way it runs script returned by ajax(). Can anyone shed some light? Starting in safe mode gave the same error. It works fine in Opera, btw. [1] http://github.com/storborg/jwysiwyg
[jQuery] Re: 1.4.1 bug? jwysiwyg uncaught exception
A little update to this. I tried a different approach, hiding the form at the bottom of the page and appending it below a particular comment when a reply button is clicked. It seems that even just using append() will cause the same misbaheviour. That is, if I do not hide the form on page load, it is entirely accessible. But, if it is moved--detached and reinserted into the DOM--I cannot gain focus and clicking any of the editor's buttons will cause the the error. $('button.CommentReply').click(function(event) { var path = $(this).attr('rel') // some stuff here left out for clarity $(this).parent('.CommentMeta') .append($('#comment_form')) .hide() .slideDown('slow'); }); On Sat, Jan 30, 2010 at 9:53 PM, brian zijn.digi...@gmail.com wrote: jquery-1.4.1 Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100106 Ubuntu/9.10 (karmic) Firefox/3.5.7 Using Scott Storborg's fork of jwysiwyg [1], when loading a form through $.ajax() the editor area cannot get focus. If I open the source pane and type in there, once I then close the pane, the text will appear inside the editor. However, I cannot do anything with the text. It seems that all keydown events are ignored. The script that is returned by the AJAX call is: $(function() {$('#CommentBody').wysiwyg({ controls: { // lots of key: val pairs ... } }); If I click on one of the buttons, I get the following error: uncaught exception: [Exception... Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand] nsresult: 0x80004005 (NS_ERROR_FAILURE) location: JS frame :: http://mi_mtl.apollo/js/lib/jquery.wysiwyg.storborg.js :: anonymous :: line 595 data: no] anonymous(form#CommentAddForm add, handle, Object name=data)jquery-1.4.1.js (line 1020) anonymous(form#CommentAddForm add, submit, function(), Object name=data)jquery-1.4.1.js (line 1572) anonymous()jquery-1.4.1.js (line 2331) anonymous([form#CommentAddForm add selector=form context=document], function(), Object name=args)jquery-1.4.1.js (line 572) anonymous(function(), Object name=args)jquery-1.4.1.js (line 240) anonymous(submit, Object name=data, function())jquery-1.4.1.js (line 2330) anonymous(function())jquery-1.4.1.js (line 2495) anonymous(textarea#CommentBody, Object)jquery.w...orborg.js (line 428) Wysiwyg(textarea#CommentBody, Object)jquery.w...orborg.js (line 110) Wysiwyg(textarea#CommentBody, Object)jquery.w...orborg.js (line 111) anonymous()jquery.w...orborg.js (line 103) anonymous([textarea#CommentBody length=1 0=textarea#CommentBody context=document], function(), Object name=args)jquery-1.4.1.js (line 572) anonymous(function(), Object name=args)jquery-1.4.1.js (line 240) anonymous(Object)jquery.w...orborg.js (line 101) anonymous()language:en (line 41) anonymous(function())jquery-1.4.1.js (line 250) anonymous(function(), Object name=context)jquery-1.4.1.js (line 160) anonymous(function(), Object name=context) If I add some text through the source pane, select it, and then click the bold button, I get this: uncaught exception: [Exception... Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand] nsresult: 0x80004005 (NS_ERROR_FAILURE) location: JS frame :: http://mi_mtl.apollo/js/lib/jquery.wysiwyg.storborg.js :: anonymous :: line 595 data: no] anonymous(html, handle, Object name=data)jquery-1.4.1.js (line 1020) anonymous(Object type=focus timeStamp=1264904061090, [Object type=focus timeStamp=1264904061090 0=Object], html)jquery-1.4.1.js (line 1805) anonymous(Object type=focus timeStamp=1264904061090, [Object type=focus timeStamp=1264904061090 0=Object], body)jquery-1.4.1.js (line 1824) anonymous()jquery-1.4.1.js (line 2352) anonymous([body 0=body context=body length=1 jquery=1.4.1], function(), Object name=args)jquery-1.4.1.js (line 572) anonymous(function(), Object name=args)jquery-1.4.1.js (line 240) anonymous(focus, Object name=data)jquery-1.4.1.js (line 2351) anonymous(Object name=fn)jquery-1.4.1.js (line 2495) anonymous()jquery.w...orborg.js (line 491) anonymous(Object originalEvent=Event focus type=focus)jquery-1.4.1.js (line 1884) anonymous()jquery-1.4.1.js (line 1579) When I load the editor in a plain page (no AJAX) all is good. I suspect this may be a jQuery bug with the way it runs script returned by ajax(). Can anyone shed some light? Starting in safe mode gave the same error. It works fine in Opera, btw. [1] http://github.com/storborg/jwysiwyg
[jQuery] Re: 1.4.1 bug? jwysiwyg uncaught exception
My apologies. I meant to also say that I tried it using jquery-1.3.2 with the same bad result. So I have no clue where the trouble lies. On Sat, Jan 30, 2010 at 11:04 PM, brian zijn.digi...@gmail.com wrote: A little update to this. I tried a different approach, hiding the form at the bottom of the page and appending it below a particular comment when a reply button is clicked. It seems that even just using append() will cause the same misbaheviour. That is, if I do not hide the form on page load, it is entirely accessible. But, if it is moved--detached and reinserted into the DOM--I cannot gain focus and clicking any of the editor's buttons will cause the the error. $('button.CommentReply').click(function(event) { var path = $(this).attr('rel') // some stuff here left out for clarity $(this).parent('.CommentMeta') .append($('#comment_form')) .hide() .slideDown('slow'); }); On Sat, Jan 30, 2010 at 9:53 PM, brian zijn.digi...@gmail.com wrote: jquery-1.4.1 Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100106 Ubuntu/9.10 (karmic) Firefox/3.5.7 Using Scott Storborg's fork of jwysiwyg [1], when loading a form through $.ajax() the editor area cannot get focus. If I open the source pane and type in there, once I then close the pane, the text will appear inside the editor. However, I cannot do anything with the text. It seems that all keydown events are ignored. The script that is returned by the AJAX call is: $(function() {$('#CommentBody').wysiwyg({ controls: { // lots of key: val pairs ... } }); If I click on one of the buttons, I get the following error: uncaught exception: [Exception... Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand] nsresult: 0x80004005 (NS_ERROR_FAILURE) location: JS frame :: http://mi_mtl.apollo/js/lib/jquery.wysiwyg.storborg.js :: anonymous :: line 595 data: no] anonymous(form#CommentAddForm add, handle, Object name=data)jquery-1.4.1.js (line 1020) anonymous(form#CommentAddForm add, submit, function(), Object name=data)jquery-1.4.1.js (line 1572) anonymous()jquery-1.4.1.js (line 2331) anonymous([form#CommentAddForm add selector=form context=document], function(), Object name=args)jquery-1.4.1.js (line 572) anonymous(function(), Object name=args)jquery-1.4.1.js (line 240) anonymous(submit, Object name=data, function())jquery-1.4.1.js (line 2330) anonymous(function())jquery-1.4.1.js (line 2495) anonymous(textarea#CommentBody, Object)jquery.w...orborg.js (line 428) Wysiwyg(textarea#CommentBody, Object)jquery.w...orborg.js (line 110) Wysiwyg(textarea#CommentBody, Object)jquery.w...orborg.js (line 111) anonymous()jquery.w...orborg.js (line 103) anonymous([textarea#CommentBody length=1 0=textarea#CommentBody context=document], function(), Object name=args)jquery-1.4.1.js (line 572) anonymous(function(), Object name=args)jquery-1.4.1.js (line 240) anonymous(Object)jquery.w...orborg.js (line 101) anonymous()language:en (line 41) anonymous(function())jquery-1.4.1.js (line 250) anonymous(function(), Object name=context)jquery-1.4.1.js (line 160) anonymous(function(), Object name=context) If I add some text through the source pane, select it, and then click the bold button, I get this: uncaught exception: [Exception... Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand] nsresult: 0x80004005 (NS_ERROR_FAILURE) location: JS frame :: http://mi_mtl.apollo/js/lib/jquery.wysiwyg.storborg.js :: anonymous :: line 595 data: no] anonymous(html, handle, Object name=data)jquery-1.4.1.js (line 1020) anonymous(Object type=focus timeStamp=1264904061090, [Object type=focus timeStamp=1264904061090 0=Object], html)jquery-1.4.1.js (line 1805) anonymous(Object type=focus timeStamp=1264904061090, [Object type=focus timeStamp=1264904061090 0=Object], body)jquery-1.4.1.js (line 1824) anonymous()jquery-1.4.1.js (line 2352) anonymous([body 0=body context=body length=1 jquery=1.4.1], function(), Object name=args)jquery-1.4.1.js (line 572) anonymous(function(), Object name=args)jquery-1.4.1.js (line 240) anonymous(focus, Object name=data)jquery-1.4.1.js (line 2351) anonymous(Object name=fn)jquery-1.4.1.js (line 2495) anonymous()jquery.w...orborg.js (line 491) anonymous(Object originalEvent=Event focus type=focus)jquery-1.4.1.js (line 1884) anonymous()jquery-1.4.1.js (line 1579) When I load the editor in a plain page (no AJAX) all is good. I suspect this may be a jQuery bug with the way it runs script returned by ajax(). Can anyone shed some light? Starting in safe mode gave the same error. It works fine in Opera, btw. [1] http://github.com/storborg/jwysiwyg
Re: [jQuery] Implementing JCrop in Ajax Upload
What do you mean by, the image selection doesnt work? Can you give a clearer description o fwhere you think the problem lies? Are you certain that the path sent back from the server is correct? What does alert(data.path) show? On Wed, Jan 27, 2010 at 8:21 PM, adi sembiring sembiring@gmail.com wrote: Hi , I'm trying to develop image crop using JQuery. I use ajax to upload the image. after the image success fully uploaded. I load the uploaded image using jquery to its container. $(#image_upload).html(img src=' + data.path + ' width=\460\ id=\cropbox\ alt=\cropbox\ /); but the image selection doesnt work. why it could be happened ? this is my code: style type=text/css #preview { width: 150px; height: 150px; overflow: hidden; } /style script type=text/javascript src=?php echo base_url()?asset/jqupload/js/ajaxfileupload.js /script script type=text/javascript src=?php echo base_url()?asset/jcrop/jquery.Jcrop.pack.js /script link rel=stylesheet href=?php echo base_url()?asset/jcrop/jquery.Jcrop.css type=text/css / script type=text/javascript function ajaxFileUpload(){ $(#loading).ajaxStart(function(){ $(this).show(); }).ajaxComplete(function(){ $(this).hide(); }); $.ajaxFileUpload({ url: '?php echo site_url()?/upload/do_upload', secureuri: false, fileElementId: 'fileToUpload', dataType: 'json', success: function(data, status){ if (typeof(data.error) != 'undefined') { if (data.error != '') { $(#image_upload).html(data.error); $(#image_upload).fadeIn(slow); } else { $(#image_upload).html(img src=' + data.path + ' width=\460\ id=\cropbox\ alt=\cropbox\ /); $(#image_upload).fadeIn(slow); $(#orig_h).val(data.width); $(#orig_w).val(data.height); //alert(a href=' + data.path + ' /); } } }, error: function(data, status, e){ $(#image_upload).html(e); $(#image_upload).fadeIn(slow); } }) return false; } $(document).ready(function(){ $(function(){ $('#cropbox').Jcrop({ aspectRatio: 1, setSelect: [0, 0, $(#oring_w).val(), $(#oring_h).val()], onSelect: updateCoords, onChange: updateCoords }); }); function updateCoords(c){ showPreview(c); $(#x).val(c.x); $(#y).val(c.y); $(#w).val(c.w); $(#h).val(c.h); } function showPreview(coords){ var rx = $(#oring_w).val() / coords.w; var ry = $(#oring_h).val() / coords.h; $(#preview img).css({ width: Math.round(rx * $(#oring_w).val()) + 'px', height: Math.round(ry * $(#oring_h).val()) + 'px', marginLeft: '-' + Math.round(rx * coords.x) + 'px', marginTop: '-' + Math.round(ry * coords.y) + 'px' }); } }); /script !-- begin main content -- div id=templatemo_content_area h1 class=content_titleLabel Infohr//h1 div id=templatemo_bi_full h2Label Setting/h2 div id=container /div !--container-- br/ h2Avatar/h2 div class=info /div div id=avatar_container form name=form action= method=POST enctype=multipart/form-data ul li class=leftHalf label class=desc for=lbl_type Change Your Avatar /label div div id=avatar img src=?php echo $avatar? width=130 height=130 / /div div id=avatar_upload input id=fileToUpload name=fileToUpload class=field field value= size=30 tabindex=5 type=file /input id=buttonUpload name=buttonUpload class=btTxt submit type=submit value=Upload onclick=return ajaxFileUpload();/img id=loading src=?php echo base_url()?asset/jqupload/images/loading.gif style=display:none; /div /div /li /ul ul id=crop_container li class=leftHalf label class=desc for=lbl_name Avatar for crop /label div id=image_upload
Re: [jQuery] JQuery Ajax serialize
Use parse_str(). But beware that that string has a problem: ?php header('Content-type: text/plain'); $str = 'single=Singlemultiple=Multiplemultiple=Multiple3check=check2radio=radio1'; /* old school way: explode() into pairs, then explode each of those into * key = val */ $pairs = explode('', $str); foreach($pairs as $pair) { $parts = explode('=', $pair); echo key: ${parts[0]} -- val: ${parts[1]}\n; } echo \n---\n; /* better way: parse the string into variables */ parse_str($str); echo ${single}\n; // 'Single' echo ${multiple}\n; // 'Multiple3' -- whoops! It takes the last value echo ${check}\n; // 'check2' echo ${radio}\n; // 'radio1' echo \n---\n; /* parse values into array instead */ parse_str($str, $arr); foreach($arr as $slice) { echo ${slice}\n; // will get 'Array' for multiples } echo \n---\n; /* multiple element names should have '[]' */ $str = 'single=Singlemultiple[]=Multiplemultiple[]=Multiple3check=check2radio=radio1'; parse_str($str, $arr); foreach($arr as $var) { if (is_array($var)) { foreach($var as $m) { echo ${m}\n; } } else { echo ${var}\n; } } On Sat, Jan 23, 2010 at 1:39 PM, parot russ...@parotkefalonia.com wrote: I know this may be a silly question, but is there a magic way to insert post data via serialization into a php/mysql database? e.g. a serilized array of single=Singlemultiple=Multiplemultiple=Multiple3check=check2radio=radio1 yes I used the Jquery serialize page info as an example. Is is best to use PHP to explode the array? or what? Or as asked is there a magic way to split the array into the fields values? -- View this message in context: http://old.nabble.com/JQuery-Ajax-serialize-tp27288727s27240p27288727.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Using variable in animate()'s properties
You're repeating a bunch of code here. It'd be better to assign a variable for the img at the beginning of the function. function() { var img = $(this).find('img'); var value = (direction =='top' || direction=='bottom') ? img.outerHeight() * -1 : img.outerWidth() * -1); img.stop().animate( {direction: value}, {duration: 500, easing: 'easeOutBounce'} ); } HOWEVER, the {direction: value} doesn't make any sense. That should contain CSS properties that you wish to animate the element towards. What is it you're try to do? Actually, which element are you assigning this handler to? It's not the img itself, is it? Also, is it possible that the img could have more than a single class assigned? That could bugger things up, i think. Better to use hasClass() in that csae. On Sun, Jan 24, 2010 at 7:10 PM, kevin kevinl...@gmail.com wrote: Hi, I'm writing this script and apparently the animate method wouldnt interpret the variable I pass in the properties section: //it's hover event, and this is the mouseover function () { direction = $(this).find('img').attr('class'); //should be either top, bottom, left or right value = ((direction =='top' || direction=='bottom') ? $(this).find ('img').outerHeight() * -1 : $(this).find('img').outerWidth() * -1); $(this).find('img').stop().animate({direction: value} ,{duration: 500, easing: 'easeOutBounce'}); } I have tested the content of variable, and there are 100% working, my final verdict is, the animate method doesn't read the variable direction properly. Anyone has any ideas to get around with this problem? Thanks
[jQuery] MarkItUp image upload
I've just created an improved image widget for the MarkItUp editor[1]. Instead of being prompted for an existing URL for the src attribute, a file upload form is created. The form target a hidden iframe. An online script should return the URL, as well as the final width height. When the iframe has loaded, the dta is used to create the img tag. Voila! You can see the code here: http://pastebin.ca/1763467 This example requires both jquery.loading jquery.json (and a 'cancel' button image). I fully expect that others might want to do things a little differently. b [1] http://markitup.jaysalvat.com/home/
Re: [jQuery] New Forums
On Thu, Jan 21, 2010 at 7:28 PM, Shawn sgro...@open2space.com wrote: My apologies to the list managers. I did not mean to belittle their efforts in any way. I only meant to state that for me, personally, forums are not the preferred tool. I am involved in a number of organizations where the main mantra is the concept of a do-aucracy. If you think it should be done a particular way, do it. For this list, this means that the list managers have DONE it, and so they get to make the rules. I don't pretend to know all the considerations that went into the choices that were made. But, I find it unacceptable that I have to give my contact information to zoho.com so that I can use a forum on jquery.com. (as suggested by Andre in a different posting on this thread). For some reason it is deemed ok for our account info (and everything related to it) to be accessible by absolute anyone. Whether it is a FaceBook account, a GMail account, etc. I have put the brakes on for this trend and refuse to give my information away to third party sites that have nothing to do with what I'm trying to do. No offense intended to the zoho gang, as I do not know them or their intentions/purposes. But I'll just say no. My thoughts. My thoughts, also. FWIW, I'm pretty sure the decision to drop Google Groups is due to John Ressig's account being spoofed by spammers. It's happened to me, also. That, too, is unacceptable. I vote for Mailman, or some other well-established list software. I won't register with zoho, either.
Re: [jQuery] Re: JQuery and AJAX Heartbeat question
Whoops. I guess this bit of info from the manual is pertinent: Warning This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini. On Tue, Jan 19, 2010 at 4:44 AM, mind01 mindproduction...@gmail.com wrote: Thanks for your tips brian and scott. set_time_limit(0); The expected value is integer seconds. A value of 0 disables the time limit altogether. If i try set_time_limit(20); it gives me an 500 error after 20 seconds, but if i set the value to 60 seconds, i still get a server time out after 30 seconds. I have seen upload scripts with some kind of callback to the server to avoid a time out. There must be something i can do right? Thnx again.
Re: [jQuery] JQuery and AJAX Heartbeat question
Put this near the top of your PHP script: set_time_limit(0); The expected value is integer seconds. A value of 0 disables the time limit altogether. On Mon, Jan 18, 2010 at 4:25 PM, mind01 mindproduction...@gmail.com wrote: Hi there, I have a PHP script called zip.php to generate a zip file. This requires more than 30 seconds so my server give me an server error 500 time-out. Can i avoid this 500 error with JQuery and AJAX heartbeat? Greetz
Re: [jQuery] Passing in a parameter
Do you have some function inside of the ready() block that you could pass the data to instead? Could you post some of your code? On Sat, Jan 16, 2010 at 11:57 PM, Patrick kenned...@gmail.com wrote: Hi all, I have a newbie question. You know how you can pass a variable to a JavaScript function like this: onload=getStuff(data) Which is done via the BODY tag. Now, jQuery uses $(document).ready (function() }); My problem is simple: I want to pass in a variable to the ready (function(). When the page is first loaded, how can I pass in a variable to this function, or what strategy should I imploy to do such? Thanks for the pointers. Pat
Re: [jQuery] Jquery DOM
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F On Sun, Jan 17, 2010 at 10:50 AM, Louie39 loui...@gmail.com wrote: I have a form that is using jqury to post data (ajax) to another page and returns the result, but after the new content is loading, all links that are using jquery doesn't work anymore. Does anyone have a solution to this?
Re: [jQuery] New Forums
On Sat, Jan 16, 2010 at 6:51 PM, Matt Quackenbush quackfu...@gmail.com wrote: I concur regarding mailing list vs. forum. Both have their positives and negatives, but these days I definitely prefer a mailing list over forums. Perhaps the jQuery team could not find another mailing list that would import all of the existing posts on Google Groups? (My understanding is that they were able to do just that with the new forums.) Count another vote against a forum. I haven't been very active on the list of late, but i certainly would not be inclined to login to a forum everyday to browse the list to see where i might help. I much prefer using an email list. Mailman has always worked well for me. I tried to log in with the same result, btw.
Re: [jQuery] ^=, $=: how to use?
Like this, for example: $('input[id$=3]').change(function() { alert('foo'); }); But it really depends on what you want to do. With the above, you'd need to specify as many change() handlers as you have inputs. Another way would be to have a generic handler and, inside that function, have a switch block and test on the last char from the ID. However, in that case, I think you'd be best off preceding the integer with an underscore or some other character. This way, you're not limited to 0-9. $('input[type=radio]').change(function() { var val = $(this).attr('id').split('_'); switch(val[val.length - 1]) { case '1': break; case '2': break; case '3': alert('here it is'); break; // etc. } }); On Sat, Jan 16, 2010 at 1:39 PM, Andre Polykanine an...@oire.org wrote: Hello everyone, I need to get a number which is the last char of a radiobutton id. Say, the IDs are utype1, utype2, utype3 I need to say if the last char of the Id is 3, then do something. How do I use $= here? Couldn't find that in the docs. Thanks! -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule
Re: [jQuery] $(ul li a).hover
On Thu, Jan 14, 2010 at 9:53 PM, J jesseparent...@gmail.com wrote: Hi, Im new to jquery. I have a .hover that is applied to all ul li a $(ul li a).hover Question: How can I apply the .hover to a specific class or id? I tried something like this but it didn't work for me: $(#test ul li a).hover Which element has id 'hover'? If it's the parent of the UL this should work. $(test ul li a).hover This won't work because the selector presupposes 'hover' tag, which doesn't exist.
Re: [jQuery] $(ul li a).hover
On Thu, Jan 14, 2010 at 10:06 PM, brian zijn.digi...@gmail.com wrote: On Thu, Jan 14, 2010 at 9:53 PM, J jesseparent...@gmail.com wrote: Hi, Im new to jquery. I have a .hover that is applied to all ul li a $(ul li a).hover Question: How can I apply the .hover to a specific class or id? I tried something like this but it didn't work for me: $(#test ul li a).hover Which element has id 'hover'? If it's the parent of the UL this should work. I meant id 'test'. $(test ul li a).hover This won't work because the selector presupposes 'hover' tag, which doesn't exist. I meant, a 'test' tag.
Re: [jQuery] Find array key of value
I'm not sure that I follow that but one thing that might help is to store JSON objects in the array instead of just the src: $( .images img ).each( function(i) { imgArray.push( src: $(this).attr( src ), key: i ); }); Then, when retrieving the new src you can also get the key/index. On Tue, Jan 12, 2010 at 3:30 AM, knal knalp...@gmail.com wrote: Hi there, I'm trying to build a custom slideshow (which doesn't loop) but i seem to be unable to iterate through the array of images correctly. Content looks like div class=images img src=1.jpg img src=2.jpg etc /div I create an array of images as follows $( .images img ).each( function() { imgArray.push( $(this).attr( src ) ); }); All images except for img:first are hidden, and to change slides i change img:first's src-attribute with a fade (hope it's clear). Now i'd like to check img:first's current src-attribute and then define it's key in the array. I hope this kind of makes sense. Any help will be greatly appreciated! Thanks, Knal
Re: [jQuery] added form elements not sent using Firefox
If you have multiple inputs with the same name be sure to add square brackets to the name so that the browser sends an array of values. single: input type=text name=foo / multiple: input type=text name=foo[] / input type=text name=foo[] / Also, fyi (and most likely unrelated), when copying DOM elements, make sure that you don't end up with multiple elements with the same ID (as opposed to name). On Tue, Jan 12, 2010 at 2:49 AM, Eric Cope eric.c...@gmail.com wrote: Hello all, I am using jquery to copy a DIV containing some form elements. The copy is appended to the DIV in another DIV to allow an unlimited number of form elements to be sent. The problem is that none of the copy DIVs are being sent by the browser (Firefox). There is some chatter via google, but nothing conclusive. I see the DIVs show up in Firebug. Could this be jquery related? Thanks in advance! Eric
Re: [jQuery] Altering cloned HTML's ID values
See this thread: http://groups.google.com/group/jquery-en/browse_thread/thread/ce535e6bc3c8ef34 On Tue, Jan 12, 2010 at 10:15 AM, Sloan Thrasher sl...@sloanthrasher.com wrote: Hi, I've got a table where I'm adding rows using clone and appendTo. After cloning, I need to change the ID of elements in the cloned HTML. How can I do that? Sloan
Re: [jQuery] [apycom Menu] Submenu items showing as top level items in IE
W3.org's validator shows 163 errors and 46 warnings. Best you get the page to validate first as this may be caused by invalid/broken markup. On Sun, Jan 10, 2010 at 2:55 PM, speedpac...@gmail.com speedpac...@gmail.com wrote: Hi, I'm using the (paid) version of Apycom's jQuery menu; you can find it at http://apycom.com/ and it is looking really good. I have uploaded files, and published it on a test site - www.flexin.be Unfortunately, some of the submenus (starting from the second that has children elements), it adds the item on the top level in Internet Explorer. Does anyone on this list has any experience with this library? Is it a known issue? Any idea on how I can fix it? thanks so much in advance for any feedback! Kind regards David.
Re: [jQuery] reference dynamically loaded form select
Set the event handler on the select at the time it is added to the DOM. http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F On Fri, Jan 8, 2010 at 1:49 PM, sonicDivx sonicd...@gmail.com wrote: Been trying to find the best answer to a problem a co-worker is having with a form select field that gets loaded via an ajax call into a table cell. He has a form and when the page loads based on the value of another form field he makes an ajax call and loads a complete select statement. the ajax load is fine, but when he makes a select from the new select this it is not recognized and passed with the form submit. How can I get this select field to be recognized by the form? Thanks for any insight. Kevin
Re: [jQuery] Accessing value of a dynamic added input
$(this).val() should work just fine. There must be some other issue. Are you sure the HTML is correct (eg. options all have values)? On Sat, Jan 9, 2010 at 5:55 PM, -null- suzanne.bo...@gmail.com wrote: I'm adding an input and select box to a div by setting the div's html. I then attach a change event to the select which posts to a php page using ajax. I'm having a problem however accessing the value of the input from the change event. This is the event. $('#' + popup.popupId + ' select').change(function(event) { event.preventDefault(); popup.showLoading(); var matchup = $('#' + popup.popupId + ' input[type=hidden]').val(); var match = $(this).val(); $.get(baseUrl + 'edit_matchtype=matchmatchup_id=' + matchup + 'match_id=' + match, {}, function(data, textStatus) { handleFormSuccess(popup, data); }, 'json'); }); Is there a way I can access the value of the input here. I've tried various selectors but none seem to work.
Re: [jQuery] :contains nbsp; in IE doesn't seem to work
Do these cells contain *only* the nbsp? If so, you could go at it another way: $('td:last-child').each(function() { if ('' == $(this).text().trim()) { $(this).parent().addClass('markeme-sub'); } }); On Fri, Jan 8, 2010 at 7:41 AM, Jonatan jona...@kig.se wrote: Hi, I've just recently started to use jQuery, and it has already proven extremely useful for formatting tables (and other things as well!). I get raw html-tables into my page, and my only way of styling them are css and, now, jquery. And it's worked out fine. But now I've run into a problem. Which seems to depend on which browser you use. I'm trying to give the table rows with the last cell containing nbsp;, a specific style by adding a class. In FF/Safari/Chrome it behaves as I expect it. But Internet Explorer gives me no result at all. The code: $(tr td:last-child:contains('\u00a0')).parent().attr ('class','markeme-sub'); And I'm stumped. Is it because of how browsers handle the whitespace, or am I missing something in my jquery? Thankful for any help! Best regards Jonatan
Re: [jQuery] My table tags are getting stripped out.
I can't see what might be causing that although you could change these 2 lines: $('#CalendarBody').children().remove(); $('#CalendarBody').append(response); ... to: $('#CalendarBody').html(response); That's if you're not using thead, tfoot, and tbody tags, of course. On Fri, Jan 8, 2010 at 12:16 AM, choboj...@gmail.com choboj...@gmail.com wrote: Hi I am using jquery form plugin http://jquery.malsup.com/form/ I am not sure if I am doing something wrong but it seems to be stripping out my tr and td html tags when I send stuff back from the server and I am not sure why. I have an asp.net MVC ContentResult that returns some html code. When looking at the stuff the content result is about to return it looks like this(a small portion of what is being returned) trtd class=OtherMonth DateBox id=c_12272009div class=DateLabel OtherMonthHeader27/div/td Once it returns back to the jquery code it looks like this div class=DateLabel OtherMonthHeader27/div All the tr's and td's are stripped out and this is the case for all everthing I returned. Every single tr and td is removed and I mean every single one. This is what I have for my jquery $('#frm_ImportCalendar').livequery(function() { var options = { dataType: 'html', success: function(response) { alert(response); $('#CalendarBody').children().remove(); $('#CalendarBody').append(response); jAlert(Import Complete); } }; $(this).ajaxForm(options); }); Am I missing something?
Re: [jQuery] Re: highlighting
var $target = $(this.hash); $target.addClass('SomeClassName'); ... On Thu, Jan 7, 2010 at 10:02 AM, metalmini metalm...@gmail.com wrote: Euh... oke and in what way do i implement that? Can you give me a example? Thanks for the reply btw :-) On Jan 7, 1:01 am, brian zijn.digi...@gmail.com wrote: $target.css('...') Or, better: $target.addClass('SomeClassName');
Re: [jQuery] Replacing HTML Content for Elements of a Certain Class
see here: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F http://docs.jquery.com/Plugins/livequery Essentially, you either need to deal with this in the load() success callback or use live(). However, i can't remember if live() works for the load event (the docs don't sem to spell this out). On Thu, Jan 7, 2010 at 11:33 AM, nybbblesandbytes nybblesandbytes...@gmail.com wrote: jQuery group, I've been using jQuery for my website, and have come up against an obstacle. My page dynamically loads comments from DISQUS, and as a result the comments take a few seconds to load. I need to make some jQuery code that runs a function once the comments (which are of class dsq.comment.message) are created. I've tried using the load(fn) event, but it doesn't seem to work for objects that have not yet been created. In essence, I need jquery to watch for new elements of a certain class to be created, then my code will make some mods. Any idea how to do this or what event to watch for? Currently, I am running this code: $(.dsq-comment-message).load(function () { alert('A comment was just created'); } ); ~ nybblesandbytes
Re: [jQuery] highlighting
$target.css('...') Or, better: $target.addClass('SomeClassName'); On Tue, Jan 5, 2010 at 10:35 AM, metalmini metalm...@gmail.com wrote: Hi guys and galls, Im not really a jquery programmer but i build lots of sites and i love the jquery plugins that i can easily copy and paste. So anyway im building a new site and i am using alot of jquery to emprove usability. So i am using a little script that scrolls easy to the a name=p1/ a html tag. [code] $(document).ready(function(){ $('a[href*=#]').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^ \//,'') location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length $target || $('[name=' + this.hash.slice(1) +']'); if ($target.length) { var targetOffset = $target.offset().top; $('html,body') .animate({scrollTop: targetOffset}, 1000); return false; } } }); }); [/code] This is not my own code, i found it. As i said im not a jquery pro. Anyway i was wondering if it is possible to somehow highlight the div class with a background color to make it stand out more? Something that i can add to this little piece of code? If there are things that i should include please let me know. Thank you very much in advance. Kind regards, Michael
Re: [jQuery] Re: urgent help
Or, at minimum, an example or two of the errors encountered. On Wed, Jan 6, 2010 at 7:13 AM, MOZ pbe...@gmail.com wrote: link to demo? On Jan 6, 3:49 am, Sugi sugi...@gmail.com wrote: I am using Jquery plugins like flowplayer,fancy plugin for image and video stuffs...It creates lot of erros with IE 6. Can any one help to fix compatability issue with IE6? Please reply..Very urgent
Re: [jQuery] form validation
Set up the handler when the form is created: $(#the_form_id).validate(); You might also want to have a look at the Jeditable plugin: http://www.appelsiini.net/projects/jeditable On Wed, Jan 6, 2010 at 10:25 AM, John Albright trumpetman...@gmail.com wrote: Is it possible to use the jquery form validation plugin (http:// bassistance.de/jquery-plugins/jquery-plugin-validation/) to validate a form that was inserted into the page via javascript? What I'm trying to do is display a person's address, which is contained in a span tag, and give them the option to edit it. If they click the edit button, I'm changing the span to a form tag with jQuery and turning the parts of the address into text boxes with the values filled in. The problem I'm having is that since the form doesn't exist from the very beginning, the validate function isn't getting assigned to it, and when the form is created and submitted, it doesn't get validated. Can I somehow make the plugin assign the validate function to the form when the edit button is clicked, or is that not possible?
Re: [jQuery] Position div accounting for screen size/resize
Bind a handler for the resize event like so: $(window).bind('resize', function() { ...}); Have a look at this thread: http://groups.google.com/group/jquery-en/browse_thread/thread/4a00d513c63f5c00?pli=1 On Wed, Jan 6, 2010 at 11:08 AM, kevinkace kevinacame...@gmail.com wrote: Can you change a position of a div, based on screen size/resize with jquery? Something like if (browser= sitecontainerwidth) { left:50%; margin-left: 20px; } else { left: 0%; margin-left: 600px; } I have a centered layout (div{margin: top auto;}) with a BG image. There's another div (with a background design) that needs to overlay on the BG, but off center. Figure of what the problem: http://www.kacevisual.com/files/Div-difficulties.gif
Re: [jQuery] How to append a ul li to line of orphan text?
On Tue, Jan 5, 2010 at 1:01 AM, Tong naateepart.premnitthip...@gmail.com wrote: Hi, I have the following HTML: div id=text strongSome Text Here/strong: More Text Herebr / strongSome Text Here/strong: More Text Herebr / strongSome Text Here/strong: More Text Herebr / /div How could I use jQuery to wrap each line of text in a li and remove all the br / and finally wrap all the li in a ul? Example: div id=text ul listrongSome Text Here/strong: More Text Here/li listrongSome Text Here/strong: More Text Here/li listrongSome Text Here/strong: More Text Here/li /ul /div This seems to work but I don't know that it's the most efficient method. $(function() { /* grab the text and trim leading trailing newlines/whitespace */ var the_text = $.trim($('#text').html()); /* swap out newlines for closing/opening LI tags */ the_text = 'ulli' + the_text.replace(/\n/g, '/lili') + '/li/ul'; /* html() normalises the self-closing 'br /' to 'br' */ $('#text').html(the_text.replace(/br/g, '')); });
Re: [jQuery] New to JS and jQuery
That works for me but I do see how this can be refactored: a id=stuff class=baritem href=#stuff_menuMy Account/a div id=stuff_menu class=SomeClass a href=##My Account/a a href=##More stuff/a a href=##Here is a menu item/a a href=##Here is a menu item/a a href=##Here is a menu item/a a href=##Here is a menu item/a /div Notice that I've changed the IDs so that the DIV has the link ID plus some other string, rather than the other way around. Also, I've added a class to the DIV to make it easier to set styles. This isn't strictly necessary. $(function() { /* set up the onclick handler for all links on page load */ $('.baritem').click(function() { $('#' + this.id + '_menu').toggle(); return false; }); }); On Mon, Jan 4, 2010 at 4:01 PM, Valerij valeri...@gmail.com wrote: Hey guys, I'm trying to create 1 really simple function but it just doesn't work! function showMenu(menu) { var menuid = $( #+menu ); var menuRoot = $( #+menu+-root ); menuid.toggle(); menuRoot.blur(); } What this suppose to do is when you click a link, it will change settings of a specific div to visible The HTML: a id=stuff-root class=baritem href=javascript:void(0) onclick=showMenu('stuff');My Account/a div id=stuff a href=##My Account/a a href=##More stuff/a a href=##Here is a menu item/a a href=##Here is a menu item/a a href=##Here is a menu item/a a href=##Here is a menu item/a /div Why doesn't this work? What am I doing wrong.. When I alert this, I get the correct div ids?
Re: [jQuery] retrieving textnode?
CSS only operates on tagged elements. You'll have to wrap the text node in a span (with a certain class, for example). On Tue, Jan 5, 2010 at 2:00 AM, bundy ctil...@hinet.net.au wrote: Hi, I'm new to jQuery, finding feet. I want to be able to say, if the text node of a certain child consists of certain string, do this with its css. Gotten as far as changing the css of all the children, thus: $(document).ready(function(){ $(div p::nth-child(6).css(color, red); }); but $(document).ready(function(){ $(div p::nth-child(6).textNode(_ _).css(color, red); }); doesn't do it. Nor does textNode=... Second question, Firefox error console isn't muchhelp in interpreting the error. Any suggestion for debugging?
Re: [jQuery] Change opacity of item with class of selected
Just put the class in the selector instead of testing for it first: $(#portfolio #thumbs li.selected).css('opacity','0.5'); If the class doesn't exist, jQuery will do nothing (instead of throwing an undefined error or similar). On Tue, Jan 5, 2010 at 12:45 PM, Paul Collins pauldcoll...@gmail.com wrote: Hi all I've been stuck on this for four hours, and I still can't solve it! I am trying to check if a list item has a class of selected, then is so change the opacity to 0.5. Here is my code: if ($(#portfolio #thumbs ul li).hasClass(.selected)) { $(this).css('opacity','0.5'); } It seems that the this part isn't working, is it to do with putting it in an event? Would appreciate any help
[jQuery] Taconite eval blocks referencing other parts of XML document
I want to be able to return an XML document from my server that contains more than just Taconite commands, and I want to be able to read those additional XML nodes from within a Taconite eval block. I've come up with a solution, but I wonder if there's a better way of doing this. Here's a trivial example of my solution: *Client Code* ... script *var oxml;* $.post('ajaxresponder.cfm',{ action: 'dosomething', dataType: 'xml' },function (xml) { *oxml=xml;* }); /script *Server Return* xml status0/status nameBrian/name ... taconite append select=#content Some stuff to add /append ... eval![CDATA[ if($('#status'*,oxml*).val() == 0) { $('#content).append( $('#name',*oxml*).val() ); } ]]/eval /taconite /xml Is there a way of accessing the current XML document from within a Taconite eval block without using a global variable, i.e., omitting the parts in blue above? Thanks, Brian
Re: [jQuery] jquery.js and jquery-1.2.6.pack.js conflict
You should only load one of those files. The version included with jCarousel is there as a convenience. It's not necessary to use it if you already are loading jQuery. It's likely the unpacked version is newer, anyway. On Thu, Dec 31, 2009 at 7:21 AM, Mr.Aaqib mr.aa...@gmail.com wrote: Hi, Recently i created menu and image gallery. I used jquery.js for menus and for image gallery i used jquery-1.2.6.pack.js as provided by carousels galleries. Now both of them does not work at same time. If i include both file image gallery script generates error message and if i remove the menus jquery.php file menus does not work but image gallery works as expected. I dont know whether its version conflict or something else. Any help will be highly appreciated. Regards Aaqib Iqbal
Re: [jQuery] Re: simplemodal next/back functionality
On Thu, Dec 31, 2009 at 2:13 AM, nevgenevich nevgenev...@gmail.com wrote: it generates the link properly, when clicking on it: it closes the modal but does nothing else. i can verify with a console.log that it gets to after the call to open the previous modal, but it doesnt open anything. checked to make sure it was generating the modal link correctly too (ie calling the correct id) It works fine for me. Here's the full page I used to test: !DOCTYPE html html head title/title link rel=Stylesheet href=http://yui.yahooapis.com/3.0.0/build/cssreset/reset-min.css; / style body { padding: 100px; } div.Bar { display: none; } /style script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js;/script script src=jquery.simplemodal-1.3.3.min.js/script script $(function() { $('a.Foo').each(function() { $(this).click(function() { $('#modal_' + this.id).modal({overlayClose:true}); }); }); var num_divs = $('div.Bar').length; $('div.Bar').each(function(i) { /* if there is a previous div add a link to it */ if (i 0) { /* get the ID for previous div */ var prev_id = $(this).prev('.Bar').attr('id'); /* add the link with click event */ $('a href=# class=Prevprevious/a') .click(function() { $.modal.close(); $('#' + prev_id).modal({overlayClose:true}); }) .appendTo($(this)); } /* if there is a next div add a link to it */ if (i num_divs - 1) { /* get the ID for next div */ var next_id = $(this).next('.Bar').attr('id'); /* add the link with click event */ $('a href=# class=Nextnext/a') .click(function() { $.modal.close(); $('#' + next_id).modal({overlayClose:true}); }) .appendTo($(this)); } }); }); /script /head body ul lia href=# class=Foo id=oneone/a/li lia href=# class=Foo id=twotwo/a/li lia href=# class=Foo id=threethree/a/li lia href=# class=Foo id=fourfour/a/li lia href=# class=Foo id=fivefive/a/li /ul div class=Bar id=modal_oneModal one/div div class=Bar id=modal_twoModal two/div div class=Bar id=modal_threeModal three/div div class=Bar id=modal_fourModal four/div div class=Bar id=modal_fiveModal five/div /body /html
Re: [jQuery] Re: Help on Independent DIV's that toggle!!
On Tue, Dec 29, 2009 at 11:11 PM, Erik eriks...@mac.com wrote: Brian, It looks like you just added $(this).next That, and used class names in the selector, rather than a unique ID, so that it operates on a set of elements. Using next() assumes that each link comes just before the div that it should toggle.
Re: [jQuery] If radio button checked - do stuff
You have some redundancy there. Selecting on ':radio' is unnecessary because you're also selecting for the element name. And the ':checked' is no good because that limits this to elements that have already been checked. That's likely not the desired behaviour. Try: $('form input[name=setting1]').click(function() { ... }); On Wed, Dec 30, 2009 at 11:03 AM, Silver 8800gt...@gmail.com wrote: Hey all, I think I'm close, but I keep getting the errors ( Unkonw pseude-class or pseude-elmemt 'radio'). All I need is if the user clicks a radio button for the right if statement to run and send the variables to the dq_process php file. $(form input[name=setting1]:radio).filter(':checked').click(function () { if ( $(this).val() == 'home_fy' ) $.post(dq_process.php, { q: 1, r: 13300 } ); else if ( $(this).val() == 'home_by' ) $.post(dq_process.php, { q: 1, r: 24400 } ); else $.post(dq_process.php, { q: 1, r: 0 } ); }); ol class=answers liinput type=radio name=setting1 value=home_fy / Home – front yard/li liinput type=radio name=setting1 value=home_by / Home – back yard/li liinput type=radio name=setting1 value=cottage / Cottage/li /ol Any help would be great. Thanks
Re: [jQuery] simplemodal next/back functionality
Given the following HTML: ul lia href=# class=Foo id=oneone/a/li lia href=# class=Foo id=twotwo/a/li lia href=# class=Foo id=threethree/a/li lia href=# class=Foo id=fourfour/a/li lia href=# class=Foo id=fivefive/a/li /ul div class=Bar id=modal_oneModal one/div div class=Bar id=modal_twoModal two/div div class=Bar id=modal_threeModal three/div div class=Bar id=modal_fourModal four/div div class=Bar id=modal_fiveModal five/div $(function() { $('a.Foo').each(function() { $(this).click(function() { $('#modal_' + this.id).modal({overlayClose:true}); }); }); var num_divs = $('div.Bar').length; $('div.Bar').each(function(i) { /* if there is a previous div add a link to it */ if (i 0) { /* get the ID for previous div */ var prev_id = $(this).prev('.Bar').attr('id'); /* add the link with click event */ $('a href=# class=Prevprevious/a') .click(function() { $.modal.close(); $('#' + prev_id).modal({overlayClose:true}); }) .appendTo($(this)); } /* if there is a next div add a link to it */ if (i num_divs - 1) { /* get the ID for next div */ var next_id = $(this).next('.Bar').attr('id'); /* add the link with click event */ $('a href=# class=Nextnext/a') .click(function() { $.modal.close(); $('#' + next_id).modal({overlayClose:true}); }) .appendTo($(this)); } }); }); You'll need to style the .Prev .Next links somehow; this just appends them. You could also add a container div to hold the links inside each of the divs before the two if statements. That might help with styling them. On Wed, Dec 30, 2009 at 4:12 AM, nevgenevich nevgenev...@gmail.com wrote: i'm using simplemodal library to show a collection of items, each of which is some html content... however, all of these are of the same structure and are related, so i'm trying to find a way to implement back/next links to save users an extra click (to close the current, then open next, and wait for the animations to happen for half a second) to view the next in the series and to give an easy way to go through all the items (kinda like lightbox allows you to easily go though all the images in a set; thats essentially the behavior i'm looking for) first i tried opening a modal from within a modal, but that doesnt work. next i'm trying to close the modal from within the modal AND then programmatically open the next one (assuming that its somewhat trivial to 'know' which one needs to be opened for any given link) so say i have 5 items, and i've opened the 2nd, it should have a previous link to go to the 1st and a next link to go to the 3rd... but how can i make these links actually function? is this something that can be achieved with some tricky coding or does the actual plugin/ framework need changes to enable it to 'see' sets of items like lightbox? any ideas are appreciated! :)
[jQuery] animate() not working for opacity in IE
I'm trying to animate a div from 100% opacity to 40% opacity WITHOUT using fadeTo(). I need to use animate(). It works fine in chrome/FF/safari, but in IE, the opacity doesn't animate, it simply changes to that after the animation is done. Happens in IE 7 and 8. I'm doing this: .animate({ width: new_width, top: new_top, left: new_left, padding: new_padding, opacity: 0.4, filter: alpha(opacity=40) }, ... it's just not animating the opacity. Any ideas?
Re: [jQuery] jquery and tomcat
jQuery is a client-side framework. Your host provider should not be at all an issue. Perhaps you're confusing Java with Javascript. They are completely separate things. On Wed, Dec 30, 2009 at 1:07 PM, jason jason.mell...@gmail.com wrote: hello, i am looking to begin web development after a bit of experience with computer programming (computation and numerical methods). i am looking for a web host. so far anhosting.com seems like a fine option, but i would like to be able to make use of jquery. can anyone recommend a web host? also, anhosting asked if jquery requires tomcat. not really knowing much yet i am not sure if it does. could anyone she some light on this for me? thanks!
Re: [jQuery] Re: sorting columns using jquery. noob with html and java. built custom php using snmp
Leave it in the PHP file. The tablesorter file should be left clean. Think of it as a library that you include. The snippet of code you referred to is something that makes use of that library. Don't be fooled by the script tags. While the file is a PHP script, any PHP code is parsed on the server. The script tags, however, are parsed by the browser's JS engine, and are unrelated to PHP. On Tue, Dec 29, 2009 at 11:25 AM, Mark K. Ayler Jr. markay...@gmail.com wrote: Alex, Thanks so much. It does look a lot better...and looking through your changes, it makes perfect sense. Thanks for doing that. Are you sure this code belongs in my .php file or should it be in the jquery.tablesorter.min.js file? $(document).ready(function() { // call the tablesorter plugin $(#results_table).tablesorter({ // enable debug mode debug: true }); });/script On Tue, Dec 29, 2009 at 5:08 AM, Alex Mcauley webmas...@thecarmarketplace.com wrote: You have alot of unclosed tags in there ... Let me help you out a bit and pastebin how it should look!... This should help http://pastie.org/759936 On Dec 28, 6:44 pm, ace123 markay...@gmail.com wrote: I'm not sure if this is possible...but I love the jquery tablesorter- but I can't figure out how to get it working. My page displays as if it's not even there. I used php to snmpget some data from my network switches and routers. It saves it to my DB...then I have this page to display the information from the database. This is where I want to be able to sort, by switch type, software version, etc. I'm not a code guy, just a network engineer trying to make my job easier. Your help please is MUCH appreciated. I've been trying to get this to work off and on for 6 months. This is what I've got so far The page looks something like this when I load it. Host Name Device Type Firmware Version Software Version edge-109c-gs.gov.ntwk 470-24T 3.6.0.7 v3.7.3.13 edge-241c-gs.anx.ntwk 470-24T 3.6.0.7 v3.7.3.13 edge-399c-gs.anx.ntwk 470-24T 3.6.0.7 v3.7.3.13 html body ?php $username=root; $password=; $database=switchesdb; mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( Unable to select database); $query=SELECT * FROM switchcode; $result=mysql_query($query); $num=mysql_numrows($result); ? head script type=text/javascript src=/var/www/html/jquery-1.3.2.js/ script script type=text/javascript src=/var/www/html/ jquery.tablesorter.min.js/script script type=text/javascript $(document).ready(function() { // call the tablesorter plugin $(table).tablesorter({ // enable debug mode debug: true }); });/script table id=table table class=tablesorter cellspacing=1 thead table border=1 cellspacing=4 cellpadding=4 tr thfont face=Arial, Helvetica, sans-serifHost Name/font/th thfont face=Arial, Helvetica, sans-serifDevice Type/font/th thfont face=Arial, Helvetica, sans-serifFirmware Version/font/ th thfont face=Arial, Helvetica, sans-serifSoftware Version/font/ th /tr /thead /head ?php $i=0; while ($i $num) { $host_name=mysql_result($result,$i,host_name); $device_type=mysql_result($result,$i,device_type); $firmware_version=mysql_result($result,$i,firmware_version); $software_version=mysql_result($result,$i,software_version); ? tbody tr tdfont face=Arial, Helvetica, sans-serif?php echo $host_name; ?/font/td tdfont face=Arial, Helvetica, sans-serif?php echo $device_type; ?/font/td tdfont face=Arial, Helvetica, sans-serif?php $cleanstring =strstr($firmware_version, \); echo ($cleanstring); ?/font/td tdfont face=Arial, Helvetica, sans-serif?php $cleanstring1 =strstr($software_version, \); echo ($cleanstring1); ?/font/td /tr /tbody /body /html ?php $i++;} ? -- Mark K Ayler Jr. CCNA, MCSE, NNCSS, OASIS.
Re: [jQuery] Multifile - help
You shouldn't need more than one file element to begin with. The plugin takes care of creating new ones. Or, perhaps I don't understand what it is you're trying to do. On Tue, Dec 29, 2009 at 1:27 PM, jayakumar ala alajay...@gmail.com wrote: Anyone can help me on this.. On Mon, Dec 28, 2009 at 10:39 AM, jayakumar ala alajay...@gmail.com wrote: Hi, I am using Multifile plugin to select the multiple file. I am trying to get the final file count for each browser selection . Any help is appreciated. Here is the sample code i am using html script type=text/javascript src=js/jquery.js/script script type=text/javascript src=js/jquery.MultiFile.js/script script var intVal=2; $(document).ready(function(){ $('#addFileButton').click(function(){addUploadFile();}); }); function addUploadFile() { intVal++; $('div id=addVal'+intVal+'Please specify a file, or a set of files (dynamically):br'+ 'input type=file class=multi name=df'+intVal+' id=df'+intVal+' size=40//div').appendTo('#outerVal'); $('#df'+intVal).MultiFile(); } /script form action=doUpload enctype=multipart/form-data method=post div id=outerVal !--p Type some text (if you like):br input type=text name=textline size=30 /p-- div id=addVal1 Please specify a file, or a set of files:br input type=file class=multi name=df1 size=40 /div div id=addVal2 Please specify a file, or a set of files:br input type=file class=multi name=df2 size=40 /div /div div input type=submit value=Send input type=button class=button value=Add File id=addFileButton / /div /form /html Thanks Jay
Re: [jQuery] Multifile - help
OK, I think I understand now: you need to have separate groups of files, each with their own MultiFile input and, thus, one or more files for each group? In that case, you can check for the existence of elements with class=MultiFile, which is the class name given to the automatically-created file elements. var intVal=2; $(document).ready(function(){ $('#addFileButton').click(function(){addUploadFile();}); /* I've given the form id=the_form */ $('#the_form').submit(function() { alert($('.MultiFile').length); return false; }); }); If you need to have separate totals for each group you should add a class name to the group divs. This also makes it simple to get the count for the number of existing groups when creating a new one. Also, your HTML was incorrect (missing body tags). !DOCTYPE html html dir=ltr lang=en-CA script type=text/javascript src=js/jquery.js/script script type=text/javascript src=js/jquery.MultiFile.js/script script $(document).ready(function(){ $('#addFileButton').click(function() { /* get the number of existing groups */ var group_index = $('.SomeClassName').length + 1; var elStr = 'div class=SomeClassName id=group' + group_index + 'Please specify a file, or a set of files (dynamically):br /' + 'input type=file class=multi name=df' + group_index + ' id=df' + group_index + ' size=40 //div'; /* create elements, append, and initialise as MultiFile */ $(elStr).appendTo('#outerVal'); $('#df' + group_index).MultiFile(); }); $('#the_form').submit(function() { /* run through each group and count the number of MultiFile elements */ $('.SomeClassName').each(function() { /* note the 2nd parameter 'this' which sets the context * as the particular group */ alert(this.id + ': ' + $('.MultiFile', this).length); }); return false; }); }); /script /head body form id=the_form action=doUpload enctype=multipart/form-data method=post div id=outerVal div class=SomeClassName id=group1 Please specify a file, or a set of files:br / input type=file class=multi name=df1 size=40 / /div div class=SomeClassName id=group2 Please specify a file, or a set of files:br / input type=file class=multi name=df2 size=40 / /div /div div input type=submit value=Send / input type=button class=button value=Add File id=addFileButton / /div /form /body /html On Tue, Dec 29, 2009 at 4:33 PM, jayakumar ala alajay...@gmail.com wrote: Brian, I our requirement i need to add this file elements dynamically for each file path. And for each element i need the count of files that are uploaded under that filepath. Hope you understand my question now. Help is apprecited. Thanks Jay On Tue, Dec 29, 2009 at 12:56 PM, brian zijn.digi...@gmail.com wrote: You shouldn't need more than one file element to begin with. The plugin takes care of creating new ones. Or, perhaps I don't understand what it is you're trying to do. On Tue, Dec 29, 2009 at 1:27 PM, jayakumar ala alajay...@gmail.com wrote: Anyone can help me on this.. On Mon, Dec 28, 2009 at 10:39 AM, jayakumar ala alajay...@gmail.com wrote: Hi, I am using Multifile plugin to select the multiple file. I am trying to get the final file count for each browser selection . Any help is appreciated. Here is the sample code i am using html script type=text/javascript src=js/jquery.js/script script type=text/javascript src=js/jquery.MultiFile.js/script script var intVal=2; $(document).ready(function(){ $('#addFileButton').click(function(){addUploadFile();}); }); function addUploadFile() { intVal++; $('div id=addVal'+intVal+'Please specify a file, or a set of files (dynamically):br'+ 'input type=file class=multi name=df'+intVal+' id=df'+intVal+' size=40//div').appendTo('#outerVal'); $('#df'+intVal).MultiFile(); } /script form action=doUpload enctype=multipart/form-data method=post div id=outerVal !--p Type some text (if you like):br input type=text name=textline size=30 /p-- div id=addVal1 Please specify a file, or a set of files:br input type=file class=multi name=df1 size=40 /div div id=addVal2 Please specify a file, or a set of files:br input type=file class=multi name=df2 size=40 /div /div div input type=submit value=Send
Re: [jQuery] Help on Independent DIV's that toggle!!
Use classes: !DOCTYPE html html dir=ltr lang=en-CA script type=text/javascript src=http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js;/script script type=text/javascript $(document).ready(function() { $('.SomeOtherClass').hide(); $('a.SomeClass').click(function() { $(this).next('div.SomeOtherClass').slideToggle(400); $(this).text($(this).text() == 'More Details' ? 'Close' : 'More Details'); return false; }); }); /script /head body a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div /body /html On Tue, Dec 29, 2009 at 7:01 PM, Erik eriks...@mac.com wrote: Hi everyone, I got one DIV working with my toggle script. Works great. I need to add a few more DIV's with the same toggle script on the SAME PAGE. I wanted to duplicate the same script with different DIV names, but it didn't work. How can i use the same script with INDEPENDENT DIV's on the same page? Here is my good independent script. script type=text/javascript $(document).ready(function() { $('#content1').hide(); $('a#slick-toggle').click(function() { $('#content1').slideToggle(400); $(this).text($(this).text() == 'More Details' ? 'Close' : 'More Details'); // - HERE return false; }); }); /script
Re: [jQuery] Finding next element
Use prev() and next(). Look at the traversing section of the docs: http://docs.jquery.com/Traversing On Sun, Dec 27, 2009 at 7:30 PM, Toaster mr.toas...@gmail.com wrote: Hello. Example: ul lia/li lia class=active/li lia/li /ul How would I be able to get find the next or previous a in relation to the a class=active? I'd appreciate it if anybody could help me out with this. Thanks in advance.
Re: [jQuery] window.parent.document.getElementById('msgAlert').innerHTML
Try this: $('#msgAlert').html() On Tue, Dec 22, 2009 at 9:13 PM, ajijogja ajijo...@gmail.com wrote: hi... im aji n im newbie in jQ . . i want to know how use jQ with this : window.parent.document.getElementById('msgAlert').innerHTML . . thx be4
Re: [jQuery] toLowerCase method works in Google Chrome but not IE
The first thing I would do is inspect cookieMood. Obviously, it exists, or the code wouldn't reach that line. But, perhaps it isn't a string, as you expect. On Wed, Dec 23, 2009 at 9:50 PM, ArnieML arnie.lapi...@gmail.com wrote: Hi, Code snippet is as follows: function setStartMood(cookiemood) { if(cookiemood) { $(#moodlist).val(cookiemood); $(#plsselectmood).css( {'visibility': 'hidden'} ); mood = cookiemood.toLowerCase(); } else { $(#plsselectmood).css( {'visibility': 'visible'} ); } return mood; } The function works perfectly in Chrome and Firefox but IE gives the ff. error message (object doesn't support this property or method), referring to the toLowerCase method. IE is really annoying!
Re: [jQuery] SimpleModal overlay does not cover entire screen
Your CSS is my first guess. I'm thinking that you've given your BODY (or HTML) element a set width and margins. Try using a wrapper element instead to create the content area. On Thu, Dec 24, 2009 at 8:36 AM, JavaEsse lugosam...@gmail.com wrote: Hello, I am using SimpleModal 1.3.3. In IE6, the overlay does not cover the entire screen. It looks like it is only covering the main content on the page. I've searched around but with no luck. Any ideas as to why this may be happening? Thanks.
Re: [jQuery] Jquery + ie7 spans
Does it work if the span does not have linebreak before it? On Wed, Dec 23, 2009 at 6:05 AM, Alex Mcauley webmas...@thecarmarketplace.com wrote: Morning and happy holidays!.. I am having some trouble with jQuery and IE7 quirks (suprise suprise).. Basically i wrote a script that truncates some text and when More Details is clicked - JQuery unhides the truncated text and adds a Less Details link at the bottom (which inturn hides the revealed text) .. This all works well in FF, Chrome, IE8 (shocker), Safari and pretty much every other browser i have tried. The trouble in IE7 is that the hidden (truncated) text lies in a span tag it wants to put the tag on a new line - quite annoying when it splits a word like this ... [Example - Before more details is clicked] This is some tex.. (More Details) [Example - When More Details is clicked] This is some tex t and here is some more text blah blah (Less Details) Yet in IE8/FF/Etc it looks like this... [Example - Before more details is clicked] This is some tex.. (More Details) [Example - When More Details is clicked] This is some text and here is some more text blah blah (Less Details) I have tried display:inline-block, display:inline and every combination i can think of but i cannot get the text to sit on one line in IE7 only... Here is the mark up... div id=list div class=entry Head of Web Analytics with excellent experience of web analytics and data analysis is required by a leading London based organisation. You should have an excellent grasp of web analytics tools such as Omniture, Hitwise, web trends, google analytics etc. Experience with data analysis, Excel and working with remote teams is also beneficial. If you have team leading experience then this would be advantageous but n span class=show-more-details...a href=/details/21427/More Details/a/span span class=more-details ot essential. Being highly analytical is a must and you should hold some sort of numerical degree. This is a fantastic role for one of Londons most dynamic and forward thinking companies. This is very much a team lead role; you shall be leading a team of online analysts and business analysts. Your role will be to give insight and recommendations for online strategies by analysing web statistics and other statistical information. This is a fantastic role that has massive scope for potential. You shall be working on a lot of exciting projects and you become an integral part of the business. My client is looking to pay a starting salary of between 55 66K + Benefits. a class=show-less-details href=#Less Details/a /span /div /div !-- End #list -- - Here is the jQuery that handles the clicks... $(#list .show-more-details).click(function(ev) { ev.preventDefault(); $(this).hide(); $(this).next(span.more-details).fadeIn(200); }); $(#jlist .show-less-details).click(function(ev) { ev.preventDefault(); var that=this; $(this).parents('.entry span').prev('.show-more-details').fadeIn (200,function(){ $(that).parent('span.more-details').hide(); $(that).parents('.entry span').prev('.show-more-details').show(); // IE8 Fix }); }); As i said it works in every other browser (haven't tested IE6 but i dont care about that)... Has anyone had this problem before and knows a fix ? Thanks in advance Alex
Re: [jQuery] Can't get onClick on appended elements
See here: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F On Tue, Dec 22, 2009 at 1:37 PM, Diego diegosvie...@gmail.com wrote: I have the following snippet of code: This is where I'll place the 'li' elements. ul id=file-list/ul After processing the file upload I add the elements like this: $(#file-list).append('li' + fileName + ' a href=' + filePath + ' class=fileimg src=attributes.gif alt= //a/li'); The thing is, I can't get the onclick event on those links, it just do nothing when I click on it. If I already have a ul id=file-listliMyFile a href=something.zip class=fileimg src=attributes.gif alt= //a/li/ul -- Works fine.
Re: [jQuery] question about width from li in
Check the options page. Does the 'nowrap' option help? http://jquery.malsup.com/cycle/options.html On Mon, Dec 21, 2009 at 6:50 AM, Lijn lijn.onl...@gmail.com wrote: I use this jquery-plugin: http://jquery.malsup.com/cycle/ Each li-tag gets a calculated width allowing the contents to 2 lines, but line 1 is sufficient. 2 lines breaks the design. The added width is not necessary. Is it possible NOT to add to this? Can anyone help me? It would be a great relief!
Re: [jQuery] unable to focus on textboxes - update panel - jqmodal - asp.net
I don't have anything handy to test this with but I believe you could handle this with the onHide callback. Check that the text element isn't empty. If it is, return false to keep the dialog open (and display a msg, etc.) On Sun, Dec 20, 2009 at 10:38 PM, Dexter varun.dex...@gmail.com wrote: 0 vote down star Hi, I have a jmodal popup which asks for name. One textbox and one button. Name is required hence it has required field validator on it. And the button and the textbox belong to same validation group. I click save button, which saves the name and closes the popup. The problem is that when the name is not entered, the popup closes, therefore the popup should not close but since i have jqm.Hide() on button's OnClientClick it closes. So what I did is I removed the jqm.Hide(), add a css class to button CloseJQMModal' and I try to close the popup myself from server when the save button is clicked. The code for that is: Sys.WebForms.PageRequestManager.getInstance().add_endRequest (CloseEndRequest); function CloseEndRequest(sender, args) { if ($(sender._postBackSettings.sourceElement).hasClass ('CloseJQMModal')) { $('.jqmOverlay').each(function() { $(this).remove(); }); } } This works, the popup closes and validators work. The only problem is, that after this i am unable to focus on any of the textboxes on the page. The cursor doesnt come in textboxes at all. I can still manipulate with dropdowns and buttons though but not textboxes! Although I can just right click and paste in any textboxes but i just cant type it myself or focus on textboxes. I have no idea why this is happening. Any ideas or suggestions will be really helpful. Thanks
Re: [jQuery] Re: jquery.cycle /// Next function in the next button and in the pictures
2009/12/21 Pedro Gonçalves pedrom...@gmail.com: If I assign the next id to another element function only works once. check it out: http://www.pvxg.net/unplanned/ What I want to do is for the user to be able to cycle through the pictures by clicking on them. This is what Charlie was trying to explain. You must not have elements on the page that share an ID. They must be unique. In this case, you should use a class. Also, you have this in your code: next:'#next', next:'#next2' I'm not sure, but I think that repeating the 'next' option would have undesirable results. As it is, the 'next' link does not work for me.
Re: [jQuery] Re: Can Tooltip return a jsp page?
On Sun, Dec 20, 2009 at 1:15 AM, HenryRock henryloke.myetr...@gmail.com wrote: Hi Brian, I get this return jsp:include page='legend-table.jsp'/; How come? How to fix that? Like I said, your file is not being parsed correctly. JSP is a server-side technology. Any JSP code must be evaluated on the server. If you're seeing JSP code in the page source (in your browser) then it wasn't properly evaluated before the web server sent it out to the client. It's the same as with PHP or Server Side Includes.
Re: [jQuery] Easy Fade in Problem...
Try putting the fadeIn() where the elements are being appended. Also, use hide() just before that. function addPerson() { //current keeps track of how many people we have. var strToAdd = 'div id=input class=ideaInputinput name=idea[] class=idea type=text/textarea name=description[] class=description/textarea/div'; $('#all-inputs').append(strToAdd).hide().fadeIn('slow'); }; $(document).ready(function() { $('#btnAdd').click(function () { addPerson(); }); }); And, if you don't need to call addPerson() from anywhere else, you could tighten this up even more: $(document).ready(function() { $('#btnAdd').click(function () { var strToAdd = 'div id=input class=ideaInputinput name=idea[] class=idea type=text/textarea name=description[] class=description/textarea/div'; $('#all-inputs').append(strToAdd).hide().fadeIn('slow'); }); }); On Sat, Dec 19, 2009 at 10:27 PM, Alex B alexbadal...@gmail.com wrote: Anyone know why it's not fading in the content? It's fully functional, but it just doesn't fadeIn.. function addPerson() { //current keeps track of how many people we have. var strToAdd = 'div id=input class=ideaInputinput name=idea[] class=idea type=text/' strToAdd += 'textarea name=description[] class=description/ textarea/div' $('#all-inputs').append(strToAdd); }; $(document).ready(function() { $('#btnAdd').click(function () { $(addPerson).fadeIn('slow') }); }); I apologize if this isn't the correct place to post this type of issue. It seems like this would be a great resource.
Re: [jQuery] Generate and submit file upload form with jQuery
Why don't you simply submit the form you are cloning from? It doesn't appear to me that you're adding anything to the new form. On Sat, Dec 19, 2009 at 10:57 AM, oli janoli...@gmail.com wrote: Hi, I want to collect some input fields that are already present in my DOM, generate a form with jQuery and submit it. Everything works fine, unless if one of those input fields is a type=file field. $(.trform .sendform).click(function(e) { e.preventDefault(); var form = $(this).closest(.trform); var method = form.find(:input[name=method]).val(); var action = form.find(:input[name=action]).val(); var enctype = form.find(:input[name=enctype]).val(); $(document.createElement('form')) .attr(method,method) .attr(action,action) .attr(enctype,enctype); .append($(:input,form).clone()) .submit(); }); If there is a file upload field, it's value after the submit is empty. Any suggestions what I could do? Regards, Jan Oliver
Re: [jQuery] Re: Generate and submit file upload form with jQuery
You could use divs instead of a table. Or use a TD with colspan=whatever and place another table inside of that (wrap the table with the form tag). On Sat, Dec 19, 2009 at 11:15 AM, oli janoli...@gmail.com wrote: .append($(:input,form).clone()) This line does add all the input fields inside the form element (which actually isn't a form) to the generated one. The thing is, that I have a table and need a form for every row (but not in a single column). formtr or trform aren't valid. So I'm looking for all input fields inside the tr and generate a new one... On Dec 19, 5:09 pm, brian zijn.digi...@gmail.com wrote: Why don't you simply submit the form you are cloning from? It doesn't appear to me that you're adding anything to the new form. On Sat, Dec 19, 2009 at 10:57 AM, oli janoli...@gmail.com wrote: Hi, I want to collect some input fields that are already present in my DOM, generate a form with jQuery and submit it. Everything works fine, unless if one of those input fields is a type=file field. $(.trform .sendform).click(function(e) { e.preventDefault(); var form = $(this).closest(.trform); var method = form.find(:input[name=method]).val(); var action = form.find(:input[name=action]).val(); var enctype = form.find(:input[name=enctype]).val(); $(document.createElement('form')) .attr(method,method) .attr(action,action) .attr(enctype,enctype); .append($(:input,form).clone()) .submit(); }); If there is a file upload field, it's value after the submit is empty. Any suggestions what I could do? Regards, Jan Oliver
Re: [jQuery] Can Tooltip return a jsp page?
It's been awhile since i used JSP but the first thing I'd check is if the content was parsed correctly. When you view source, do you see the content in the JS code or do you see the JSP tag? If the latter, your JSP code isn't being parsed on the server. On Sat, Dec 19, 2009 at 10:31 AM, HenryRock henryloke.myetr...@gmail.com wrote: The tooltip plugin I refer to is http://jquery.bassistance.de/tooltip/demo/ One of the function is return a HTML tag. $('#tonus').tooltip({ delay: 0, showURL: false, bodyHandler: function() { return $().attr(src, this.src); } }); Now I have a FIXED and LONG ( Table of Legend )html tag to return from function above. I try to put the html to another jsp. Then point the return to that jsp as below: Example: $('#tonus').tooltip({ delay: 0, showURL: false, bodyHandler: function() { return jsp:include page='legend-table.jsp'/ } }); The content of the legend-table.jsp as below: table trtdBlue/tdtdWater/td/tr trtdRed/tdtdFire/td/tr trtdGreen/tdtdTree/td/tr trtdWhite/tdtdCloud/td/tr ... /table The code above not working I guess the bodyHandler function cannot use include page. ANy Idea? Thanks
Re: [jQuery] Change Window Location, and Send REQUEST or POST Info?
I would do all of this server-side. Have your PHP script save the requested page in the session before redirecting to the login page. Or, write the requested URL to a hidden input in the login form. On Sat, Dec 19, 2009 at 6:16 PM, Vik v...@mindspring.com wrote: Let's say a user visits my site, and takes an action that requires him to be logged in. I would like to: - Take him to the login page - Automatically return to the page he started from after he logs in So I need to capture the current window.location, which is easy (var returnURL = window.location) and communicate it to my app. I can't use URL variables (e.g. ?returnURL=http://www.returnlocation.com), because I'm using CodeIgniter, so I need to pass the returnURL in a POST or REQUEST variable. Is there a way to do this? Thanks in advance to all for any info.
Re: [jQuery] Re: Can Tooltip return a jsp page?
With the JSP include in place, when you view source and look at the javascript block, do you see: return divtable trtdBlue/tdtdWater/td/tr trtdRed/tdtdFire/td/tr trtdGreen/tdtdTree/td/tr trtdWhite/tdtdCloud/td/tr /table/div; ... or do you see: return jsp:include page='legend-table.jsp'/ If the latter, then your file is not being parsed correctly *on the server* and this is not a jQuery issue. On Sat, Dec 19, 2009 at 7:50 PM, HenryRock henryloke.myetr...@gmail.com wrote: It work if I code it as below: $('#tonus').tooltip({ delay: 0, showURL: false, bodyHandler: function() { return divtable trtdBlue/tdtdWater/td/tr trtdRed/tdtdFire/td/tr trtdGreen/tdtdTree/td/tr trtdWhite/tdtdCloud/td/tr /table/div; } }); I not sure why when I code it as $('#tonus').tooltip({ delay: 0, showURL: false, bodyHandler: function() { return jsp:include page='legend-table.jsp'/ } }); It not working... Any Idea? Thanks On Dec 20, 2:51 am, brian zijn.digi...@gmail.com wrote: It's been awhile since i used JSP but the first thing I'd check is if the content was parsed correctly. When you view source, do you see the content in the JS code or do you see the JSP tag? If the latter, your JSP code isn't being parsed on the server. On Sat, Dec 19, 2009 at 10:31 AM, HenryRock henryloke.myetr...@gmail.com wrote: The tooltip plugin I refer to ishttp://jquery.bassistance.de/tooltip/demo/ One of the function is return a HTML tag. $('#tonus').tooltip({ delay: 0, showURL: false, bodyHandler: function() { return $().attr(src, this.src); } }); Now I have a FIXED and LONG ( Table of Legend )html tag to return from function above. I try to put the html to another jsp. Then point the return to that jsp as below: Example: $('#tonus').tooltip({ delay: 0, showURL: false, bodyHandler: function() { return jsp:include page='legend-table.jsp'/ } }); The content of the legend-table.jsp as below: table trtdBlue/tdtdWater/td/tr trtdRed/tdtdFire/td/tr trtdGreen/tdtdTree/td/tr trtdWhite/tdtdCloud/td/tr ... /table The code above not working I guess the bodyHandler function cannot use include page. ANy Idea? Thanks
Re: [jQuery] Re: Change Window Location, and Send REQUEST or POST Info?
Just start a session by default for any user. Once the user has logged in, create a new session or simply write new values to it. When the user requests a page, some code of yours must be evaluating whether a login is necessary. Ergo, the URL is known to your script. So, you can then write the URL to the session and pick it up after redirecting to login. I'm only vaguely familiar with CodeIgiter but CakePHP can do this automatically. Perhaps you should check to see if CI has the same functionality. On Sat, Dec 19, 2009 at 8:42 PM, Vik v...@mindspring.com wrote: There is no session yet; the user has not yet logged in. There is no way to write the requested URL to a hidden input in the login form, because the login form isn''t up yet - the user is visiting some other page. On Dec 19, 3:58 pm, brian zijn.digi...@gmail.com wrote: I would do all of this server-side. Have your PHP script save the requested page in the session before redirecting to the login page. Or, write the requested URL to a hidden input in the login form. On Sat, Dec 19, 2009 at 6:16 PM, Vik v...@mindspring.com wrote: Let's say a user visits my site, and takes an action that requires him to be logged in. I would like to: - Take him to the login page - Automatically return to the page he started from after he logs in So I need to capture the current window.location, which is easy (var returnURL = window.location) and communicate it to my app. I can't use URL variables (e.g. ?returnURL=http://www.returnlocation.com), because I'm using CodeIgniter, so I need to pass the returnURL in a POST or REQUEST variable. Is there a way to do this? Thanks in advance to all for any info.
Re: [jQuery] Re: SlickGrid updates!
This is very impressive. One might even call it ... slick. Very slick, indeed. I really like show tasks percentage slider. And the SparkLines example. Well done! On Thu, Dec 17, 2009 at 6:41 PM, Tin michael.leib...@gmail.com wrote: The SlickGrid source code has been migrated to GitHub: http://github.com/mleibman/SlickGrid
Re: [jQuery] Call from Javascript to jQuery javascript function
On Wed, Dec 16, 2009 at 9:17 AM, Richard D. Worth rdwo...@gmail.com wrote: No need to add another block. As you pointed out earlier, the document ready won't run until later. By the time it does, the callit function will have been defined: That's true, but I left it as 2 blocks because Wendi pointed out that some of the code was generated by another part of the app. That's why I explained that there can be more than one ready() block on a page. I should have clarified that.
Re: [jQuery] Call from Javascript to jQuery javascript function
On Wed, Dec 16, 2009 at 11:14 AM, Michael Geary m...@mg.to wrote: In fact, within a single script tag, function definitions happen first, before any code in that script tag is executed. That's an excellent point. I was busy thinking about deferred execution and forgot about that.
Re: [jQuery] Urgent help with the validation plugin: no reaction onSubmit
You might need to post some code. Are you using the submitHandler option at all? On Wed, Dec 16, 2009 at 7:06 AM, Andre Polykanine an...@oire.org wrote: Hello everyone, There's a form I try to validate. As there is a Nickname field, I check with the Remote method if it's already used or not. I use a php file that forms a query to the MySql database asking if the nickname entered from keyboard is equal to the nickname I pass to the file (I get it earlier), I mean, the nick that is already taken by the user. Everything works flawlessly and well, but there is one case when the form does submit but does not validate properly: if we go to the page, change something but not the Nickname and then press Submit. So, the Remote method does work onBlur and onChange but not onSubmit. Now I'm focusing the Nickname field on the ready state: $(#unick).focus(); So the user lands on the Nickname itself just when he/she is on the settings page. but it's not too nice, don't you think so? So I wonder: why the validation plugin doesn't send the Ajax request onSubmit, also? Thanks! -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule
Re: [jQuery] [ASK] jquery remove
On Mon, Dec 14, 2009 at 11:08 PM, water [bro] mm waterb...@gmail.com wrote: and if click remove, jquery just remove a link remove not tag p please help me. That is because the this inside your click handler function refers to the link (because the handler is onclick for the link) even though, outside of that, it refers to #droppable. Try changing this: removeLink.onclick = function() { $(#droppable).children('p').remove(#+lid[0].id); $(this).remove(); } ... to this: removeLink.onclick = function() { $(#+lid[0].id).remove(); } If the IDs are unique this should work fine, as jQuery will find the P directly instead of finding it through #droppable.
Re: [jQuery] Viewport Scroll
There are probably more than one way to do this with jQuery but a straight JS way would be to do: document.location = '#id_of_your_element'; On Tue, Dec 15, 2009 at 2:42 PM, Wroathe reallyto...@gmail.com wrote: Hi there! I'm using jQuery to load in some content from a separate page and I was wondering if there was a way to make the browser viewport scroll down to the element I'm adding in by using jQuery or Javascript?
Re: [jQuery] How to programmatically ad a div element and animate it
Try this: function CreateNewElement() { $('div id=div1test content/div') .appendTo('#contentContainer') .hide() .toggle('slow'); } You'll likely want to change the ID and, obviously, the content. But the principal i the same--jQuery can take the string markup and create the element on the fly. Note that the hide() is necessary. Otherwise, the toggle() will hide the element as it will be visible by default. On Tue, Dec 15, 2009 at 11:29 AM, Ham grahamhw...@googlemail.com wrote: Hi, Im new to Jquery and have been trying to dynamically create a new div element with document.createElement. I can successfully insert this element into the dom but I want to animate it on creation. After inserting the element into the DOM i try and access it using a JQuery selector but it does not seem to find it. Example code. function CreateNewElement() { var container = $(#contentContainer); var myDiv = (document.createElement('div')) myDiv.setAttribute(id, div1); myDiv.innerHtml = test content; container.appendChild(myDiv); $(div1).toggle(slow); } Any help greatly appreciated. Many Thanks Ham
Re: [jQuery] Call from Javascript to jQuery javascript function
You have the order of things backward. As the page loads, any bare JS function calls will be run as soon as they are reached. So, when the line with callit() is reached, the JS engine will attempt to run the function immediately. However, the function has yet to be defined. That's because you have the definition inside of $(document).ready(), which will not be evaluated until the document has fully loaded. So, the answer is to not put the callit() definition inside of $(document).ready(). Just ensure that it is defined before the function call. script type=text/javascript $(document).ready(function() { // whatever stuff needs to occur when the doc is loaded }); // will be defined immediately function callit() { alert(Hello world!); } /script script type=text/javascript // will be called immediately callit(); /script And, if you'd like callit() to be run only when the document is fully loaded, just wrap the call in another $(document).ready() block: script type=text/javascript $(document).ready(function() { // whatever stuff needs to occur when the doc is loaded }); // will be defined immediately function callit() { alert(Hello world!); } /script script type=text/javascript $(document).ready(function() { // will be run when doc is loaded callit(); }); /script You can have as many different $(document).ready() as you want. All they do is, essentially, assign bits of code that should be run once the document is fully loaded. On Tue, Dec 15, 2009 at 8:23 PM, Wendi Turner wenditur...@gmail.com wrote: I am trying to call a jQuery loaded javascript function by a static javascript function on the html page... and I cannot get it to trigger. If I tie the jQuery function to $('a').click( loadSomething ); Then it works. But I want to be able to call the function from a resident script??? html head script type=text/javascript ... added/generated by c# $(document).ready(function() { function callit() { alert(Hello world!); } ... }); /script script type=text/javascript ... on asp.net Default.aspx page callit(); /script /head body /body /html
Re: [jQuery] Can't get a block of HTML added to the DOM
$('#somediv').append(html); You're appending to the div with ID 'someDiv'. But you say that this is the content: div class=somediv form id=someform p class=someclassName:/p input style=display: none; type=textbox name=somefield value=test / /p /form /div Note the class=somediv. I'm wondering if that's a typo and it's actually id=somediv, in which case you'll have 2 divs with identical IDs. Just a shot in the dark. On Mon, Dec 14, 2009 at 11:05 AM, joseph7 radioak...@gmail.com wrote: Hi, So, I'm attempting to add HTML to a document via Ajax, but when I get back the content, I'm finding that no matter what I try, I can't get it added to the DOM correctly. Basically I'm doing this: $.post('ajax.php', function (data) { var html = data.content; $('#somediv').append(html); } ); The HTML I'm loading looks like this: div class=somediv form id=someform p class=someclassName:/p input style=display: none; type=textbox name=somefield value=test / /p /form /div While the content does show up in the div, if I try to get the form by doing $('#someform'), jQuery returns nothing. I've tried using .append () and .html(), and neither way gives me what I want. Is there something I'm missing here? I know adding objects to the DOM in jQuery is ridiculously easy, so I feel like I'm either running up against something impossible, or I have a hugely flawed concept of how append () and html() work.
Re: [jQuery] delete / remove $.ajax() object ???
Put your $.ajax() call inside a function and call that on load and whatever other event. On Mon, Dec 14, 2009 at 8:18 PM, Wendi Turner wenditur...@gmail.com wrote: Thank you Mike ! Repost Question: How can you remove/delete the active $(document).ready() script, re-write and re-register then re-trigger the ready script?? Without reloading the page? I have an anonymous $.ajax( function ( blah blah) ) created in the $document.ready() object. I want to reload the $.ajax () object on a client event. How can I do this best? Michael Geary m...@mg.to Wendi, just a tip to help you get the assistance you're looking for: Since your question doesn't seem to relate to the topic of this particular thread, people may not notice it.
Re: [jQuery] FadeOut Ajax Post FadeIn problem
I believe the sudden appearance is due to the fact that the new div was not hidden. But, a better approach would be to not replace the #pageArticle div. Instead, replace its contents, then fade it in. On Fri, Dec 11, 2009 at 5:02 PM, S9DD david.c@virgin.net wrote: Hi Folks This script fades out a div tag with id #pageArticle, gets fresh content from an anchor ajax post, and is Supposed to fade the new content in. But it won't handle from replaceWith onwards properly. New content just suddenly appears. Is there a way to get around this? I have tried opacity and hidden styles in the new div but I get an empty screen. Guess fadeIn doesn't use those values, or the style is overriding fadeIn's effect. Help!! // Substitutes the URL called from all a in menu $(#menuJ a).click(function() { var js = $(this); $(#pageArticle).fadeOut(500, function() { $.post( js.attr(href), null, function(response) { var bob = div id=\pageArticle\ + response + /div; $(#pageArticle).replaceWith(bob); $(#pageArticle).fadeIn(500); }, html); }); return false; }); Thanks in advance. New to this game.
Re: [jQuery] Help... anyone!
I'm not sure I understand in what sense the page is freezing sometimes. I've had a look in FF (Linux) and haven't seen anything untoward. It could be that you've specified that the page never be cached. Try removing that, clear your cache, and click around some. You do have a fair number of JS files to load. I don't see any reason to unbind the click event for that other link. Also, you might want to remove the outline from the jCarousel back/forward buttons. If so, have a look at this and adjust for your needs: http://css-tricks.com/removing-the-dotted-outline/ On Mon, Dec 7, 2009 at 3:44 PM, Mike mike.croteau1...@gmail.com wrote: Before I dive into my issue, I just finished reading Learning jQuery 1.3 and decided to go full fledged and create my first site implementing jQuery only! I had a little experience before this but found that jQuery is a lot of fun and easy to implement, even for a semi noob. (maybe a total noob after you read about my issue) However, I am have a page freeze issue and I am not sure why or how to track down. In this site, I am using Cufon for custom text replacement, DD_belatedPNG fix for transparent pngs in IE and jQuery for all my pretty UI enhancements. Being new, I have a feeling that I am leaving something open, maybe not unbinding an element or maybe my implementation of all 3 is out of whack... I dont know. Has anyone run into an issue like this where their page freezes from time to time? When accessing in IE, Safari, Opera and Chrome... no freeze. It seems to happen on 1 page most of the time. I have jCarousel Lite, Cufon, DD_belated, and some custom jQuery code running. I have a subscribe button that submits a form and I set it up as $('a#button').click(function(){ dosomething(); } Am I suppose to unbind this? Also when ever someone clicks on a left or right toggle on my jCarousel Lite plugin, I call Cufon.replace() on top of the base interaction for those toggle buttons. if(replacefont){ $('div.toggles a').click(function(e){ Cufon.replace('#slides h1, #slides a'); }); Cufon.replace('h1, h2, h3, h4, h5, #slides p, a.buttons, #quote p, b, #main-menu a, .container p'); } The web template I am working on can be found here: http://themeforest.gfunkmedia.com/comercia-web/lite/index.html I have not been able to duplicate the issue on demand... but think it happens on the home pages and if you click on home multiple times it may happen. I disabled right click, so if you would like to see code, please let me know. Much appreciated to the jQuery guys and enthusiasts! Best Mike
Re: [jQuery] Selector fails and works
I believe this is the problem: input[type=radio][checked=true] The correct value for the checked attribute is checked, not true (don't ask me why; I think it's a stinker), so jQuery comes up empty-handed. Whereas the other way you're approaching this: if (this.checked) ... works because you're testing for a (boolean) property that is assigned by jQuery *after* it has used your more general selector to create a list of objects. A simpler way to approach this would be to use some of jQuery's built-in selector goodness: $('#selected_courses .course input:radio:checked') However, note that you drop '.course' from this if there are never any other radio buttons within #selected_courses but outside of a .course div. On Mon, Dec 7, 2009 at 4:40 PM, Beardsley Ruml b...@ruml.com wrote: Sorry that this take a while to demonstrate but it's a complete puzzle (to me)! I would like to determine whether there are any checked radio buttons within the div selected_courses in the following HTML: div id=selected_courses div class=course input type=radio name=1st .. / [ 5 more radio buttons] /div [ 2 more courses ] /div When the code below is executed, there are 3 selected courses; since each course has six radio buttons, there are 18 radio buttons. When I add the further qualification to select only the checked radio buttons, the reponse is zero buttons (although there are in fact 3 checked buttons). However, if I approach the search in another more roundabout way -- by examining each of the radio buttons in turn to determine how many are checked, the answer is the correct one: 3 (one within each course). Notice that within the following each loop, I look among the selected_courses for an input element with a specified name which is checked and *that* doubly conditioned selector works as expected; that is, the if statement is executed. So why does the double condition on the input selector fail the first time and succeed the second time Perhaps relevant: When I replace: $('#selected_courses .course input[type=radio][checked=true]') with $sel_courses.find('input[type=radio][checked=true]') the selection works. Is there some difference between three levels of selection criteria without an initial jQuery object and using find() to apply a single criterion to an existing jQuery object? Code: if (ui.panel.id == final_ordered_list) { console.log(Clicked on Final Ordered List tab:); var $sel_courses = $(#selected_courses .course); console.log(Have + $sel_courses.length + selected courses.); var $radio_buttons = $('#selected_courses .course input[type=radio]'); console.log(Have + $radio_buttons.length + radio buttons.); var $chked_radio_buttons = $('#selected_courses .course input[type=radio][checked=true]'); console.log(Got + $chked_radio_buttons.length + straight checked radio buttons.); var checked_radio_buttons = 0; $radio_buttons.each(function() { if (this.checked) checked_radio_buttons += 1; }); console.log(Got + checked_radio_buttons + roundabout checked radio buttons.); if (checked_radio_buttons 0) { console.log( + $sel_courses.length + selected courses); console.log( + checked_radio_buttons + checked radio buttons); $.each([1st,2nd,3rd,4th,5th,6th], function(index, curr_ordinal) { // if there is a course with the curr_ordinal radio button checked // (can only be one), then copy to Final Ordered List; var $checked_radio_button = $sel_courses.find('input[name=' + curr_ordinal + '][checked=true]') if ($checked_radio_button.length 0) { // do something; } }); }); }); Console output: == Clicked on Final Ordered List tab: Have 3 selected courses. Have 18 radio buttons. Got 0 straight checked radio buttons. Got 3 roundabout checked radio buttons. 3 selected courses 3 checked radio buttons Many thanks for any insights into what's happening! B Ruml
Re: [jQuery] : FileUpload Problem
See here: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F And you're loading the MultiFile plugin twice. You need either MultFile.js or MultiFile.pack.js, but not both. Also, keep in mind that you're cloning an element with an ID, which must always be unique. But it looks to me like you're trying to do something that's unnecessary. Why are you cloning anything at all? On Mon, Dec 7, 2009 at 2:45 PM, jayakumar ala alajay...@gmail.com wrote: Hi All, I am using the following code to upload file and add the file tag dynamically for my application. Jquery doen't seem to be working for the dynamically added file. Any help is appreciated. html script type=text/javascript src=js/jquery.js/script script type=text/javascript src=js/jquery.MultiFile.js/script script type=text/javascript src=js/jquery.MultiFile.pack.js/script script language=javascript var intVal = 1; function addUploadFile() { var innerinVal = ++intVal; var divTagVal = divTagTemplate.cloneNode(true); document.getElementById('outerVal').appendChild(divTagVal); } /script form action=doUpload enctype=multipart/form-data method=post div id=outerVal p Type some text (if you like):br input type=text name=textline size=30 /p p id=addVal1 Please specify a file, or a set of files:br input type=file class=multi id=test1 name=datafile size=40 /p div input type=submit value=Send input type=button class=button value=Add File onclick=javascript:addUploadFile(); id=addFileButton / /div /div /form script var divTagTemplate = document.getElementById('addVal1').cloneNode(true); /script /html
Re: [jQuery] Problem with images loaded dynamically
Can you see the images ok if you type in the direct URL for each one? On Mon, Dec 7, 2009 at 2:35 PM, jlee patrykk...@gmail.com wrote: Hi, I'm stuck here - I'm trying to load images dynamically on my website, but for some reason the method I use works on a server on my local computer, but behaves very strangely on a remote server... I use this code to load the images: function replaceImage(imgName, container) { $j(container).hide(); //so it fades out once the image has loaded $j(container).image(imgName, function() { //this is a simple plugin, i'll paste it's code below if(container != #galImage) { //if it's a thumbnail, i want to be able to click on it $j(container).empty().append(this).wrap(a href=\#\/a); } else { //it's not a thumbnail, so no a wrapper $j(container).empty().append(this); } $j(container).fadeIn(); //finally, show the image }); } The simple plugin for loading images into a container: $.fn.image = function(src, f){ return this.each(function(){ var i = new Image(); i.src = src; i.onload = f; this.appendChild(i); }); } This code is used like this: replaceImage('images/' + imgName, 'imgCont1'); As I said, everything works just fine on my machine with apache server installed. But, when I open the website located on a server, it turns out that most images don't appear at all, and the ones that do show up are severely distorted... Does anybody know what could cause that? Here's an example of such distorted image: http://www.eurydicesite.info/error.jpg The non-working site is available here: http://www.eurydicesite.info - when you click on portfolio, 9 thumbnail images should appear to the left, but they don't.
Re: [jQuery] Having issues with selecthing $(this).find('.classname') with webkit browsers (Chrome/Safari)
How about this? $('.secondlevelcontainer', $(this)).fadeIn(500); On Mon, Dec 7, 2009 at 3:34 PM, Leonard Teo teo.leon...@gmail.com wrote: Hi guys, I'm looking for a workaround... I'm having some issues with the following code: //Navbar hover $('.toplevel').hover( function(event){ $(this).find('.secondlevelcontainer').fadeIn(500); -- doesn't work in Safari/Chrome }, function(event){ $(this).find('.secondlevelcontainer').fadeOut(500); -- doesn't work in Safari/Chrome } ); //navbar hover Basically, it doesn't work in Safari and Chrome. Works fine in Firefox and Internet Explorer. Is there a better way to do the above code that works cross platform? Thanks! Leonard
Re: [jQuery] Re: Help... anyone!
On Tue, Dec 8, 2009 at 1:48 PM, Mike mike.croteau1...@gmail.com wrote: Thanks for the response. I was unable to find where to set firefox to clear cache automatically. I went to about:config ... found some cache settings, but not clear settings. Edit Preferences Advanced Network Clear Now I can duplicate the issue. If you click on home then About then back to home and do it rather quickly numerous times. At one point it freezes. Now I know most users wont interact like this... but it makes me think that there is an issue with either Cufon, my Script or my implementation. So, still having issues. Please try what I mentioned above to see if you run into the same problem. I don't see anything. I still don't know what I'm looking for. When you say the page freezes, do you mean it doesn't complete the load? Things don't work? Something else? The pages do take a while to load but that's not unusual given you've specified no caching.
Re: [jQuery] Specify CSS Path
JQuery doesn't need to read your CSS files. That's the job of the browser engine. What's the problem you're trying to solve? On Sat, Dec 5, 2009 at 8:28 PM, Juan B jmsbelt...@gmail.com wrote: Hi, My JQuery scripts and CSS files are placed in different folders. Is it possible to specify the paths to my CSS files in my JQuery scripts so it can recognize its classes? Thanks
Re: [jQuery] jquery addClass does not work in ajax call
Please see: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F You could simply create a function that takes a jquery object (or the selector) as a param and does the striping. That way, you could call the function whenever necessary. Note, too, that you might be able to reduce that to one line by dropping either one. If you style the table to begin with using the 'even' rules, when jQuery then applies the 'odd' class, you'd end up with the same result. On Sun, Dec 6, 2009 at 10:26 AM, doctor atcdoctorh...@gmail.com wrote: I have the content with stripped odd and even bar. It works fine except when the data of div id=sc_body comes from ajax. In the following sample code, if I click the menu1, the content is updated with html but the stripped class will not fit into. That means odd and even class are not added to. I need to the following two lines again after $(#sc_body).html(msg); in the .ajax {} call. $('.strip tr:not([th]):odd').addClass('odd'); $('.strip tr:not([th]):even').addClass('even'); Is there any other method to overcome this problem ? testajax.php !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http:// www.w3.org/TR/html4/loose.dtd htmlhead ?php echo meta http-equiv=\content-type\ content=\text/html; charset=utf-8\; ? script type=text/javascript src=lib/jquery/jquery.js/script script $(document).ready(function() { $('.strip tr:not([th]):odd').addClass('odd'); $('.strip tr:not([th]):even').addClass('even'); $('#sm_cmd a').click(function() { $.ajax({ type: get,url: testajax2.php,data: op=menu1, success: function(msg){ $(#sc_body).html(msg); } }); }); }); /script style type=text/css #sm_main {margin:0; padding:5px 10px 5px 10px;} #sm_body {border:2px solid #2F5376; padding:5px; background- color:#ECECEC; font-size:1em;} #sm_cmd {text-align:center;} #sb_main {margin:0; padding:5px 10px 5px 10px;} #sf_body {border:2px solid #2F5376; background-color:#ECECEC; font- size:1em;} #sc_body {font-size:1em; text-align:left;} .strip tr.odd td {background-color: #e9e9e9; padding: 3px;} .strip tr.even td {background-color: #dee3e7; padding: 3px;} /style /head body ?php $content = table width=\100%\ class=\strip \tbodytrtditem1/td/trtrtditem2/td/tr/tbody/ table; outputPage($content); echo /body/html; return; // output full page function outputPage($content) { $cmd = a href=\#\menu1/a; ? table width=100% cellspacing=0 cellpadding=0 border=0 tbody trtd id=sm_main div id=sm_body table width=100% cellspacing=0 cellpadding=0 border=0 tbody trtd id=sm_cmd?php echo $cmd;?/td/tr /tbody /table /div /td/tr trtd id=sb_main div id=sb_body table width=100% cellspacing=0 cellpadding=0 border=0 tbody trtd id=sf_main div id=sf_body style=display:none; opacity:0; visibility:hidden; /div /td td id=sc_main div id=sc_body ?php echo $content; ? /div /td /tr /tbody /table /div /td/tr /tbody /table ?php } ? testajax2.php ?php $content = table width=\100%\ class=\strip \tbodytrtditem3/td/trtrtditem4/td/tr/tbody/ table; echo $content; ?
Re: [jQuery] Script stops working
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F On Sun, Dec 6, 2009 at 3:00 PM, factoringcompare.com firstfacto...@googlemail.com wrote: Hi, The below script collects a links ID when clicked and then posts via ajax. Works fine on plan page. When I dynamically load links dynamically via ajax the script stops working. The ajax page is collecting information via ASP so I don’t have any Jquery script issues. I can’t work out why its stops working. script language=javascript jQuery(document).ready(function(){ $('.calendarLink').click(function(ev) { var prefix = 'date_'; var date = this.id.substring( ( prefix.length ) ); $.ajax({ type: POST, url: test.asp, data: date=+date, success: function(msg){ $('#result').html(msg); } }); }); }); /script a href=# class=calendarLink id=date_20081010Click/a div id=result/div
Re: [jQuery] Filtering table cell values
Try this: jQuery('#Directorships tbody tr').each(function() { if (jQuery('td:nth-child(7)', $(this)).text().toLowerCase() == 'retired') { var td12th = jQuery('td:nth-child(12)', $(this)); if (td12th.text() == '0') { td12th.addClass('bgHighlight'); } } }); I added tbody to the selector so it'll ignore the head or foot if you have them. If you don't, just remove that. You want to avoid using '#Directorships' in the selector with your each() function because the context is already a specific row. So, we add $(this) as the 2nd param of jQuery() to say that we're looking for the 7th (or 12th) td of THIS row. Also, the test for 0 uses the string '0' to avoid any equivalence weirdness (since text() returns a string anyway). I suggest that you set a class ('Retired' or 'Active') on your 7th cell instead of relying on a comparison of the string content. That would also make it much simpler to select rows for highlighting. On Sun, Dec 6, 2009 at 5:55 PM, evanbu...@gmail.com evanbu...@gmail.com wrote: I'm using this code hightlight any table cell in the 12th column with a value of zero which works well. //SharesHeld jQuery('#Directorships tr').each(function() { jQuery('#Directorships td:nth-child(12)').filter(function() { if (jQuery(this).text() == 0) jQuery(this).addClass(bgHighlight); }); }); I need to make this a bit more complex by hightlighting any table cell in the 12th column with a value of zero except those rows with a value of 'Retired' in the 7th column. I tried this approach below but if any value in the 7th column has a value of 'Retired' then none of the cells in the 12th get highlighted. I need to to evaluate it on a row- by-row basis rather than the entire column. In other words, I just want to exclude anyone who is retired. //SharesHeld jQuery('#Directorships tr').each(function() { jQuery('#Directorships td:nth-child(12)').filter(function() { if ((jQuery(this).text() == 0) ('#Directorships td:nth-child (7)').not(':contains(Retired)')) jQuery(this).addClass(bgHighlight); }); }); In this example, the first 2 zeros in the 1st and 2nd rows should be highlighted but the third one should not be. Column7 Column12 Active 0 (highlighted) Active 0 (highlighted) Retired 0 (not highlighted) Thanks
[jQuery] jquery [multi] overlay plugin and identifiers
I'm using the jquery overlay plugin to launch a video using flowplayer. I want to pass dynamic text to the script so that I only have to use 1 script for all the videos on one page. I have the following code but am having trouble getting the identifier relative to the current overlay. Does anyone have any ideas? pa rel=#overlay4 href=# cta='pa href=http://domain.com/;Visit this trial/a/p'/p div class=overlay id=overlay4div class=player a class=fplayer href=path/to/video.flv /a /div/div script type=text/javascript language=javascript $(function() { $(a[rel]).overlay({ closeOnClick: true, finish: { top: 30 }, onBeforeLoad: function() { this.getBackgroundImage().expose({color: '#444'}); cta = $(this); console.log(cta); this.getContent().find(a.fplayer).flowplayer(0).load(); }, onLoad: function(content) { }, onClose: function() { $.expose.close(); $f().unload(); } }); flowplayer(a.fplayer,/flowplayer/flowplayer.commercial-3.1.0.swf, { key: '#...@a5e90fa94bbc2d7d51a', clip: { scaling: 'fit', onCuepoint: [[2000], function() { //if (this.attr(cta)) { var myContent = this.getPlugin(myContent); myContent.show(); myContent.setHtml(cta); //} }] }, canvas: { background: '#00', backgroundGradient: 'none', }, plugins: { myContent: { url: '/flowplayer/flowplayer.content-3.1.0.swf', top: 20, width: 300, borderRadius: 10, display: 'none' } } }); }); /script My question is, how can I retrieve the attribute cta of the current overlay? I know how to do this if it was just using the onclick even in jquey (it would be as simple as $(this) but that doesnt seem to be the case with the overlay script. Returns an object as the value of $(this). Thanks Brian
[jQuery] IE javascript error Expected identifier, string or number but works as intended in FireFox
I have the following code that works fine in FireFox but throws an error that prevents it from working in IE. The area that is throwing the error is bolded below. I am assuming is something small I am missing. Thanks for your help in advance. $(document).ready(function () { $(a.triggoverlay).click(function() { destination = $(this).attr(href); cta = $(this).attr(rel); $(#overlay a).attr(href, destination); flowplayer(a.fplayer,/flowplayer/flowplayer.commercial-3.1.0.swf, { key: '#...@xxx', clip: { scaling: 'fit', *onCuepoint: [[-2000], function() { if (cta) { var myContent = this.getPlugin(myContent); myContent.show(); myContent.setHtml(cta); } }]* }, canvas: { background: '#00', backgroundGradient: 'none', }, plugins: { myContent: { url: '/flowplayer/flowplayer.content-3.1.0.swf', top: 20, width: 300, borderRadius: 10, display: 'none' } } }); $(#overlay).overlay({ closeOnClick: true, finish: { top: 30 }, onBeforeLoad: function(content) { this.getBackgroundImage().expose({color: '#444'}); this.getContent().find(a.fplayer).flowplayer(0).load(); }, onLoad: function(content) { }, onClose: function(content) { $.expose.close(); $f().unload(); $('#overlay').unbind().removeData(); } }); $(#overlay).overlay().load(); return false; }); });
Re: [jQuery] IF and NULL. Please, could someone help me out?
Does this work? $(#JPlayer).jPlayer({ ready: function() { var cookie = $.cookies.get(AlliedSkills.Player); $(this).setFile($('#MusicPath').attr(value)) if (cookie == Play) { $(this).play(); } }, swfPath: $('#JPlayerPath').attr(value) }); Note the '==' (not '='). On Wed, Dec 2, 2009 at 7:20 PM, shapper mdmo...@gmail.com wrote: Hello, I have the following: $(#JPlayer).jPlayer({ ready: function() { $(this).setFile($('#MusicPath').attr(value)).play(); }, swfPath: $('#JPlayerPath').attr(value) }); I would like the play the file: $(this).setFile($('#MusicPath').attr(value)).play(); Only if ( $.cookies.get(AlliedSkills.Player) = Play ) If ($.cookies.get(AlliedSkills.Player) is null then do not play and set only the file: $(this).setFile($('#MusicPath').attr(value)); Could someone please help me in doing this? Thanks, Miguel
Re: [jQuery] contact form not sending mail
Javascript doesn't send email. You'll have to investigate this server-side. On Wed, Dec 2, 2009 at 1:52 PM, wig1176 wig1...@verizon.net wrote: hi folks. I have a site using jquery utilizing a slider ( scroll.to) and form validater (validate) the form on my page isn't sending the emails to me though. here's the link: http://jugdish.net/mpuglia/home.html the form is on the contact page. if anyone can figure this out, i would greatly appreciate it. i went over the code a million times and cant' find the mistake. thanks wiggy
Re: [jQuery] get random record?
On Tue, Dec 1, 2009 at 4:33 AM, Michel Belleville michel.bellevi...@gmail.com wrote: If I were you I wouldn't let JavaScript do the randomizing, I would do it server-side instead, providing a request that returns a random record and pinging it with a simple AJAX query ; this way, JavaScript doesn't need to be aware of what you want to send and it doesn't select the id client-side (without the database nearby). I agree with Michel. Keep the javascript a simple request with no params and let the server script (or even the DB) do the randomising.
Re: [jQuery] Ajax response back question
I'm not sure if you're trying to send back the image or just the src but, either way: $(function() { $('li').each(function() { var self = this; $.post('getImg.php', {id: $(self).attr('id')}, function($data) { // ${self} refers to the li element }); }); }); On Tue, Dec 1, 2009 at 7:58 AM, David .Wu chan1...@gmail.com wrote: ul li id=1/li li id=2/li li id=3/li /ul $(function() { $('li').each(function() { var $id = $(this).attr('id'); $.post('getImg.php', {id: $id}, function($data) { // How to do it? }); }); }); I want to let each li use ajax load their own image and put into thierself, the result shold like below, but if I user $.post, I don't know how to put it to the right li. ul li id=1img src=1.jpg/li li id=2img src=2.jpg/li li id=3img src=3.jpg/li /ul
Re: Re[jQuery] move appended element
I suppose you could use removeAttr('class'). But I wonder why this is a problem, in any case. Why is the class= giving you problems? On Sat, Nov 28, 2009 at 8:13 AM, coldwired co...@coolwired.net wrote: Hi, The tag is removed but a remendant of it remains, class=. is there anything I can do to make the removeClass function restore the attribute to it's original state? Thanks, Colin. brian ally-3 wrote: Perhaps it's a problem with your CSS rules. Is the style not removed? On Fri, Nov 27, 2009 at 4:39 AM, coldwired co...@coolwired.net wrote: Hi, Sorry, that was a slight typo on my part, it should be class selected. The problem I have with just appending using addClass is that when the class is removed it doesn't restore the element to it original state a such. What I mean is when the class is removed it leaves class= rather than a blank that it was before. I need to have the exact quote of the code so I can't have class=. Is there a solution to this? Thanks, Colin. coldwired wrote: Hi, I'm trying to append an div element around the element that triggers the on hover event, then remove the div on mouse out (blur). I normally would use addClass / removeClass but this leaves class= when the class is removed and not the original state of the html. Here's my code, I can't work out how to remove the appended div correctly... : jQuery(p,h1,h2,h3,span,li, dd, dt,b,em,strong).hover(function() { jQuery('div class=selected/div').append(jQuery(this).clone()).html(); active = true; }, function() { jQuery(.insense-selected).remove(); active = false; }); This doesn't work as expected, can anyone help out? A solution to either problem described would suffice! Thanks, Colin. -- View this message in context: http://old.nabble.com/Remove-appended-element-tp26534745s27240p26539951.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://old.nabble.com/Remove-appended-element-tp26534745s27240p26546581.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] jquery-1.3.2.min.js causing 400 bad request
On Thu, Nov 26, 2009 at 2:16 PM, rbishop robfromplymo...@gmail.com wrote: Hi there, hoping someone can help a strange intermittent problem. Occasionally, I am experiencing 400 bad request errors when trying to load jquery-1.3.2.min.js. I have taken the request and response headers from firebug during a failure and a success. Does anyone have more experience than myself to analyse these for me please? I can see the differences but don't know how significant they are (such as the failure one saying Content-Type: text/html). ***LOAD FAILURE*** Date: Thu, 26 Nov 2009 19:04:51 GMT Content-Type: text/html Content-Length: 20 Cache-Control: no-store, no-cache Via: 1.1 ourwebsite.com (Access Gateway 3.1.0-420) Host: ourwebsite.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: 1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/ *;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Cookie: __utma=188525673.792568405.1258744191.1258744191.1258911751.2; __utmz=188525673.1258744191.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd= (none) If-Modified-Since: Fri, 06 Mar 2009 03:23:42 GMT If-None-Match: 073f8f2a9ec91:6f0 Cache-Control: max-age=0 SUCCESSFUL LOAD: Last-Modified: Fri, 06 Mar 2009 03:23:42 GMT Accept-Ranges: bytes Etag: 073f8f2a9ec91:6f0 Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Date: Thu, 26 Nov 2009 19:06:49 GMT Content-Type: application/x-javascript Content-Length: 57254 Via: 1.1 ourwebsite.com (Access Gateway 3.1.0-420) Host: ourwebsite.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: 1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/ *;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Cookie: __utma=188525673.792568405.1258744191.1258744191.1258911751.2; __utmz=188525673.1258744191.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd= (none) Cache-Control: max-age=0 I can't tell you what is causing this but the Content-Type: text/html is due to the server displaying its error page. What I do find odd is that, for errors, you don't receive the Server, X-Powered-By, etc. headers. Maybe that's normal; it's been a very long time since I dealt with IIS.
Re: Re[jQuery] move appended element
On Sat, Nov 28, 2009 at 2:11 PM, coldwired co...@coolwired.net wrote: The reason is because I need the exact clone of the highlighted tags before the selected class is supplied to it. Sorry, that doesn't answer my question. In what way is having an element with an attribute class= causing you trouble? Are some style rules persisting? removeAttr sounds okay but its a problem if it removes other classes that might have been there before hand. Difficult situation... If there were other classes assigned you would not have class= attribute on the element.
Re: Re[jQuery] move appended element
Perhaps it's a problem with your CSS rules. Is the style not removed? On Fri, Nov 27, 2009 at 4:39 AM, coldwired co...@coolwired.net wrote: Hi, Sorry, that was a slight typo on my part, it should be class selected. The problem I have with just appending using addClass is that when the class is removed it doesn't restore the element to it original state a such. What I mean is when the class is removed it leaves class= rather than a blank that it was before. I need to have the exact quote of the code so I can't have class=. Is there a solution to this? Thanks, Colin. coldwired wrote: Hi, I'm trying to append an div element around the element that triggers the on hover event, then remove the div on mouse out (blur). I normally would use addClass / removeClass but this leaves class= when the class is removed and not the original state of the html. Here's my code, I can't work out how to remove the appended div correctly... : jQuery(p,h1,h2,h3,span,li, dd, dt,b,em,strong).hover(function() { jQuery('div class=selected/div').append(jQuery(this).clone()).html(); active = true; }, function() { jQuery(.insense-selected).remove(); active = false; }); This doesn't work as expected, can anyone help out? A solution to either problem described would suffice! Thanks, Colin. -- View this message in context: http://old.nabble.com/Remove-appended-element-tp26534745s27240p26539951.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Get value from hidden input and use it in string
Give the input element an ID and use that in the selector: input type=hidden value=2 name=Music id=music_id / $(this).setFile('http://domain.com/asset/get/' + $('#music_id').attr('id')).play(); On Fri, Nov 27, 2009 at 11:48 AM, shapper mdmo...@gmail.com wrote: Hello, I am using JPlayer to play a sound on a page: http://www.happyworm.com/jquery/jplayer/0.2.5/demo-04.htm $(document).ready(function(){ $(#jquery_jplayer).jPlayer({ ready: function () { $(#trackname).text($(#track-01).text()); $(this).setFile('http://www.miaowmusic.com/mp3/Miaow-05-The- separation.mp3').play(); demoInstanceInfo($(this), $(#jplayer_info)); } }) }); How can I change the setFile code line to: $(this).setFile('http://domain.com/asset/get/[id]').play(); Where [id] value should be taken from the following hidden input: input TYPE=hidden VALUE=2 NAME=Music Thank You, Miguel
Re: [jQuery] jquery uploadify question
See: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F In a nutshell, you're declaring a click handler for all elements with class 'img_del' *when the page loads*. But your element is being added during the onComplete callback of uploadify() so it has no click handler assigned to it. To get around that, you would place the $(.img_del).click(function () { etc. code in a function and call the function both when the page first loads as well as after adding a new element. Or, you can deal with it the simpler way and use the new live() function: http://docs.jquery.com/Events/live Using this, you can assign an event handler to any elements on the page *and* tell jQuery to do the same for any new elements added that match the selector criteria. eg. $(.img_del).live('click', function() { var image_name = this.id; $.ajax({ type: get, url: inc/ajax_del_pic.php?img=+image_name, success: function(msg){ alert(msg); } }); }); On Thu, Nov 26, 2009 at 12:57 PM, heohni heidi.anselstet...@consultingteam.de wrote: Hi, This function: var c_folder = $('input[name=client_folder]').val(); $(#uploadify).uploadify({ 'uploader' : 'inc/fileupload/uploadify.swf', 'script' : 'inc/fileupload/uploadify.php', 'scriptData' : {'c_folder': c_folder}, 'cancelImg' : 'inc/fileupload/cancel.png', 'folder' : 'images/uploads', 'queueID' : 'fileQueue', 'auto' : true, 'multi' : true, 'queueSizeLimit' : 3, 'buttonText' : 'Auswahl', 'sizeLimit' : 1000, 'fileDesc' : '*.jpg;*.jpeg;*.png', 'fileExt' : '*.jpg;*.jpeg;*.png', 'onComplete': function(event, queueID, fileObj, reposnse, data) { $('#filesUploaded').append('img src=inc/fileupload/ cancel.png alt= id='+c_folder+'/'+fileObj.name+' class=img_del border=0 style=padding-right:5px; cursor: pointer;a target=_blank href=images/uploads/'+c_folder+'/'+fileObj.name +''+fileObj.name+'/abrbr'); $('#fileQueue').css({'display' : 'none'}); $('#cancel').css({'display' : 'none'}); } }); $(.img_del).click(function () { var image_name = this.id; $.ajax({ type: get, url: inc/ajax_del_pic.php?img=+image_name, success: function(msg){ alert(msg); } }); }); The Script is uploading the pics great and shows me the delete image. But on click, the function to delete the picture is not getting called and I don't get why? Any ideas why it seams that the element img_del seem not available?
Re: Re[jQuery] move appended element
You have 2 separate classnames there--'selected' and 'insense-selected'. Anyway, why don't you just add the class to the hovered element and save yourself some trouble? Because wrapping a strong or dd element with a div is certainly asking for a lot of trouble. On Thu, Nov 26, 2009 at 3:50 PM, coldwired co...@coolwired.net wrote: Hi, I'm trying to append an div element around the element that triggers the on hover event, then remove the div on mouse out (blur). I normally would use addClass / removeClass but this leaves class= when the class is removed and not the original state of the html. Here's my code, I can't work out how to remove the appended div correctly... : jQuery(p,h1,h2,h3,span,li, dd, dt,b,em,strong).hover(function() { jQuery('div class=selected/div').append(jQuery(this).clone()).html(); active = true; }, function() { jQuery(.insense-selected).remove(); active = false; }); This doesn't work as expected, can anyone help out? A solution to either problem described would suffice! Thanks, Colin. -- View this message in context: http://old.nabble.com/Remove-appended-element-tp26534745s27240p26534745.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] disable links in a class set dynamically
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F http://docs.jquery.com/Events/live Please see my response to the recent jquery uploadify question msg. On Thu, Nov 26, 2009 at 12:09 PM, Keysher keys...@gmail.com wrote: Hi! I have a problem. I want to disable links in a specified class. Like this: $(.disabled).click( function() { return false; }); It works fine if the class exists before, but if I add the class to an element, not works!! $(document).ready(function() { $(.disabled).click( function() { return false; }); $(.noClick).click( function() { $(this).addClass(disabled); }); }); The HTML: a href=# class=noClickClick!/a (This is an example, I know that isn't logic)