jquery

Unit testing Javascript/JQuery with JSUnit vs Qunit vs XUnit

We are using JQuery and some bit of Javascript in our project. We are thinking of writing some unit test around it for which there are different ways like JSUnit, Qunit, XUnit Can anyone suggest which is the best way to unit test javascript/jquery and if possible with some good link? ...

$.post to Error Page

I am doing an ajax post in my code like this, $.post("myAction",$("#myForm").serialize(), function(response) {alert(response);}); if my response is an error message from my controller, I would like to display it not in an alert box, but in a regular browser page. How can I do this? Thanks. ...

how to get the text of a span tag and insert in into a hidden field

Hi, I'm trying to get the text of a span tag and add it to a hidden field, any ideas how this is possible with jquery. thanks <form> <span class="descriptionsPizza">EXTRA CHEESE</span> <input name="textfield1" type="text" id="textfield1" class="valfield" size="2" maxlength="2" value="0" /> <span class="descriptionsPizza">HAM<...

Jquery permission denied - different domain name.

I have developed a set of apis that live on an asp.net mvc application, but will be consumed from a browser accessing our main site (which lives on a LAMP stack). The domain names look like this: http://www.mainsite.org API's http://apis.www.mainsite.org (originally, apis.mainsite.org, but I made the modification in an attempt to fix...

Use jQuery to check if all div's are hidden

How would I check if all the div's with class test are hidden. And if they are all hidden set wrap1 to hidden. Thanks. <div id='wrap1'> <div class="header">Header 1</div> <div class='test'><a href="#">Test 1</a></div> <div class='test'><a href="#">Test 2</a></div> <div class='test'><a href="#">Test 3</a></div> </div> UPDATE: Thanks ev...

how to match the value of two variables in Jquery

I was just wondering how I can match the value of two variable, for example if I have var A = [1,2,3]; var b = [A,B,C]; how can I output the first value of each and second value of each and so on, so the output will become A1,B2,C3 thanks ...

Using maskMoney input pluging -- still need some assistance

Ok, considering the regular expressions aren't working properly and there are no errors, I'm going to try and use the money mask. The goal is still to only allow numeric characters and a decimal. With maskMoney, that does the work for you. Also, I need to be able to successfully calculate each cell. As of right now, the masks are wo...

Pseudo-code for shelf-stacking

Suppose I have some serially numbered items that are 1-n units wide, that need to be displayed in rows. Each row is m units wide. I need some pseudo-code that will output the rows, for me, so that the m-width limit is kept. This is not a knapsack problem, as the items must remain in serial number order - empty spaces at the end of rows a...

jQuery adding <li> Item and click Events

Very new to jQuery, if dupe question sorry at this point not even sure I am using correct verbiage. I need to add a li item to a ul based on a click event of a ListBox (user selects text and a new li is added with the selected text). And I need to add a icon, label and input on the li item. The icon needs to be a 'remove' icon. How can...

toggle link in jquery

I am trying to toggle a link that has id showmember. I did the following $("#table2").hide(); //this is for hiding table when page loads first time $("#showmember").toggle(function(){ $("#table2").show(); $("#showmember").html("Hide Member Details"); event.preventDefault(); }, function () { ...

clone table row

How can i use javascript (i assume) to clone a table row like ive beautifully illustrated in the picture below? ...

Creating mosaic/tiled image effect with jquery

Is there a way to create the effect shown here on msi.com main image? Though done in flash, I'd prefer doing it with jquery. I've also tried with 'mosaic generators', but haven't been able to replicate the effect well, but use of a generator with js would be acceptable too. [edit] I failed to mention, I'm only interested in emulated t...

How do you JSON serialize a set of hidden input values (jQuery can be used)?

I have the following DOM structure.. <input id="WorkAssignmentID_3462" type="hidden" value="3462" name="WorkAssignmentID"/> <input id="WorkItemID_3462" type="hidden" value="3633" name="WorkItemID"/> <input id="EmployeeID_3462" type="hidden" value="15" name="EmployeeID"/> <input id="AssignedBy_3462" type="hidden" value="Jonathan Erickson...

Sizzle Selector Engine Error

I'm attempting to use jQuery and ASP.NET. I am pasting the server control "ClientID" into a jQuery selector and I'm getting an error (with no error text) from the Sizzle selector engine. My selector looks like this... $('#ctl00_ContentPlaceHolder1__phProfileHeader__filProfileImage') Is it the length that might be causing the problem...

How to use jQuery to change the backgound color of a textbox?

How to use jQuery to change the backgound color of a textbox? Thanks a lot!!! ...

Accessing only one element that has a shared name in an XML DOM using jquery

I'm having trouble accessing only one XML element that has the same name as other elements (i this case, the tag "name"). How do I access ONLY the "wantedName" below using jQuery? <sample> <input> <value>0.2</value> <name>varName</name> </input> <name>wantedName</name> <output> <value>4</value> <name>varName2</name...

Most jQuery-like HTML parser for Ruby

What HTML parser for Ruby will I find easiest to use if I'm already familiar / in love with jQuery? Such a parser would have jQuery's overall philosophy -- "grab some HTML elements (using CSS selectors) and do things with them" -- and in addition have equivalents for all of jQuery's DOM manipulation functionality (prepend(), after(), et...

How do I use jqGrid with ASP.NET MVC?

I have just started using jqGrid, and I have some tables that I would like to display within it. Can anyone tell me what the proper way would be to populate this grid using ASP.NET MVC? How do I pass information from my controller to the jqGrid? Does it need to be a particular format? If anyone can provide some information regardin...

NetBeans jQuery Autocomplete Not Working

Autocomplete for jQuery works in my NetBeans on my Mac but not on my PC. Any ideas? Using NetBeans 6.7.1. ...

jqGrid 'url' parameter causes errors in pages in deeper URLs

I'm trying to deploy an ASP.NET MVC site to a Windows 2003, IIS 6.0 server with the 3.5 framework installed (but not ASP.NET MVC - it's just in the bin folder). The site makes use of jqGrid, but on the deployment server the grid is failing in certain cases. The web site's master page is at /Views/Shared/Site.Master. It has a script tag ...