I've got a simple HTML page
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home </title>
<script type="text/javascript" src="_includes/jquery.js"></script>
<script type="text/javascript" src="_includ...
I did similar things with this before:
$.append(html,listener);
This will work for me because the listener will be added AFTER html is loaded.
And I can't do this:
$.html(html);
listener();
Because this way I can't ensure html is loaded.
How to do it the right way?
...
I want to have a click event on the body tag, but I have a div under the body tag which i dont want to have the click event on. I have tryed with this but that doesent seem to work correct:
$("body").not("#InnerDiv").click(function() {
alert("Hejhej");
});
The html:
<body>
<div id="1">1</div>
<div id="2">2</div>
<div id=...
Hi All
As part of my efforts to learn jquery, I'm making my own modal window. Everything seems fine so far, but I just can't get clicking on the overlay to fire the close. Anyone any ideas why?
You can check it on jsbin here - http://jsbin.com/irado
Here's my script:
var $j = jQuery.noConflict();
$j(document).ready(function () {
// P...
I have an AJAX call in the following format:
$.get('/controller/method/',
{
parameter1: value1,
parameter2: value2
},
function(data) {
if (data) {
}
else {
}
});
Is it possible to pass an array as a parameter?
parameter3: new Array(1, 2, 3)
parameter4: new Array('one' => 1, 'two' => 2, 'three' => 3)
...
<ul>
<li class="append-me">Content A</li>
<li class="append-me">Content B</li>
<li class="dont-append-me">Content C</li>
</ul>
<a id="append-it" href="#">Append!</a>
<div id="appended-items"></div>
<script>
$("#append-it").click(function(){
$("#appended-items").append($(".append-me"));
});
</script>
When ...
Background
I use a Tornado-like server with support for long-polls. Each web pages a user clicks around to sets up a long poll to the server like this:
$.ajax({
type: 'GET',
url: "/mylongpollurl/",
dataType: 'application/json',
success: function(json) {
// I do stuff here
},
error: function(xhr, errText, ...
Right now, I have a scenario with several UL's with 5 or more LI's - for each UL, I'd like to apply a specific style to the 5th LI.
Using:
$("ul li:eq(4)")
Works fine for the first UL on the page, but farts out for the remaining UL's. Any idea how to get this hit all the UL's?
Also, ultimately I'd like to target multiple's of 5 - so...
I've looked at all the tutorials I can find, examined the questions on here and read the jQuery UI Tabs source but I still can't figure this out.
My goal is to have a rotating content box, with an fx fade and mouseover effect on the navigation numbers.
You can see the almost working version here:
http://www.chesapeakelifemag.com/index....
$.prev("div.a").find('.b').
$.prev("div.a .b").
One works and the other does not. What's the difference?
...
Hello, i'm trying to build a contact form in Rails 2.3.4. I'm using the jQuery Form plugin along with this (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) for validations. Everything works in my development environment (mac os x snow leopard), the loading gif appears and on my log the email gets sent and the "request co...
I have the following jQuery line:
$('#newStep2 input#name').focus().css('background','Red');
Where I am trying to set the focus of a textbox (#name). I am only setting the background to debug to make sure it works.
Well, the background turns red, but the input is not receiving the focus. Um?
EDIT
HTML, per request:
<fieldset id="...
There will sometimes be a lot of mouseover events and the $("*") selector may be expensive. Will this slow my pages to a crawl on slow machines running IE6?
Is there a better way to do this? I want to know about every mouseover event that happens on a page.
...
If I have an element (html) nested in another element and both of them have a click handler attached, clicking the inner element executes its click handler and then bubbles up to the parent and executes its click handler. That's how I understand it.
Do events bubble up the DOM tree if there are no events attached that are the same and i...
On my web page, I have this CSS:
tr:hover {
background-color: #f0f;
}
Which works nicely in all browsers except for good ole IE. I know that I can just write some jQuery to add and remove a class on mouse over/out, but I'd prefer not to handicap (albeit ever so slightly) all the other browsers which support :hover properly - so I ...
how can i express the value of a textbox in xpath ?
the text that was just typed into the textbox.
so if i type apple inside a textbox, i need to output the value of this in xpath.
...
I'm using the jquery taconite plugin to make an ajax request that will replace a certain element in my page, however the element has an id like "email.subject"..
I can select it just fine if I do '$("email\\.subject")', but when I try to use the taconite plugin like this:
<taconite>
<replaceWith select="#email\\.subject">
...
jquery: how to check if user entered txt inside textbox and if user clicked on checkbox, and if user selected something from dropdown select ?
so like if a user enters xxxx inside input box, i need to detect this.
same with checkbox, dropdown, all forms.
...
I have a toggle fade effect but when you click the button multiple times it fades in and out more than once. (So if i click the fade id 20 times fast it will fade in and out multiple times) How would I stop this and make it so that you can only toggle the fade when the animation was done? I tried getting the current value and making a if...
Hello good people,
Hopefully this is something that will be easy to remedy. I'm having a bit of an issue understanding the jQuery Pagination plugin.
Essentially, all I am trying to do is load a PHP file, and then paginate the results. I'm attempting to go off their example, but I am not yielding the results I'm looking for.
Here's t...