jquery

jQuery selector for each first element on every parent

I have a HTML like this: <div class="container"> <span class="iconset"></span> <!-- want to select --> <span class="iconset"></span> </div> <div class="container"> <span class="iconset"></span> <!-- want to select --> <span class="iconset"></span> </div> I need to select the first element of every .container, using: $...

Strategies for rarely updated data

Background: 2 minutes before every hour, the server stops access to the site returning a busy screen while it processes data received in the previous hour. This can last less than two minutes, in which case it sleeps until the two minutes is up. If it lasts longer than two minutes it runs as long as it needs to then returns. The block is...

Add li element around every second <span> tag with jQuery

Hi, don't know if this is possible .. I want to add a li element to every second span-tag. My HTML look like that: <span class="article_item"><img src="images/container_item.jpg" /><h2><a href="">Nokia Connecting N97</a></h2><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eu mattis lectus.</p></span> <span class="a...

How do I externally call a method within a jQuery plugin?

Is there a way to call a method defined in a jQuery plugin directly in my script? update (function($){ $.fn.myPlugin = function (options) { return this.each(function() { function doSomething() { // do something } function doSomethingElse() { // do something else } doSomething();...

What is wrong with this functions recursion? (setTimeout issue)

Hi guys, I am writing a marquee script because I do not like the fact that with most marquee scripts when the marquee reaches the last item (thinking using a ul, so last item is the last li), it waits till that item is off screen, and then resets the position of the ul, and starts the scrolling all over agian. My approach is to create ...

dom traversal using div separator - Using Ext-Core and/or Jquery

Hello all, I tried many things but i'm asking for your help because i'm doing stupid things now ! here is what i want to do. I want to transform a html file (i'm not composing) to another. I want to move some parts of the body to div. Here is the original one : <body> text+images part 1 <div class="sep">some text</div> tex+images part2...

Script working only on page reload

I'm using jQuery to align images on an horizontal view website, but the script only works when I reload the page. http://joliannelm.steveforest.com/edition/roux-de-service.html The script is called just before This is the script : $(document).ready(function() { var width = 0; $('#page img').each(function() { width ...

How do I get the value of the input field?

Hello everybody, this is my input field:$("<td class='testclass'><input id='field-search' value='' type='text'></td>") How do I get the value of the input field? I tried it this way: var mytest =$('#field-search').val(); alert(mytest); The result is that I get an alert being undefined though the input field has got a value e.g. 10....

jquery+jstree in c#.net - webservice responseformat?

I have been playing with jstree (1.0rc2)+jquery (1.4.2) for the first time with c#.net and although I have gotten it working, there are a couple things that I don't understand about how data is provided to the tree by the webservice I use to populate the tree (using ajax and the json_data plug-in). I was hoping someone with more experien...

jquery: why $.get send OPTION packet?

$.get('http://localhost/a.bb?cmd=&lt;abc&gt;&lt;/abc&gt;', function(data) { alert('result comes back.'); $('.result').html(data); }); ); Above is the code I want send to server, why jquery send OPTION for me? I want GET method. Thanks. ...

JQuery: Clone when moved offscreen

I have a slider and the slider stretches 100% of the page. I wish to programmatically clone the first element as it leaves the screen and place it at the end, or rather, just move it, without a clone to keep the memory low. Could somebody point me in the right direction to do this? I'm currently using EasySlider 1.7 Cheers ...

Can I get Added and Removed Rows from JQGrid?

Hi, I'm using a JQGrid with cellsubmit: 'clientArray' and executing addRowData and delRowData from custom buttons in a column. I want to send modified data to server through a 'Send Button' and I know that I can getChangedCells to get edited cells but I don't know how to get added and removed rows. How can I achieve this? Thanks :-) ...

How to localise buttons on JQueryUI modal dialog

I have a JQueryUI modal dialog and everything is working fine except for one issue ... how do I localize the OK and Cancel buttons? I have gone through the demos and documentation and unless I am missing something very obvious, can't figure out how to do this ... My code: $("#MyDialog").dialog({ . . . buttons: { OK: functi...

How to use Jquery to get array of UL LI and input?

I have five ul lists that I am using and each list might have an input in it. Here is an example: <form id="testForm"> <ul id="1"> <li>TEST</li> <li>Gender: <select id="gender" name="gender"> <option value="0">Male</option> <option value="2">Female</option> </select> </l...

Jquery after ie8/ie7 not working

I'm trying to insert data after an existing DOM element. I'm getting an error "Invalid argument." -- this.parentNode.insertBefore This is not working in IE8 or IE7. Ideas? Jfiddle example: http://jsfiddle.net/zJ3Fe/ <a href="#" id="delete_promo">Click</a> <div id="customer-info" class="span-12"> <form id="UserFormCheckoutFor...

JQuery Change Event Loop

Hello all, I have several checkboxes. If a user checks any of them, I have to see if they are allowed to do that, if not, notify them and uncheck it. However, this get me in a loop as it triggers the change again! How can I over come this? $('#step_1, #step_2, #step_3, #step_4').change(function(event) { if(!$('#section_2_active...

Best way to collect all "visible" form elements with jQuery that don't have a specific class?

I'm trying to re-assign a new tab-index on a given form. To do this I want to exclude any form elements that are invisible (not visible) -- and also exclude any form elements that possess a specific class (".offscreen"). I'm trying this method -- but, it's not working (and is perhaps not the most efficient method). function reassignTab...

jquery/javascript: arrays

Hi, I am a begginer with Javascript/jQuery and I hope someone can help me with the following: I have a simple form (7 questions; 3 radio buttons/answers per question - except for question 5 with 8 possible choices ) and based on the selected answers, when user clicks on 'view-advice' I want to display relevant advices (combination of 3...

Jquery + php, remove dynamic rows from table td click

Hi guys, I'm trying to remove a row from a table when I click a specific row column. I'm using .live() so that I can remove rows added from a ajax request. It works fine, my problem is, the table comes from php with two rows, I can then insert new ones and remove them, but when I remove one of the rows that came with php, it remove all r...

"ajax" call in jQuery fires "success" function even when server does not respond

It looks like jQuery's .ajax function fires the 'success' function even when it gets no response from the server. I'd consider this an error. I detected this event by checking to see if the 'request.status===0', are there any other instances that I should check for where the 'success' function will be fired even if there is an error si...