jquery

how to send multi field value by jquery post

I know how to send by jquery post method $.post("test.php", { name: "John", time: "2pm" } ); but what if my form field name is array <input type=text name="n1[]" id="n1[]" value='12345"> <input type=text name="n1[]" id="n1[]" value="14454"> how to send these 2 field value send to url by jquery post method? ...

Should new jQuery functions be placed within the jQuery namespace?

Context: HTML widgets generated using a Django ModelForm and template, jQuery 1.3.2, JavaScript on IE8, Firefox 3.5 or Safari 4. Procedures: An ordinary JavaScript function with some jQuery inside, or jQuery Enlightenment, Cody Lindley, "Adding new functions to the jQuery namespace," p. 116. I have a jQuery construct that is repeated se...

JQuery loop to display every six items into an new unordered list

Hello! I'm a bit new to the jquery world and I was wondering: I have a JSON object that returns content from a database. How would I loop through those items to display only six per ul with each item being appended within that ul in a li, then construct a new ul every six items to display the remaining items in a li? Basically I'm tryin...

Using javascript to scroll iFrame up and down

Hi, Is it possible to scroll the iframe window from the parent window using keys or javascript? The iframe content is from another domain different from the parent window. KM ...

jquery: bind "click" event

in my bind "click" event, i would like to chop the last character off a given string incrementally. however, each time i click it, it seems to stop after the first chomp. var somestring = "mary had a little lamb"; $("#removelaststring").unbind("click").bind("click",function(e){ alert(somestring.slice(0,-1)) }); it should return "one...

Jquery - Hide / Show - "Session" problem

Hello! I use this links and divs on my site: <p><a href="#" class="navlink" id="navlink_1">Menu1</a> | <a href="#" class="navlink" id="navlink_2">Menu2 |</a><a href="#" class="navlink" id="navlink_5"> Menu 3|</a></p> <div id="menu_1" class="mymenu"> </div> <div id="menu_2" class="mymenu"> </div> <div id="menu_3" class="mymenu"> </div>...

why isn't this removing (digit) each time it's run ?

var somestring = "mary(3) apple(2) sky(1)"; $("#removelaststring").unbind("click").bind("click",function(e){ somestring = somestring.replace(/\(\d+\)*$/, "") alert(somestring); }); i should get mary(3) apple(2) sky then if i run it agan mary(3) apple sky if run again mary apple sky however this doesn't happen, no matter how...

Repeating Ajax Request

Hey! I'm basically trying to get the existing code below to make a new ajax request every time it finishes so there would be a constant stream instead of it just stopping after a batch. <script type="text/javascript"> $(document).ready(function(){ var twitterq = ''; function displayTweet(){ var i = 0; var limit = $("#twitter-results >...

jquery show/hide two divs on click and hide link

Im using the following JS <a href=# onClick="if($(this).next('div').css('display') == 'none') { $(this).next('div').show('fast'); } else { $(this).next('div').hide('fast'); } return false;">Add a Street Address</a> and the following html <div id=entry> <div id=label>Street</div> <div id=input><input name="" type="text" class="lon...

Use jQuery to attach JSON to a form and submit it

Given this empty form, how would I use jQuery to attach a JSON object as params and then submit it? The form should standard submit, not AJAX. <form action="/comments" method="post" id="comments_form"> <submit>Post</submit> </form> ...

JQuery code in another file

Hello, before this I wrote all jquery-code into main fail. Now I want to move it into another js-file. The problem is that it doesn't want work correctly. Here is an error by FireBug: $ is not defined $(document).ready(\n So, as I understand, I have to initialize $-var... But how? Thanks. ...

write python inside jquery

I have a web2py application and am using jQuery to validate data. I want to write Python code inside jQuery. How can I do that? if($("#myform_parent_id")[0].value != '' && $("#myform_parent_birthdate")[0].value != '' && // Here I want to write Python code .. } Because when i make this code inside controller and then ...

on jQuery: with a lot of items show only div of this anchor clicked

first of all: sorry for my english i have a webpage like this <div class="item"><div class="details"> <ul> <li><a href="#">Show div 1</a></li> <li><a href="#">Show div 2</a></li> <li><a href="#">Show div 3</a></li> </ul> <div>div 1</div> <div>div 2</div> <div>div 3</div> </div></div> IMPORTANT: i have several divs called 'i...

Jquery - slideDown with existing height.

If i have a div with a class that sets the height 100px, and overflow:hidden (effectively a preview of it's contents), how can i incorporate the 'slideDown()' method to slide to the full height of the div? (i.e. remove the height restriction in the css class). ...

jquery validation required

hello, I tried this but it doesn't seem to work,,, any Idea why not ? I call validation that way : $("#aspnetForm").validate().form(); and the "details" field is allways required no matter if the "other" checked or not .... I took the example from http://jquery.bassistance.de/api-browser/plugins.html#jQueryvalidatormethodsrequire...

how to use tooltip ui of jquery in asp.net

hi, i am trying to use the JQuery tool tip in asp.net application but no where i would find how to call this tool tip if i move my mouse over a label or textbox in asp.net any solution on this would be great t Thank you ...

Detecting support for specific HTML 5 features via jQuery

I'm working on some HTML5 demo code, including stuff like <input type="date" /> This currently works correctly in Opera 10 as-is, but every other browser just displays a normal text input. I'm then using a jQuery.date-input plugin to override this behaviour on browsers that don't support it. Problem is - the jQuery's running on Opera a...

Find and addClass

HTML: <table> <tr> <th>text</th> </tr> <tr> <td>text</td> </tr> </table> I want to do this: if found 'th' in 'first tr', addclass 'abc' to 'second tr'. Is this jQuery correct: $('table tr:eq(0)').find('th').next('tr').addClass("abc"); ...

jQuery Cycle Plugin (zero element?)

I used AJAX to populate a div and then, cycle plugin it ! here is the page, and here is the code calling cycle: <script type="text/javascript"> $(function() { $("#photoviewer").load("photo-list.shtml #ani"); alert ('photo loaded!'); $(document).ready(function() { $('#ani').cycle({ fx: 'turnD...

addclass to first-level elements only

HTML: <table id="table-1"> <tr> <td> <table> <tr> <td>content</td> <tr> </table> </td> <td>Content</td> </tr> </table> Is it possible to addclass 'td-1' to ONLY first-level TD's of #table-1 and not all? Thanks ...