[jQuery] Best Practices Style Guide
I am a fairly new adopter of jQuery, but a long time software developer. One of the things I really like about the jQuery approach is a mindset to keep implementations clean and maintainable. Having said that, it is easy enough to take the unobtrusive paradigm down the path towards unmaintainable systems without some good guidance. Several things can happen (in no particular order): 1 - application developers can load up one or more js include files with a lot of seemingly unrelated javascript. Finding
N x N matrix using Jquery
Hello, i am new to jquery. i wanted to create a n x n table where each cell contains a checkbox. the logic that i want to implement is like a matrix. consider the following example of 3 x 3 matrix for understanding. (0,0),(0,1),(0,2) (1,0),(1,1),(1,2) (2,0),(2,1),(2,2) so there are 9 cells in this example and each will contain a checkbox, if a user will select a checkbox at location (0,2) then the checkbox at location (2,0) will be selected automatically. similarly if a user will select a checkbox
[jQuery] SlideToggle a DIV inside another DIV
Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class "edit" in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only thing I can accomplish is if any of the "edit" buttons are clicked all of the
[jQuery] Problem with placement of image in tooltip
Hi all, I'm trying to use the tooltip plugin and for some reason the image tooltip is always showing up on the bottom left of the page. I've created a very simple example illustrating the problem. I must be doing something incredibly stupid. Anyone have any ideas? Thanks a lot, Russ <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ ajax/libs/jquery/1.2.6/jquery.min.js"></script> <script type="text/javascript" src="http://jquery.bassistance.de/ tooltip/jquery.tooltip.js"></script>
[jQuery] Scrolling a Div
Hi All I am trying to scroll a single div (can't have other divs with id's, etc) left (previous) and right (next). It is just a single div by itself with content in it, i just want the next and previous buttons nothing more. Please if anybody could help urgently! Thanks -- View this message in context: http://www.nabble.com/Scrolling-a-Div-tp20897058s27240p20897058.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] How to get parent element and not break a DOM hierarchy
Hi all! I am new to jquery. I have a problem to get first parent element without breaking a hierarchy. Example: <div class="ajaxmain"> <div class="somediv"> </div> <div class="ajaxform"> <span>Hello World</span> </div> </div> I'a trying this: $('span').parents('.ajaxform, .ajaxmain').get(0); - this is heirarchically OK, it returns div.ajaxform but when I'am trying this or change divs order $('span').parents('.ajaxmain, .ajaxform').get(0); - it returns me div.ajaxmain The divs with classes can have
.ajax and append
Hello guys, I'm new with jQuery and I'm having some trouble on the following function: $("#fmphotos").click(function(){ $.ajax({ type: "GET", url: "index.php", data: "p=311&g=311", success: function(msg){ $("#cgallery").append(msg); alert("Ready!"); }, error: function(){ $("#cgallery").append("Error."); } }); $("#cgaleria").stop(); $("#cgaleria").slideDown(1500); }); When I click on
[jQuery] problem with $.JSON request
I spek in Englisn bed. Sorry. Part of sample code: $.getJSON("http://some.url/?callback=?" function(json){ var result = json.error; var message = json.message; var record = json.data; }); How I return value of the variable: result or message or record to others part of script? it is possible?
[jQuery] .load preventing links on page from working
Hey everyone, I've just downloaded and started using jQuery v1.2.6 in a web project i'm working on. When a search result page loads i want to also search another site and show the results in my page. It looked like the $ ([node]).load() function would be the best way of doing this. I implemented it and it seems to work fine, however, the .load function can take 5-10 seconds to return any data and in that time, none of the links on my page will allow the user to navigate away - which is undesirable.
[jQuery] Validate does not work in IE7
Hello, I am using JQuery and Validate. It works fine in Firefox 3 but it does not work in IE7. Here is an example: http://www.27lamps.com/Beta/Form/Form.html Am I doing something wrong or is there a bug? Thanks, Miguel
[jQuery] datepicker and highlight current day
Hi, I can't find the option of datepicker that could highlight the current day when i open a calendar. Any idea ? thanks in advance, regards, f.
[jQuery] Webdeveloper to WebDeveloper
Dear folk , If you're interested on web development Articles which is updated and has lots of new information.(Web developer to web developer) I have just started a Blog which contains (jQuery ,Css,html,Php,Mysql,json,Ajax....) take a look at it http://www.pedramdev.com , this Blog gets the best articles out of the web and also at the end of the week it has some conclusions enjoy it . If any one is interested please let me know . pedramphp@gmail.com . Sincerely Pedram .
[jQuery] event target bug or jquery.validation bug in IE?
I'm using jquery.validation.js plugin. It works fine in firefox. However, in IE, I have problem if there is errorred fields (which shows an error sentence). If it happens, the plugin keep onfocusin the first errored field (i use the event object to find out the problem). It should be logically wrong. But it creates big problem when I then trigger e.g. an autocomplete, or rating section. it seems that IE does not know which field it is focusing and make the problem.
[jQuery] toggle text & class name and pop-up tool tip
Hello everybody, I'm JQuery beginner and need help on the following. I have a anchor tag with class name "red". I want three things to trigger on click of anchor link 1. change class name from "red" to "gray" 2. change anchor text from "hello" to "bye" 3. pop-up tool tip (just display will do) here is the html <html> <head> <title>Untitled Document</title> <script src="jquery-1.2.6.js" type="text/javascript"></script> <style> .red{background:#ff0000;} .gray{background:#ccc;} .tooltip{display:none;}
[jQuery] JQuery Ajax get function BROKE in Safari 3.2.1 (latest)?!
Ok, I'm using the simplest possible jquery ajax get call to execute a database call in another php file (since I switched from using a really nice prototype powered function thinking it was prototype's fault for not working in Safari), but I can't get it working in the latest version of Safari no matter what (as much as I couldn't get prototype one to work in Safari either). This works just fine in IE6, IE7 & FF3, but Safari is not budging - it's not executing for some reason... here's the code:
Execution sequence. Submit form after execution of code
I have combined the jquery form plugin and the populate form plugin according to this: $(document).ready(function(){ $(\'#form2\').ajaxForm({ dataType: \'json\', success: pop }); }); function pop(data) { $(\'#form\').populate(data, {resetForm:false}); } So when user submits "form2" json data is retrieved from a php script and populated to "form". This works fine. Now my problem is that I want to submit "form" automatically after all the above code has
[jQuery] Type of Control
How can I check what is the type of control. eg. In javascript document.getElementById("mycontrolid").type will return select-one, textbox, checkbox, radio etc. How can I find it in jQuery. I tried as $("#mycontrolid").constructor but it returns as Object in all cases.
[jQuery] Problem with confirm delete
my problem is that it won't delete from DB every things else works fine just not the deleting from DB. My Code: $(function() { $('a.delete').click(function() { var user_id = $(this).attr('id'); var thisparam = $(this); if (confirm('Are you sure you want to delete ? - ' + user_id)) { $.ajax({ type: 'POST', url: 'test.php', data: 'user_id=' + user_id, success:
[jQuery] newbie: making a sortable table by some hidden value
Hi, I would like to sort a table a number of table rows by values inside hidden form elements inside cells of the table. These form elements can represent different 'datatypes' (I put datatypes in quotes because the types my application defines aren't necessarily always the classic types one might expect), the first case that I need to sort on is basically datetime values. Anyone can give some pseudo code to do this with jquery Thanks
[jQuery] How can I make a td clickable?
Hello, I have something like this: ... <td class="menuitem" width="100" align="center" nowrap><a href="index.html" class="menu">Home</a></td> ... How can I make the whole td clickable leading to index.html not just the text. I searched Google but I couldn't find anything about this. Your help would be greatly appreciated.
[jQuery] Optimizing Easiest Tooltip
Hi there, I've got a page with a very big table (unfortunately breaking it up isn't an option), and I wanted to use the handy tooltip script here: http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery This results in just over 2,000 cells with tooltips, and such over 2,000 listeners. When I refresh the page, I get an "Unresponsive Script" error in Firefox, which isn't suprising. Could someone suggest a way I could modify the above script to use fewer listeners? Maybe through
Add class to <tr> in IE?
Help! I'm trying to get jQuery to add a background color to a table row when a checkbox is clicked. It works great in FF but I just can't get it right in IE. Here is my jQuery: $('#table tr').click(function() { $(this).addClass('highlight'); }, function() { $(this).removeClass('highlight'); }); This code is working when I apply it to a <TD> or other element, but I can't figure it out for the <TR>. Any suggestions? Thanks!!
how to dynamically create a set of checkboxes
This is quite a newbie question about a jquery tutorial I found at http://remysharp.com/2007/09/18/auto-populate-multiple-select-boxes/. I wish to change the example so that the second box ('elements') contains a set of checkboxes instead of a select list: http://remysharp.com/wp-content/uploads/2007/09/select-chain.php The .js is here: http://remysharp.com/wp-content/uploads ... t-chain.js I think I need to amend the document.createElement("OPTION") to something like document.createElement("checkbox")
Populating a list using append()
What is the right way to populate a list? I have my code below but it doesn't seem to work. $(document).ready(function(){ var a = 'Yup. '; $('a').click(function(){ $('ul').append('<li><strong>' + a + '</strong>You\'re the boss.</li>'). }); });
To use or not to use each()
I recently discovered how to use each(). So what now is the difference in the example below and if there is a difference, which one is more efficient to use? //Example 1: using each() $('img').each(function(){ $(this).click(function(){ //do something }); }); //Example 2: Not using each $('img').click(function(){ //do something });
Ajax and append html: selector not work
Hi at all. I have a trouble. I have this code: <div class="calendar"> <table> <tr> <th><a href="?nov">[<<]</a></th> <th >dicembre</th> <th><a href="?gen">[>>]</a></th> </tr> .... .... </table> </div> Is a Calendar. When i click onto a link, the page was reloaded. I need that the page was static. So i use Ajax. But when i append a new code, the selector change and not work more. This is my JS code: <script type="text/javascript"> //<![CDATA[ $(function() { var navigation=$(".calendar tr:first
[jQuery] Remote requests using $ajax
Hey all, I'm in need of making a remote request (i.e. to a different domain) using the $.ajax function. Doing some preliminary research on google and this group, it looks like the most popular workaround is to call a separate local script using $ajax; and then having the local script perform the actual remote request. However, for my current situation, I cannot utilize a local script. The documentation for $ajax seems to imply that jquery supports remote calls, unless I'm misinterpreting this line:
[jQuery] how to dynamically create a set of checkboxes?
This is quite a newbie question about a jquery tutorial I found at http://remysharp.com/2007/09/18/auto-populate-multiple-select-boxes/ I wish to change the example so that the second box ('elements') contains a set of checkboxes instead of a select list: http://remysharp.com/wp-content/uploads/2007/09/select-chain.php The .js is here: http://remysharp.com/wp-content/uploads/2007/09/select-chain.js I think I need to amend the document.createElement("OPTION") to something like document.createElement("checkbox")
[jQuery] Submit form using ajax
Hi, I am loading a form on click of an hyperlink using ajax.after loading i want to submit that form again with ajax.i tried many methods but no one is working.i need to do validation also. i am using this code. $(document).ready(function(){ $('#admin_ajax_new_content_id').load('add_prime_shows.php'); //by default initally load text from boo.php $('#admin_left_navigation a').click(function() { //start function when any link is clicked $('#admin_ajax_new_content_id').slideUp("slow"); // var
[jQuery] how to image cache using jQuery?
<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">hi, I'm new in jQuery... can someone help me to understand how to do Image caching from jQuery. thanks... </td></tr></table>
[jQuery] bind a function to another function
Hi all, I released my first jquery plugin. It is about binding or connecting a function to another function. It is just like binding a handler function to event. Please have a look at it and send me your comments. <a href="http://plugins.jquery.com/project/jqConnect">http://plugins.jquery.com/project/jqConnect</a> cheers, Prajwala
[jQuery] Need help modifying this jQuery...
I'm trying to put my first Ajax to use by creating a login form. To get there, I'm attempting to modify the first tutorial I've found which I understand enough to understand what it's doing and how it's working with a ColdFusion backend. Anyway, my first question is: How do I modify the code below to send an email address (form.email_address) and password (form.password) to the url: "request_processor.cfm"? The code below was just for a form with a select which, when the value changed, would cause
[jQuery] Resize <textarea> to fit all text (needing scrollHeight?)
I want to adjust a <textarea> to fit all of the text within. I tried toying with the dimensions plugin, but it doesn't offer the scrollHeight attribute, which is what I think I need. Before I go journeying off on a wild tangent to my actual project, I wanted to make sure that a) I'm barking up the right tree and b) jQuery doesn't already offer this in some function I'm unaware of. Thanks! Nate
[jQuery] Problem with Tablesorter Plugin
I just downloaded JQuery. For my first project, I'd like to make a table with sortable columns and alternating row colors. For the sortable columns, I downloaded the Tablesorter plugin, then followed the tutorial at <a href="http://tablesorter.com/docs/">http://tablesorter.com/docs/</a><br clear="all"> I don't know a lot about JavaScript, but I have implemented and tweaked many pre-made JavaScripts. So I don't understand why I can't get this one to work. First, I tried it on a PHP page with a table
[jQuery] How to animate frameset properties?
Hi, I know it's kinda lame, but I should animate the setting of a frameset's cols property. So far I managed to learn that html properties can be animated using anime({prop:”value”},duration) I created for example a font size changer using that code. As I work now with frames, I tried to modify a frameset’s properties: first I used the following code: top.$("#main_frame").attr("cols","0%,*"); It worked fine, the left frame disappeared. I just wanted to make it with animation, so I tried the following:
[jQuery] Jquery Tablesorter not working
Hi All, I have been trying to use the table sorter but not sure why this error pops up : jQuery("#myTable").tablesorter is not a function <script type="text/javascript" src="/scripts/jquery-1.2.6.pack.js"/> <script type="text/javascript" src="/scripts/jquery.tablesorter.js"/
[jQuery] jquery.min.js is 54kb, not 15kb?
The front page of jquery.com says the production version is 15kb, but when I go to the download link, it shows up as 54kb. Is there something special that I need to do to convert that 54kb file into 15kb file?
[jQuery] Cycle.js not behaving... Can't get it to work no matter what
Hello I am trying to get cycle.js to work, and I have no idea why it isn't. Here is my code: <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/cycle.js" type="text/javascript"></script> <script type='text/javascript'> $(document).ready(function(){ $('#s1').cycle('fade'); }); </script> And you can view the test site live here: http://hbeckett.com/presentation/ A solution would be greatly appreciated. Thanks
[jQuery] addClass with attrs
Hi! How can I add a class with its attrs dynamically? like this (not works, obvious ...)---> $('#div').addClass('blah {background:"#000"}') Thanks, Dirceu Barquette
[jQuery] New to jquery. How to get the following component??
Hello, I am interested in the following component (as seen on the following page): http://ui.jquery.com/demos It must be some sort of flow component. Can anyone tell me where to get it from? Where it is documented? Best regards, Julien.
Next Page