I want to build a survey which has about 20 questions. All questions are in the same page.
The structure of whole survey is like the tree structure.
Initially, only one question is shown in the page.
if user chooses option 1,2 of question 1, the survey ends.
if user chooses option 3,4,5 of question 1, then question 2 appears.
if user...
Hi all
I have been working on on an AJAX chat application using php, mysql. It's almost done now; the only issue I am facing is that the textbox where the user types his message to post a reply keeps losing its focus during the async ajax calls.
What is happening here is that I have two divs which are being constantly updated with two ...
I am using jQuery, and wish to make certain links open in a new window.
However, I want to pass as valid XHTML 1.1. Also, I beleive this is a behaviour which should be in the correct layer, i.e. JavaScript.
Any jQuery plugin available?
...
I've just started learning Jquery but the examples aren't helping me much...
Now whats happening with the following code is that I have 4 forms that I switch between using a link for each. But what I can't figure out is how to get variable "postOptionSelected" in the first function to pass to the other functions to display even more use...
I have a view which is composed of top, left and bottom headers and a main contents pane. Suppose that during an AJAX request I need to update the HTML of the top, bottom and main panels (the left header should stay the same).
I was wondering what would be the best way to accomplish this. The first thought was to put the main contents ...
function now(){
return +new Date;
}
questions :
what does the plus sign mean?
when can you create a new object with a constructor function but without the following parentheses, such as new Date but not new Date()
great thanks!
...
I am running thickbox and jquery ui draggable both on the same page, and they are conflicting.
Jquery UI Draggable allows me to drag and drop things from one place to another with this code:
$(".droppable").droppable({
drop: function(ev, ui) {
do stuff
}
});
Thickbox starts on a click event, with essentiall...
Hi All
My PHP script generates a table with rows which can optionaly be edited or deleted. There is also a possibilety to create a new Row.
I am having a hard time to figure out how to update the HTML rows which are generated through PHP and inserted via jQuery. After the update it must be still editable. The HTML is generated into a d...
I'm trying to load an external JavaScript using jQuery's getScript(), like this:
$.getScript("http://api.recaptcha.net/js/recaptcha_ajax.js", function(data) {
window.alert(data);
});
but as the alert window shows, the data variable in the callback function is undefined, unlike promised in http://docs.jquery.com/Ajax/jQuery.getScript#...
Hello, a I have some images on page and I want to put <span> tag bellow each images, with 'alt' text , with jQuery
I began with :
HTML
<div class='container'>
<img src='images/1.jpg' alt='text1' />
<img src='images/2.jpg' alt='text2' />
<img src='images/3.jpg' alt='text3' />
</div>
jQuery
$(".container img").after("<s...
I'm trying to figure out how to get the distance of an li from the top of the containing ul to allow me to position something next to it. However, using position() or offset() in jQuery seem to return a position from the top of the page or another higher element. Is there a plugin or any way to specify where you want the position calcula...
Hi,
I'm working on an MVC web application and have a requirement to have a variable length list of items. User should be able to add / edit and delete rows with a save doing a batch update on all rows.
I started off working from two blog posts which have pretty much covered most of the work so all credit to Steve Sanderson.
Editing a ...
Is there a jQuery way to perform iteration over an object's members, such as in:
for (var member in obj) {
...
}
I just don't like this for sticking out from amongst my lovely jQuery notation!
...
To be specific, I'm talking about avoiding this type of code:
<input type='text' id='title_33' class='title'
onfocus='updateCharsLeft(33);'
onkeypress='updateCharsLeft(33);' />
Here I would like to put the onfocus and onkeypress event handles separately, i.e in a .js file. Like this:
$(document).ready(function()
{
$(".titl...
Hi,
i'm trying to submit my Ajax form using jQuery. However calling the submit() function causes the entire page to refresh. It should just execute the onSubmit part of the form (which returns false so that the page shouldn't refresh).
<%Ajax.BeginForm("AllocateAndUpdateMech",
New With {.Controller = "Planning",
.Id = M...
I have a colection of checkboxes with generated ids and for a reason, some have an extra attribute. Is possible using JQuery to check if an element has a specific attribut ?
For example can I verify if the following element has as attribute "myattr" ? The value of the attribute can vary.
<input type="checkbox" id="A" myattr="val_attr">A...
Please help to replace these jQuery functions with Prototype ones:
$("button,input,label,select,textarea").bind('mouseover mouseout',
function(){$(this).toggleClass('hover')});
$("button,input,select,textarea").bind('focus blur',
function(){$(this).toggleClass('focus')});
...
We recently built a web app using Prototype, making a fair amount of use of its Class.Create() functionality. Right now, we're considering migrating to jQuery as it seems to be considered a 'better' library. I've been doing some reading on the topic and found out that jQuery does not have straightforward built-in support for class-creati...
I am using jquery to keep the focus on a text box when you click on a specific div. It works well in Internet Explorer but not in Firefox. Any suggestions?
var clickedDiv = false;
$('input').blur(function() { if (clickedDiv) { $('input').focus(); } });
$('div').mousedown(function() { clickedDiv = true; })
.mouseup(function() {...
I am having a Tooltip (larger image view) that is being positioned via e.pageX e.pageY and i am trying to make sure it is not hidden below the current scrolled view port.
I have seen many sites have this
my code is something like this but i am missing something.
var positionImg = function(e) {
var viewportWidth = $(window).width();...