Here is my jQuery code:
$.get('/Home/GetList', function(data) {
debugger;
$('#myMultiSelect').val(data);
});
Here is my controller code:
public ActionResult GetList(int id)
{
int[] bodyParts = _repository.GetList(id);
//how do i return this as an array back to javascript ??
...
is there a way to unselect all items of a listbox using jquery without looping through each item?
...
I put a breakpoint on the controller action but it never fires. Is there anyway to catch errors on a jquery post?
here is my jquery javascript code:
<script type="text/javascript">
$(document).ready(function() {
$('#commitExerciseButton').live('click', function() {
$.post($("#exerciseForm").attr('action'), ...
I'm using the jQuery UI Accordion 1.6 (http://docs.jquery.com/UI/Accordion), I've changed it a bit and made it work as I need and want it to work. There is just a few things off about it, but one of the major ones is something I just simply can't figure out how to make it work.
The plugin is working as intended, it actually closes, ope...
hello
my html
<div id="parent">
<div id="child">cx</div>
</div>
when i use jquery
$('#parent').mouseout(function(){
//something here
});
i wonder why when my mouse enter the child div the function fires. i'm still inside parent div.
i want that mouseout function to fire only when i leave the parent div not when i'm on any child ...
Is it achievable in jquery to bind an event to a group of control that has certain class? It seems to me, it can't. I google a bit and all that came up are nothing to do with events. Here's how my code looks -
$('.numonly').bind('keypress',function(event){
if (event.which > 31 && (event.which < 48 || event.which > 57)) return false;...
ASP.NET is changing id, name values according to control's parent control name. That's why i am searching id with JQUERY as below.
// $ is looking to the end of "id" attribute of input elements
$("input[id$='cbAddToNews']")
Only one element is returning by jQuery. But when i want to change the attribute, I'm using this syntax:
$($("i...
I have the following code which I use to match fancybox possible elements:
$('a.grouped_elements').each(function(){
var elem = $(this);
// Convert everything to lower case to match smart
if(elem.attr('href').toLowerCase().match('/gif|jpg|jpeg|png/') != null) {
elem.fancybox();
}
});
It works great with JPGs but...
I write a simple piece of code that creates a div and assign it a class name:
$('#create_div').click(
function() {
div = $("<div>").addClass("myClass");
$("body").append(div);
}
);
Ok: after "create_div" button is fired the function appends the new div to body container.
Now... : How to select the new element created ? How...
Is there a jQuery plugin or javascript library that supports a "genie" animation effect like the apple Mac OS X dock?
Bonus: Actionscript library? C/C++? .NET? Objective C?
...
Hi,
Someday i've downloaded a very nice jquery editor but i lost it and i only have a screenshot of it. You just type a tag and press return or space and it's will be inside a nice box, and you can delete it by only pressing the backspace key or the close icon.
Please don't suggest me That because it's so poor and the tags are insert...
Is there any way I can direct display PDF files in modal boxes?
I am using CodeIgniter PHP framework and jQuery as JavaScript framework.
UPDATE: I read on net that this is possible by loading it in iframe, and Adobe PDF will render it, but many seems to oppose, so is there any way I can convert those PDFs to images?
...
I have a listed navigation with letters and i am trying to call the actors and directors from different json files when the user clicked a letter. I used 2 ajax calls to get the data from actor.php and director.php. It works fine on my local machine, but only the first one works on server. How can i make each ajax calls working?
$(docu...
Hi guys, I have the following problem. Sometimes the refetchEvents method works well but sometimes works bad (Slow fetchs). For example sometimes I have to do double click in my button for call this method for render the events correctly from my database.
So my calendar is not updated correctly when I add a new event.
Do you have the s...
I have noticed that sometimes people have to use multiple versions of jQuery in the same page (See question 1 and question 2). I assume people have to carry old versions of jQuery because some pieces of their code is based on an older version of jQuery. Obviously, this approach causes inefficiency. The ideal solution is to refactor the o...
Hello,
Say i have the following html:
<span class="fruit">Apple</span>
<span class="fruit">banana</span>
<span class="fruit">Apple</span>
<span class="fruit">Apple</span>
<span class="fruit">orange</span>
I tried different methods but it didn't work, I want a jQuery code to remove all (.fruit) spans with same content but keep one (th...
I've run into the problem that has been addressed here without a workaround: I can't use stopPropagation() on dynamically spawned elements.
I've tried creating a condition to exclude a click within the dimensions of the spawned element, but that doesn't seem to work at all.
Here is what I got:
1) a large background element ("canvas") ...
Does jQuery validation plugin have some dependencies? For example, I saw blogposts that said delegate plugin should be used... but I don't see this plugin reference at any validation plugin example (for example, here: http://jquery.bassistance.de/validate/demo/milk/).
The question arouse because validation plugin doesn't catch submit at...
Hey Guys
I am getting several errors only on IE8 running on my vista OS. On the other browsers (Chrome, FF, Safari) everything works fine. Not sure where to begin looking.
When I open a new IE8 browser and enter the homepage URL of my website - I get the following error and the page opens up blank:
Line: 19
Character: 12043
Code: 0
E...
I have a jquery $.get() call in my app that requests an entire web page. In the callback function, I access a div in the returned page, get its data and show it on my page.
The problem is that the text I get from the div does not preserve the source formatting. If the div in the requested page had say an ordered list, then when i get t...