[jQuery] Your jQuery Best Practices
So I am working on some documentation for a project me and my team recently completed (is it ever REALLY complete?!) and as the XHTML, CSS, etc. standards/best practices have been hashed out, I've seen to only come up with a few real world practices, quite frankly, because jQuery tends to clean up/simplify a lot of prior issues with Javascript best practices. So, I'm requesting some info from the community. If you have a standard you follow for Javascript and implement it into a best practice for
[jQuery] Regarding jquery auto complete results
iam facing a problem in increasing the width of the autocomplete results, i tried in changing the css also but i can't change that and also I would like to change the structure of the autocomplete results is this possible
[jQuery] Tabs3, jumping to anchor within tab?
Hi, Is it possible, and/or easy to anchor to an ID within a tab? For example, let's say I have two tabs: 1. Entry (#entry-tab) 2. Comments (#comments-tab) Using my browser, I can link to the comment page like so: http://www.site.com/#comments-tab How would I anchor to an ID/anchor within the comments tab? Thanks!
[jQuery] GeTTing time and inserting Database
hi, there is a jquery plugin: http://www.2meter3.de/jqPuzzle/jqPuzzle.zip when you finished puzzle timer stops. I want to get this "time" and insert into my database. but How?
[jQuery] Adding text with Images in Jcarousel
I am trying to add text underneath an image so they are both scrollable and was wondering if that is even possible and if so can someone provide help on this. eg. pic pic [txt] [txt]
[jQuery] Get a request inside $.ajax()
<div dir="ltr">I with to open a page in the same browser window. But it's only when a POST request return an error, link the sample below: <span style="font-family: courier new,monospace;"> $.ajax({</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> type: "POST",</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> url: "/url/",</span><br style="font-family: courier new,monospace;">
[jQuery] Changing $ to other symbol
Good Morning, I am developing an application that use $ symbol. I have tried to implement jQuery in my app and there are conflicts because jQuery also use $. Can I change $ symbol in jQuery. Thanks
[jQuery] slideToggle(speed) not working correctly in IE7 (7.0.6000.16711) on Vista
Hi, I am using the following script to slide toggle multiple div elements in a page. It works fine in FF2 but behaves little strange in IE 7 version mentioned above. Here is the script <script>$('div[id^=upgradeConfigItem_]').each(function(i){$ (this).click( function() {$('#upgradeConfigItemToggleContent_' + i).slideToggle('slow'); $('#upgradeConfigItem_' + i).toggleClass('expand'); $('#upgradeConfigItem_' + i).toggleClass('collapse');}); });</script> Here is corresponding HTML ..... <form action="?wicket:interface=:
[jQuery] web mashups
<div dir="ltr"><span class="Apple-style-span" style="font-family: Times; font-size: 16px; "><div style="margin-top: 8px; margin-right: 8px; margin-bottom: 8px; margin-left: 8px; font: normal normal normal small/normal arial; "> could you recommend any good ones?</div></span></div>
[jQuery] jScrollPane plugin, how to keep it working with a link? HELP! :-)
hi, A great plugin (jScrollPane), but I can't get one piece of it to work - if I click on a link in the text, and want to jump within the div - it just blows away the scroll bar. example here: http://www.utopiaparkway.com/scroll.html (click on FOO, u jump to the correct place in the html, but the scroll bar is gone), it's refresh issue for sure, but I just don't know how to tackle it. Scollbar should match up with my position in the text. http://www.utopiaparkway.com/scroll.html PLUG IN docs: http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html
[jQuery] Hide a drop down menu.
Hello. I have a page. The page contains a link. When a user clicks the link a drop-down menu showes. I want to hide the drop down menu when the user clickes wherever else on the page. It has to work like <select/>. The drop down menu is <ul/>. So I can not use blur event. PS It has to work the same as Gmail->Contacts->Groups (control element working like <select/>).
[jQuery] eval to register jquery selector
hi guys, i have many selectors for the same jquery action. for this pupose i store my selectors in an array and iterate in a loop ever them. to register them im using eval. it is working fine, but is this the right approach? var selektor = '$("div").get()'; var showId = new Array("show1","show2"); function show(){ for (var i = 0; i < selektor.length; i++) { eval('\$("div:eq(' + i + ')").click(function() { alert(' + i + ');});');
[jQuery] Event does not trigger after $("<div>asdfasdf</div>").insertBefore($(this).parent());
i have this problem when i call a function onClick after insertBefore(); when i click a button it insert TEXT AREA, SEND BUTTON at right place. and then at that i apply some functionality like ALERT("ABC"); at that inserted BUTTON and it does not work. Help me out of this ... plz soon. ***** Code is OK if i does not put it in this snario. Only when i dynamically insert some tage and apply an event to those it does not work **** -------------- OK (it inserts at relevant position) ------------------
[jQuery] PNG support in IE7 while animating
I have a current implementation of Jqueryfordesigners.com's tutorial on how to accomplish Panic's Coda site popup bubble. The background of the div that animates position and opacity from 0 to 1 is a PNG with alpha. Despite its support for PNG, the effect doesnt work in IE7- the full transparency is never loaded. The workaround was to load an alternative transparent GIF for IE 6 and 7, but Ive taken that out on this test link for sake of viewing the phenom. A poster on another board suggested that
[jQuery] setTimeout($('#content').unblock(), 5000);
blockUI v2.08 when I user : $('#content').block({ message: '<h4><span class="loading" /> wait...</h4>', css: { border: '1px solid #816A3B',width:'80%'} }); setTimeout($('#content').unblock(), 5000); firefox3.01 have a error : missing ] after element list what's the mistanke with my code above?
[jQuery] An easy question: Selecting DOM nodes that doesn't have class "active"
Hi, I have this code: <ul> <li> <ul class="menu"> <li>...</li> </li> <li> <ul class="menu active"> <li>...</li> </li> <li> <ul class="menu"> <li>...</li> </li> </ul> I want to set css property display:none to all the elements that are not active. I'm looking at the doc on ":not" selector, I've tried: $(':not(.active)').css({'display:none'}); But doesn't works... Where I'm doing wrong? Thank you
[jQuery] Advanced DOM traversing using each() then group by same attribute.
---- Start XML----- <LINKSLIST> <LINK Attribute="001|007"> <ID>001</ID> <CATEGORYID>007</CATEGORYID> <URL>http://www.yahoo.com</URL> <SHORTDESCRIPTION>This is an external link to yahoo.</ SHORTDESCRIPTION> <DETAILS> <LINK Attribute="EXTERNAL">External Links Category</LINK> <LINK Attribute="SHOW">TRUE</LINK> </DETAILS> </LINK> <LINK Attribute="002|007"> <ID>002</ID> <CATEGORYID>007</CATEGORYID> <URL>http://www.google.com</URL> <SHORTDESCRIPTION>This is an external link to google.</ SHORTDESCRIPTION>
[jQuery] load css dynamically
I am trying to load css dynamically to the document by jquery. It works in firefox fine, but not in IE. any idea? code: $("<link>").attr({"rel":"stylesheet","type":"text/ css","href":css_href, "media":"screen"}).appendTo(document.getElementsByTagName("head")[0]);
[jQuery] Problem in Handling Events after insertBefore()
Hey guyes i have this problem when i call a function onClick after insertBefore(); when i click a button it insert TEXT AREA, SEND BUTTON at right place. and then at that i apply some functionality like ALERT("ABC"); at that inserted BUTTON and it does not work. Help me out of this ... plz soon. * Code is OK if i does not put it in this snario. Only when i dynamically insert some tage and apply an event to those it does not work * ------------------------------------------------ OK (it inserts at
[jQuery] Superfish Question
<div dir="ltr">Hi All I use Superfish on a project as a menu system (and love it). I am a Java developer though and usually end up breaking ajax/javascript libraries when I try to make a customisation. My question is how easy / difficult would it be to make superfish *not* activate the "drop-down" part of the menu with a mouse event that hovers over it (default behaviour), but instead that it requires a mouse click? If it can be attempted by a non javascript coder (but who has done some js hacks
[jQuery] Ajax request does not insert data after semi-colon...for CGI script,
Hi there, I m using latest jQuery 1.2.6 and when I try to use ";" in my input and it does not read values/text after semi-colon. e.g. I enter abcd;xyz in to input box and I do following: var VER = $.trim($("#boxing1").val()); alert(VER); alert shows correct value and when i send it through: $.ajax({ type: "POST", url: "/cgi-bin/test.cgi", data: "validu="+VER, cache: false, timeout:10000, .... it gives me abcd thats all. Looks like ajax is sending out semi colon less ur or something ... Let me now
[jQuery] tabs pluggin how to load tab with external domain data
hi there I would like to load a tab with external domain data , something http://www.google.com is this posible and how Thanks
[jQuery] Selectable library problem
I used selectable library to select items in my list but when my list become bigger than 20 item, the selection process was very slow and the time required to load the page was very long. can any body help me with this issue? If there is an update to this library or there is another library better that this one.
[jQuery] removing html comments from the dom
Hi there, Does anyone know if it is possible to remove html comments from the DOM with jQuery? My problem is that I really need a page to render in full standards- compliance mode in IE, but my outdated corporate CMS (Vignette) inserts an html comment at the beginning of every page which throws IE into quirks mode rendering. (Ordinarily this is not a major problem, I just code with the appropriate CSS hacks to accomodate quirks mode). In this instance though, it's causing some very jerky show/hide
[jQuery] mootools and jquery
I'm completely new to jquery (and not technical...) and I've been asked to estimate how mush would it would take to convert a html +xml+mootools written mini web page into jquery, the current mootools written mini web page has the following: * 2 dynamic menus, content of these menus are defined in 2 different .xmls (both click through and html to display) * When clicked on the menus, it import individual htmls to a div within the main template * a small animtaion (like slideDown(); in jquery) within
[jQuery] JQuery UI Date Picker and Thickbox wont work
I'm trying to run UI Date Picker from a Thickbox. Thickbox screen is appearing on the screen but UI Date Picker is not. When I run Date Picker on a normal page everything works fine. Is there any solution for this problem? Any other date picker or solution is more than welcome. Thanks Rob
[jQuery] how do I stop a further event will be ahppened again if current event has not yet finished
Hi, all If an event hasn't finished how do I prevent the same event being triggered again? Thank you in advance! Jack
[jQuery] jquery.form set field value beforeSubmit
Hi, I'm trying to set a hidden field's value to true before submitting. First I bind the form: $(".advancedSearchForm").ajaxForm( { target: '.colorList', beforeSubmit: ShowRequest, success: ShowResponse } ); Then in the before submit I set the field value to true function ShowRequest(formData, jqForm, options){ $('#isAjax').val("true"); // var elements = jqForm[0].elements; // elements[19].value = "true"; $('.colorList').fadeOut('slow'); return true; } A quick alert($('#isAjax').val()) shows me it
[jQuery] Help with trigger() problem
Hey guys, I have a problem, Im trying to alert a value that is set after a trigger is .. triggered but for some reason the order of my commands doesnt seem to be happening properly....heres an example of my code ... I have a function assgined to everytime a select box changes. $("#select").change(function() { $(":text").val(""); $.post("request.php",{q:this.value},function(data){ $("#nombre").val(data.nombre); $(":text").attr('readonly', "readonly"); },"json" ); }); //and I have this code that triggers
[jQuery] about siblings().removeClass with td:first-child problem ? anyone help, thanks.
I have one table, I want click td:first-child then change td:first- child's background color, when click the td-first-child , td background color change, but when I click other td:first-child, the removeClass not work correct, anyone help ? thanks. my script: $(document).ready(function(){ $("div#mypoitable table#srch-result tbody tr").each( function(i) { $(this).find('td:first-child').bind("click", function() { $(this).siblings().removeClass('selected'); $(this).addClass('selected'); }) }) }) my
[jQuery] simulate a keypress
Hi, all I found a message on this group about simulating a keypress such as $('input#search_fld').trigger('keypress',[{preventDefault:function() {}, keyCode: 49}]); It won't work for me. Please advise, thank you in advance! Jack
[jQuery] Livequery am .load()
Hi, I'm using livequery with the tabs plugin. $('.pagelinks a').livequery('click', function() { $("#loading").ajaxStart(function(){ $(this).show(); }); alert(this.href); $("#pagedata").load(this.href); $("#loading").ajaxStop(function(){ $(this).hide(); }); return false; }); When the page loads everything works fine, but when I switch tabs, it stops working. I can see that the function is being called (firebug) and the alert shows the correct link, so I think
[jQuery] jCarousel
hi.. i have a little problem with jcarousel.. :( because i need the carousel's container as 'display:none;'. onclick of something, the container slides down.. now, the problem is, when it is 'display:none;' .. jcarousel doesn't work right anymore.. actually, it's just that the UL's width is not right anymore.. so i only see 2 items.. :( need help.
[jQuery] IE Bug in fadeIn
Hi! I found a strange, strange bug in IE6: aux=somevalues.split('='); // divid=value, i,e, "value1=abc" (no quotes) $("#"+aux[0]).text(aux[1]).fadeIn(); // Gives the Error "Object doesn't support this property or method" Now cames the oddity: var a="abc"; $("#"+aux[0]).text(a).fadeIn(); or $("#"+aux[0]).text("abc").fadeIn(); or $("#"+aux[0]).text(aux[1]); Those work! It seems the problem is in dealing with arrays AND fadeIn. I'm stumped. Anyone has an idea on how to fix this weird bug?
[jQuery] nested .each issue
Hey gang, I've got a page with a multiple unordered lists. I'm trying to get each list to show only 10 items, unless the user selects to view more. I thought that I could cycle through each UL, then count the LI's and hide them if there are more than 10 LI's. Unfortunately, this is only working on the first UL, and then on subsequent UL's, everything is hidden. My code looks like this currently [code] function truncateList(){ $('.itemList').each(function(){ $('.item').each(function(i){
[jQuery] Can jQuery perform a generalized getElementById(divid) function without specifying the exact div id?
Javascript has a convenient "getElementById(divid)" function that allows you to specify, in the html, which div the javascript function applies to. I am wondering if jQuery has a similar way of performing, in which you can name an overall function and then call it specifically from within the html and apply it to specific divs. I want a function that will "show" specific divs when specific titles are clicked on. This is very similar to an "accordian menu" setup except that my layout doesn't allow
[jQuery] event handler mystery
Hi. I'm relatively new to javascript in general, and to jQuery. And this question may be more of a general javascript question, than a jQuery question. Not sure. I have an event handler for a click event that looks like this: // this code works... jInventoryView.prototype.rowDetailClicked = function(event, btn) { if (btn.owner) { var id = btn.owner.data.rowData[0].id; btn.owner.grid.insertCustomRow(id, null); } }; It works okay as is. But what I'd like to do is assign btn.owner to a local variable
[jQuery] Safari 3.0.4 - problems with $.ajax and authentication?
I have a JavaScript snippet that looks approximately like this (obviously, the url, name and password are different): $.ajax({ type: "GET", url: "http://example.com/ws/", dataType: "json", username: "user", password: "pass", success: function(msg){ alert( "Result: " + msg.text ); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Error " + textStatus + " -- " + errorThrown); } });
[jQuery] External links not working within jquery.accordian
http://www.firstlineeducation.ca/ Hi! I'm new to jQuery, and just realized that somewhere along the line while coding the accordian and cycle plugins into this page, and then finishing the rest of it the links within the accordian don't work - they just scroll the accordian section back up into itself to close the stack. I've tried backtracking, but I can't seem to find what might be the problem. Can anyone point me in the right direction? Is there a 'return false;' that I'm missing somewhere? Is
[jQuery] jQuery edit in place works with every browser but firefox 2, works with 3, safari, opera ....
This plugin works on every page solo, and on every page but firefox 2 on a page with lots of jquery going on on it. With firefox 2, the double click event fires, but the keyups dont fire and the input does not focus, then select. This is really bugging me and i cannot figure it out. (function($) { $.fn.EditInPlace = function (options) { // Invalid Element if (this.length == 0) { return false; }; // Edited Yet? var editedYet = 0; var beingEdited = 0;
Next Page