jquery-ajax

ASP.NET MVC JsonResult return 500

Hi I have this controller method: public JsonResult List(int number) { var list = new Dictionary<int, string>(); list.Add(1, "one"); list.Add(2, "two"); list.Add(3, "three"); var q = (from h in list where h.Key == number select new ...

jquery ajax codeigniter

Hi, I wanted to ask, why does the response from a ajax request using the native ajax not post or get return my entire page? is there anything I should know? I have looked at the documentation on jquery.com and nothing is mentioned of something like that unless i'm looking else where. Can I get any help on why that keeps happening? This...

how to add lightbox to image loaded externally in jquery?

I am loading images externally using jQuery load function.. but not able add light box.. am very new to jquery. var href = $('#images').attr('href'); $('#images').click(function(){ var toLoad = $(this).attr('href')+' #content'; $('#content').hide('fast',loadContent); $('#load').remove(); $('#wrapper').append('...

jquery checkbox attribute value

I have this span that is in a loop and produce multiple results. what I want is the attribute recordID value when its checked <span id="row" index="<?php print $i; ?>" recordID="<?php print $row->ID; ?>" Color="<?php print $row->Color; ?>"> <input type="checkbox" style="left:10;" /> </span> I am using this in my js file to che...

jQuery Ajax Callback Failing after WordPress 3.0 Update

I have a bunch of jQuery Ajax calls on my WordPress website. After making the update to WP 3.0, I've noticed they aren't working properly anymore. The PHP server script is getting called, because the action takes place (Ex: deleting a record in a database, which happens successfully). The issue is that the success callback isn't firin...

attribute value

I have an atribute test that I get the value of like this $('#row').attr("test"); now I need to put this in a loop and get the value but its not working. This is what I am doing for(var i=0; i=mySpansCount; i++) { var x=($('#row').attr("test")); alert(x[i]); } All I am getting in alert box is undefined. Thanks ...

Highlight live search results

I'm trying to highlight the text that matches the query in a live search using jquery.highlight. The live search works fine but the styling for the highlighting applies then it disappears. Am I doing something wrong? JQuery $(document).ready(function() { $("#search").bind("keyup", function() { var form = $(this).parents("form")...

make AJAX\jQuery\JavaScript load pictures?

I want to load picture from web server without refreshing the page. I have simple page: <body><h1>Test</h1> <div id="mydiv"> <img src="animals.jpg"/> </div> </body> </html> the point is that animals.jpg content changes (i.e now animals.jpg can be picture of wolf but after minute it will be changed to a c...

jquery callback called without waiting for response

hey, i am using the following function, $.ajax({ type: 'POST', url: "/User/SaveMyDetailsSettings", data: mySettings.MyDetailsForm.serialize(), success: function (data) { alert("callback"); alert(data); if (data == "Success") { window.location = "User/MySettings"; } else...

Trigger jQuery's ajaxStop event when aborted calls exist

I've used jQuery's ajaxSend and ajaxStop to show a spinner whenever ajax requests are active. It works except when some of my plugins abort their ajax requests, ajaxStop does not trigger and will not trigger until after the page is refreshed. It seems like the aborted request still counts to jQuery. Can I make ajaxStop trigger or is ther...

jquery ajax response empty

I've run into a difficult issue with ajax. I've got 2 files. 1 file calls the other, using the .ajax api. So far I have no issues. The problem I'm running into is due to how I return a response to the ajax, from the 2nd file. Usually I use the php "return" function. Which then lets me decide what to do with that text. However, I re...

Using the new facebook graph api, ajax calls returns null (empty)

Hi all experts! Im trying out the new graph api for facebook. I'm trying to fetch some data using jquery ajax. This is a sample of my javascript code, very basic... var mUrl = 'https://graph.facebook.com/19292868552'; $.ajax({ url: mUrl, dataType: 'json', success: function(data, status) { $('#test'...

jQuery AJAX Form, cannot send array?

Hello, I'm practicing my jQuery skills (ok, learning too) and experienced an issue. I got a file upload form with file input. I'm using this plugin (http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Uploading) to upload multiple files at once. So I'm using following form input: <input type="file" class="multi" name="photo[]" ac...

jquery, .ajax() success function looping only first element of openx ad is displayed in browser.

how to loop over the jquery .ajax() success function. i m getting openx banner in loop but success function is not iterating and displaying it only first element of the for loop is displayed. here is the example code: This is in html file: staticurl='http://d1.openx.org/avw.php?zoneid=' zoneidList=new Array('110904','110903','110905'); ...

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...

Showing both MVC Ajax calls and jQuery Ajax calls with one indicator

Hi All, I have a web application that utilises both the MVC Ajax calls: Html.ActionLink() rendering as Sys.Mvc.AsyncForm.handleClick( in the page source and: jQuery Ajax calls, eg: $.post() Now I can easily set a generic Ajax indicator to show and hide when the jQuery is making an Async call using: $('#indicatorId').ajaxStart(fu...

jQuery.ajax() reports invalid json - Firebug parses it fine

I have jQuery.ajax() creating a request to a url (cms2/docman/dir/%id) (%id is a numeric unsigned integer). The page requested runs some functions and outputs an array. This array is then run through drupal_json. drupal_json() echo's out the content first setting the header to Content-Type: text/javascript; charset=utf-8 So far, every...

jQuery: a function containing an ajax() function won't return ajax() response

In an attempt to make my jQuery code modular, i.e. reusable, I've placed an ajax() function inside of another function fetch_ajax(). I'm trying to call fetch_ajax() with parameters from other places, which should simply run the contained ajax() and return the response. But that's not happening - instead, fetch_ajax() apparently returns ...

What is the recommended method to read JSON data posted with JQuery AJAX in ASP.NET?

I currently have a JQuery Ajax method as below; $.ajax({ type:"POST", url: "default.aspx/UpdateData", data: jsonString, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg){ alert('saved'); } }); In the ASP.NET UpdateData method I'm using; System.IO.StreamReader sr = new System.IO.StreamR...