for example i have the markup
<div>
<img src="#" alt=""/>
<img src="#" alt=""/>
<img src="#" alt=""/>
<div>
I want to select $('div img') and then assign each one a z-index value so the first one is 3, second 2, third 1. Is this simple with jQuery?
Thanks
Question: How can you use the JQuery Auto-Completion plugin to suggest a location ("City, State") for an input field?
Meaning, someone wants to type in "Chicago, IL" ... so they begin typing "Chi" and it auto-suggestions "Chicago, IL".
My biggest hurdles is finding a service that I can query to find out all US city+state names.
I essentially want to do what the StackOverflow "Tags" input form works but form "City, State" auto completion.
Anyone know how to add a custom option select filter to a jQuery DataTable?
Basically, like this example page but instead of having min/max text fields... change them to select options.
I want to set the alternate background color for rows in a table - but the twist is that I don't want every other row to be colored, I want to treat them in blocks of three rows.
So for a table with eight rows I want the first three to be white, then the next three to have a background color, and the last two are back to white again.
How can I do this using jQuery?
Hi,
I am brand stinking new to jquery and attempting to have a "Services" page for a tech website I am working on. I am having trouble with different services opening the same info in the window.
Basically I am using the code straight from the demo. Any ideas on how to have multiple windows in the same page?
Thanks!
I am using jquery table sorter and have two tables. Instead of sorting the data just in the first table, could there be a way to combine the data in the second table and sort both?
As an example, sorting column 1 on table 1 OR 2, will result in:
//ORIGINAL //RESULT
TABLE 1 TABLE 1
col1 | col2 col1 | col2
1 | 1 1 | 1
3 | 3 2 | 2
5 | 5 3 | 3
TABLE 2 TABLE 2
col1 | col 2 col1 | col 2
2 | 2 4 | 4
4 | 4 5 | 5
6 | 6 6 | 6
My header is calling a javascript file which sends out an email:
<script type="text/javascript" src="<?php bloginfo('template_directory') ?>/css/effects.js"></script>
But inside this file, I have a jQuery code that calls a .php file that does the actual sending of the email:
$.ajax({
type: "POST",
url: "css/sendmail.php",
data: dataString`
But the script doesn't work, unless the url is:
<?php bloginfo('template_directory') ?>/css/sendmail.php
and not just:
css/sendmail.php
Is there any way to include a path to the wordpress template directory inside js?
I'm trying to modify the Connection header with the following code with no success
jQuery.ajax({
url: URL,
async: boolVariable,
beforeSend: function(xhr)
{
xhr.setRequestHeader("Connection", "close");
}
})
The request headers via Firebug show:
Connection keep-alive
X-Requested-With XMLHttpRequest
Any odd bugs/problems with setting this particular header known? Or is there something I'm doing wrong?
Hi there.
Im sure the solution is simple but I cant figure it out :(
I need to combine two jquery selectors in one selector:
$(this) + $('input[type=text]:first')
$(this) is e.g div#selected so the result should be:
$('div#selected input[type=text]:first').focus();
How to do?
Hi,
I'm working on different language packs for my web app. Some of the output is generated by the JavaScript/JQuery and I can't use .aspx.resx resource files within the JavaScript. What options do I have in order to localize output produced by the client?
Thanky you
As maybe some of you know google chrome has put some severe limitation on greasemonkey scripts.
Chromium does not support @require, @resource, unsafeWindow, GM_registerMenuCommand, GM_setValue, or GM_getValue.
And without require, I can't find a way to include jquery library in Greasemonkey script under google chrome.
Does anybody have some advice for the matter?
Thanks in advance.
jQuery's 'live' method is unable to handle multiple events. Does anyone know of a good workaround to attach multiple events to a function that polls current and future elements? Or am I stuck using duplicate live methods for each event handler I need?
Example - I am trying to do something like:
$('.myclass').live('change keypress blur', function(){
// do stuff
});
I am using Jquery datepicker plugin and my requirement is I want to allow user to select Month and Year when he click on the Header say 'May 2010'. I want to make the Header say 'May 2010' of datepicker as a link and when he clicks on it, it should display a small div or option to select month and year with Apply and close buttons and when he click on apply the dat picker should change with the selected month and year.
Is it possible?
I use the jQuery-ui tabs widget as a navigation. Contents of all tabs are load via ajax. Seems that there is interference between tabs. I mean, for example, if in page1 in tab1, there is an element whose ID is foo, and in page2 in tab2, there is an element with the same ID. And in both page, there is javascript code to manipulate the element with ID foo, then weird things will happen.
How to deal with this situation?
I'm looking for a good jQuery plugin that allows HTML5 video playback, with graceful fallback to Flash (and potentially further, to default system player, etc). I've googled, but nothing I've found has been quite what I'm looking for. Any suggestions?
Does anyone know if theres a jquery autocomplete library that works similar to the one here:
http://www.thetrainline.com
(try and select a station to see what i mean) The one on here is a prototype library.
Basically all the ones ive found will only match characters if they appear at the beginning of a string, for example, if i typed 'ear' it would not match the word 'hear'. However this one seems to do that.
If anyone has any ideas id be very grateful.
I have this form:
<form action="contact.php" method="post" id="contactform">
<ol>
<li>
<label for="name">First Name * </label>
<input id="name" name="name" class="text" />
</li>
<li>
<label for="email">Your email * </label>
<input id="email" name="email" class="text" />
</li>
<li>
<label for="company">Company</label>
<input id="company" name="company" class="text" />
</li>
<li>
<label for="subject">Subject</label>
<input id="subject" name="subject" class="text" />
</li>
<li>
<label for="message">Message * </label>
<textarea id="message" name="message" rows="6" cols="50"></textarea>
</li>
<li class="buttons">
<input type="image" name="imageField" id="imageField" src="images/send.gif" />
</li>
</ol>
</form>
This javascript function that does some basic validation:
function validateRequired(field,alerttxt) {
with (field) {
if (value==null||value=="") {
alert(alerttxt);
return false;
}
return true;
}
}
And this script (written with jquery) to intercept the submit event
jQuery(document).ready(function(){
$('#contactform').submit(function(){
...
});
});
The problem is that, inside the last script I want to call validateRequired passing each required input/textarea (namely: name, email and message) as first parameter.
I tried like this:
validateRequired($('#name'));
but it doesn't work.
How can I do this?
I have a jQuery AJAX call with type:'GET' like this:
$.ajax({type:'GET',url:'/createUser',data:"userId=12345&userName=test"},
success:function(data){
alert('successful');
}
);
In my console output is:
GET:http://sample.com/createUser?userId=12345&userName=test
params: userId 12345
userName test
In my script i should get the value using $_GET['userId'] and $_GET['userName'] but i can't get the value passed in by ajax request using GET method.
Any ideas on how to do this?
thanks,
I am working on asp.net and c#.
I am using lots of ASP and HTML controls on the page and in some cases all the controls gets disabled.
Some of the used Controls are:
RadioButton
RadioButtonList
CheckBox
CheckBoxList
TextBox
DropDownList
Button
etc...
I need a Simple and short method to disabled all the Controls when i call this jQuery method on some condition.
Any Help?
Thanks in Advance...
is it possible to stop the submission of a form,after submit button has been clicked and get the action attribute and the request parameters of the submission using javascript(preferably jQuery) ?
I want to get the action and the parameter so that the it can be submitted to an alternate location ,what i am tryin to do is try writing a proxy website.