jquery

AJAX with Jquery in ASP.MVC2

I'd like to get something via Ajax and put it into What i have to return from Controler Action to put this into that DIV? Right now i had standard ASP.MVC view as result... public ActrionResult MyAction() { return View(); } and in javascript i have: $.get(<url to controler action>, null, function(data) { $(#result).html(data); }...

Using Unobtrusive JavaScript to Update an Element

As you know, when you upgrade from Rails 2 to 3 you replace this: link_to_remote "more", :url => {...} with this: link_to "more", {...}, :remote => true But how do you handle the :update option in link_to_remote? In Railscast #205 Ryan Bates demonstrates link_to with :remote and a server response that includes JavaScript code to up...

Is there a jQuery selector to accomplish this task?

I have these 4 HTML snippets: Siblings: <div class="a">...</div> <div class="b">...</div> <!--selected--> <div class="b">...</div> <!--not selected--> Wrapped 1: <div class="a">...</div> <div> <div class="b">...</div> <!--selected--> </div> <div class="b">...</div> <!--not selected--> Wrapped 2: <div> ...

dealing with delay in populating select options

My code tries repopulate options and select an element. Issues is populate does lot of task an repopulates 3 select boxes. My method control returns but when i try to select, options are not yet populated. This happens some times with slower systems / Browsers. (And specifically on IE) Is there a way to prevent this using jQuery or somet...

html agility pack vs antixss

Hi All, It seems to me just using the html agility pack would work to prevent xss (parse then get innertext). Would it be repetitive to use antixss after using hap? Thanks, rod. ...

Combining jQuery and Pixastic. I cannot get the two to work.

I've been banging my head against the wall all day with this one. Here is the link http://www.olliemccarthy.com/test/blur-experiment/ I just want to click on the image and then see it blur out. That's it. Here is the code I've been using so far. $(document).ready(function() { $('.test').click(function() { $(this).("blurfast", {a...

Jquery Ajax call with django

Dear, I'm a bit stuck with the following situation: I'm using an ajax call to submit a form, i use the form values to do some 'query' in django. When this happened and i got the correct queryset it delivers me an HttP response in the form of a csv. I setted up the headers and all stuff needed to get the 'save file as' window... unfortu...

Why do I get an error message that .replace is not a function?

I have this function: function countLitreKgSums(cProductIds){ var cLitreKgSums = new Array(); var cWeek = 0; for(i=0;i<cProductIds.length;i++){ var cLitreKgSum = 0; $("#plan_table td[class='week']").each(function(){ cWeek = $(this).html(); var cLitreKgValue = $("input[name*='plan_table_week" + cWeek...

IE7 hangs when using (to much) ajax calls with async: false

I have the following function in a much larger script that loads translations from a php file: function loadLanguages(language){ var data = new Object(); data.language = language; var dataString = $.toJSON(data); var langSt = $.ajax({ url: "/VID/ajax/loadtranslations.php", data: ({data: dataString}), async: false }).responseT...

How best to reduce duplication across pages

I have a site that has a big form page and about half of the form will be used elsewhere, and it will be exactly the same. I want the same access to all of its elements wherever I place it, but I don't want to copy and paste the code around because that will make for too much room for error. I'd prefer to not use a WebUserControl, as I'l...

Rails and JQuery - can't disable a links default action.

I have a "checked" link which goes off to the same names controller action. Its routed as a POST request. Ive setup up the code but whats happening is the jquery $.post fires as wanted but the html request also happens meaning my action is being called twice. I can't figure out why. Can anyone spot a mistake im making? In my applicati...

Create div dynamically with options for the selected object

I have a component that is draggable, and would enable the option to select when you show a little div on one corner, with some options (delete, new). Well, I'm trying to see some components some programming to do that, and unfortunately found nothing practical. There are some library but has a size gigange (versions with 112KB min.) so...

Paginated jQuery Result Set from XML File Problem

Hello there guys! I am having a spot of bother with a code I am developing to show 10 Magazines at a time that is being fed from an xml file. I have it working to some extent, FF and IE7+8 do not like it, maybe as it says there is an error on line 62 - being the core function calling the data to be fed in. Here is my code: <!DOCTYPE h...

Javascript plugin for cross-browser range

Hi Is there cross-browser javascript plugin (jquery/any js library) for handling ranges, especially Firefox's range object(https://developer.mozilla.org/en/DOM/range) and Internet Explorer's TextRange (http://www.webreference.com/js/column12/trmethods.html)? Thanks Srikanth ...

form validation with jQuery and php

i have a form with im validating using jquery and php so basically if the php echoes "input must be filled " the jQuery should put a red border around that input, but the thing works only after submitting the form two times, i explain: if i submit with input unfilled the php file echoes "input must be filled ", but only if i press agai...

Supply data available via Jquery in .Net MVC 2

Hi. I am trying to create a partial view I call ImageViewer. It will be called supplying a list of image ids (simplified). I then want to return this partial view, something like imagecontroller.ImageViewer(new int[] { 5, 6, 7 }); yields the following: <div> <img grayuparrow /> <img source="image/getimage5" /> <img blackdownar...

jQuery nested animations + AJAX

I'm building a site and trying to initiate some animations, followed by content loading, followed by animations on a click. The idea is that user clicks, image fades in & then out, content area slides up, new content is loaded within, then content slides back down. When I run it on my test machine, it's fine, but once I upload it onlin...

So how does $.ajaxError work?

I use $.get, $.post, and $.getJSON extensively, so I wanted to see how .ajaxError worked. I tried this... $(document).ajaxError(function (e, xhr, options, error) { console.log(e); console.log(xhr); console.log(options); console.log(error); }); and I also tried putting it inside my $(document).ready().. And then I disab...

Passing whether a checkbox is checked, via jQuery, to PHP

Hi folks! I have an AJAX call in my jQuery/PHP app. It needs to send some data to a PHP script to process (I have this part working fine). My jQuery variable: var form_data = { urltitle: '<?php echo $urltitle; ?>', subscribe: $('#subscribe').val(), comment: $('#commentbox').val() }; This works fine, the PHP script reads the...

jquery flip! background

Hi, I'm using the Flip Plugin on a new site I'm making: http://www.concept-it.be/padre (click on contact and then on the e-mail address). As you can see the background of the div becomes gray after when the flip starts and it stay's like this. I don't mind having it like that when flipping but after the flip I want my backgroundimage ...