jquery

binding events on jquery created DOM elements

I like to create jquery elements in variables and place them where needed. var $someElement = $("<span class='someclass'>something</span>").css("cursor", "pointer"); $("body").append($someElement) for now everything is working. But if i try to bind a event to this element, the event does not get triggered: var $someElement = $("<span...

jQuery: how to get original value of this in methods

I'm trying to have some object oriented design using JS and jQuery. I have the following construstor: function A () { this.url = "some url"; $("rrr").autocomplete({ source: function(req, add){ $.getJSON(this.url, req, function(data) {} ... } As you guessed, I can't use this.url, since jQuery redefienes this. I can't u...

Select div with class "n" after another div with another class with Jquery

I have this jquery code to add the onclick event to minimize and maximize images collapsing and expanding the div with class mainBody. It was working before I added the div with class divSectionInfo which is now meant to expand when you click on the icon16 image and collapse divSectionInfo when close image is clicked. I am having probl...

How to get the src from image in jquery

i have 3 images with the same id="UserImages" i wanted to know if i can click on them and get the scr in jquery? ...

Search a MembershipUserCollection

Hi all, I am currently looking for a way to search though a MembershipUserCollection. At the moment the user will pick the role they wish to see. this could return 100's if not 1000's of records which are paged in a repeater. on the same screen the user can type in part of the user name they wish to find and it should filter the data...

creating an object/class and using it in jquery

Hi sorry if the name of my question is not correct. i am trying to create an image rotator, but i would like to be able to re-use it more than once in a page, so i am trying to create it as an object/class. I have about 5 or 6 images on a page. i would like to have each image as a rotator, displaying a new image every 2 seconds or so...

JQuery expressions in JMeter

I have a page that uses JQuery. This page also has hidden fields whose value is populated dynamically by JQuery (upon dropdown selection). Now I have an javascript/jquery expression similar to this $('*[name=staffid]').val() - this expression provides me the selected value. I would like to store this value in a variable within JMeter...

use $(this) instead of selector

How would I use $(this) instead of the full selector in the code below in the "if" statement. I tried a few different combination of "this" usage and none worked. Among them are... if ($("this :selected").text().indexOf("[Subtract") >= 0){ if ($(this" :selected").text().indexOf("[Subtract") >= 0){ I am sure its gotta be something rea...

JQuery AJAX Event Problem

Hi, I am having trouble fixing a bug in an existing ASP.NET MVC web site. One of the views has a series of text boxes where the user enters data. Each text box has some javascript attached to the blur event in order to post back to the server when the text is changed. More specifically the code is using the JQuery $.ajax method to make ...

jQuery triggering a click event appears to be running one step behind

Hi, I am using tablesorter plugin which is great. I have had to clone the original header and then re-insert the clone above a scrollable area. To fire the tablesorter plugin on the hidden old table header elements i am triggering a click using .trigger() on the hidden table when a user clicks on the visible cloned table. Here is the...

jQuery build table with events

I've just start playing about with jQuery and want to place the results of a ajax call into a table ... I've written the following function (for test not actual) function AjaxSucceeded(result) { $("#pageLabel").html(''); $("#pageLabel").append($("<table>").attr("id", "outputTable").append($('<tbody>'))); ...

jQuery Validation in Chrome

Hi Friend, I have a Jquery Validation code in which I have written element.focus(); When I view that page into other browser I able to modify that previous Field if I was left next field blank or wrong input. but in chrome i wont able to do so..! Can you please explain the reason behind this? Thanks in Advanced...! The Full Code...

Testing the speed of a jQuery function in IE

I have two pretty elaborate jQuery functions that produce the exact same result, but they do it in two entirely different ways. What is an easy way to compare the duration of the two functions? (Testing in IE7 specifically.) ...

How move a jquery script like "ddaccordion.init" in an external js ?

Hi im trying to put all my js in external js file, for the header for my site be more light. So in my header i have this script, wich work well : ddaccordion.init({ headerclass: "p7ABtrig", //Shared CSS class name of headers group contentclass: "p7ABcontent", //Shared CSS class name of contents group ...

How can we remove html tag by using Jquery?

How can we remove html tag by using Jquery e.g we have this html <div><dd>hello world</dd></div> i want to remove <dd> tag and produce this output <div>hello world</div> ...

jquery simple animate/rotate of a css background-image inside a div?

Hi all, I was wondering if anyone could help me out, or point me in the right direction. I'm looking for a snippet of jquery that will automatically change the background image of a div every say 5 seconds or so. My initial bg image is set in css, but i'm not sure how to create the function to make it swap between an array of images? I...

is jquery-ujs all I need to use jquery with rails 3?

Will jquery-ujs give me all the helpers etc. that are used for all ajax helpers etc. that worked with prototype/script.? ...

Access img tag src using jQuery

Can I do this? $("#myImage"+1).attr("src", "path/to/newImage.jpg"); Because the image is like an array so the id for the img tag is myImage1 <img src="path/to/oldImage.jpg" id="myImage1"> ...

How can I change the folder of my URL with JQuery?

Let's get to the point, when at this site mysite.com/en/index.html or mysite.com/en/model1/index.html and clicking on an <a href="swap current url to /FR/...">FR</a> (or country flag img) What should I do to load this other page? mysite.com/fr/index.html or mysite.com/fr/model1/index.html I know urlParser JQUery plugin for getti...

Setting width and height of images with jquery in webkit browsers

Hello! I have an image with mypic class I'm using the load event to set the width and height of this image: $(window).load(function() { //Here I calculate final w and h $('.mypic').css("width",w); $('.mypic').css("height",h); $('.mypic').height(h); $('.mypic').width(w); }); In firefox I have no problem at all...