hi, i send ajax requests with jquery, and i have a function:
$('input').ajaxSuccess(function(e, xhr, settings) {
console.log(xhr.responseText);
});
Ajax response ara russian letters in utf-8, all server (apache, php) and files are in utf-8 but response text is something like this:
\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u043e \u0431\u0443\u043a\u0432!
how could i decode this characters to normal words? Thanks for help!
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!
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
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?
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
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?
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?
While just playing with jQuery/JavaScript I ran across this problem. I could capture Alt and Ctrl keys but NOT Del and certainly not all of them together.
$(document).ready(function() {
$("#target").keydown(function(event) {
if (event.ctrlKey && event.altKey && event.keyCode == '46') {
alter("Ctrl-Alt-Del combination");
}
});
});
Is it possible to capture all these three keys together?
Is it possible to handle such events as:
"ctrl" + mouse left button click;
"shift" + mouse left button click;
"alt" + mouse left button click
by using JavaScript/jquery(or other framework).
If it is possible, please give a code example for it.
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.
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?
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 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?
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 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 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,
What is the best way to detect if a jQuery-selector returns an empty object.
If you do:
alert($('#notAnElement'));
you get [object Object], so the way I do it now is:
alert($('#notAnElement').get(0));
which will write "undefined", and so you can do a check for that. But it seems very bad. What other way is there?
Hi.
I'm looking for a jQuery Plugin to create a graph like that http://www.panic.com/blog/2010/03/the-panic-status-board/. To update the graph every x miliseconds from a PHP page and the numbers that are on the top. Is it possible?
Do you know any plugin that does that? 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...