jquery-ajax

How do I pass optional parameters into a WebMethod via JSON?

I have the following JSON class I am intending to use to perform management calls on my database asynchronously: <script type="text/javascript"> var CalendarManager = { defaultOptions: { staffcode: 0, // required date: 0, // required activityCode: 0, // required ...

$.ajax with DELETE loses parameters

In my client appwritten in javascript and jQueryI have a function where I'm doing $.ajax request with the DELETE method to my server. The code is something like this: this.delete_one = function(id){ console.log(id); $.ajax({ url: sitesCtrl.url, type: "delete", dataType: 'json', data: {"id": i...

Internet explorer only executing function inside jQuery ajax success response once even though there are three requests

Hi, I have a function that uses jQuery.load() to call in 3 snippets of forms from different pages and then on the success text status it tries to load a colour picker: $(document).ready(function() { function ajax_form(putloadingboxhere, putsnippethere, snippeturl) { $(putsnippethere).load(snippeturl, function (responseTex...

Why can't I use jQuery to fire an AJAX request from an unload event handler?

I have the following code, intended to log the event when a user closes a chat window: $(window).unload( function() { test(); }); function test() { alert("Hi"); $.ajax({ type: "POST", url: baseUrl + 'Index/test', data: "user_id=" + "Nisanth" + "& chat_id=" + 2, success: function(msg){ alert(msg...

jQuery single quote in JSON response

I'm making requests to my server using jQuery.post() and my server is returning JSON objects (like { "var": "value", ... }. However, if any of the values contains a single quote (properly escaped like \'), jQuery fails to parse an otherwise valid JSON string. Here's an example of what I mean (done in Chrome's Console): Is this normal?...

How to create a Jquery slideLeft delete for list item?

Hi I am trying to create a page loading my image, content, and the delete option. The image url and content are output from database. What I want to need is that on clicking of the delete the image, it would render animation to slide left showing the the image has been removed. My code so far ... Jquery Script: $(function() { $("#sorta...

Cannot access data from jquery ajax request, returns empty array

Hi, I have a form that is called via the fancybox plugin http://fancybox.net/blog - login example Here is the code I have: Form: <form method="post" action="" id="events_form"> <p class="clearfix"><label for="Name">Name:</label> <input type="text" name="Name" id="Name" /></p> <p class="clearfix"><label for="Company">Company:</l...

How do I shorten this load jQuery?

I'm pretty good with jQuery but when I get to stuff like this I need a little help. So I want to shorten this code: $(function() { $('#experience_nav').click(function() { $('#contentWrap').load('files.html #content_experience', function() { $(this).hide().fadeIn(); $('#content_experience').siblings().fadeOut(); ...

Twitter like Form Submission using Ajax or Jquery

I need a simple example of form submission very similar to Twitter. How you type in a comment and click update and without the whole page refreshing, the comment gets added below on top of the rest of the comments. I would prefer something in Jquery as my PHP project is already integrated with it. ...

$.ajax post to MVC controller returns Internal Server Error: Parameters dictionary contains null entry

The parameters dictionary contains a null entry for parameter 'appId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ContentResult CheckForInstaller(Int32)' in 'HLIT_TicketingMVC.Controllers.TicketController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. functi...

Making an Ajax form from an Ajax request in jQuery

The client is making a request to the server. I need to take part of that request, and make the form button work with Ajax. This piece of code works perfectly for links: var pagination_render = function() { var pagination = $('.pagination a'); pagination.each(function() { $(this).click(function(event) { load...

jquery ajax php recordset caching

Hi, I currently have a jQuery/ajax request which produces a recordset which appears in #contentDiv on my page. The user can then browse the results and view further details of an item. Once on the page for the item it the user hits back on their browser they return to the default page for my search without their generated search resul...

jquery remove last created element

I need some help with removing some elements from my page with jQuery, currently I have PHP loop that builds links, <?php $findMore = array(); $i = 0; foreach ($backgrounds as $row) : ?> <a id="<?=$i;?>" class="findOutMore" href="<?=$row['backgroundAddress']; ?>">Find Out More</a> <?php $i++; endforeach; ?> ...

Ajax actionlink on page load

Basically Im building an ASP.NET MVC Application. I have a search page. Its searches for results from a number of different sources. To aid in the speed of page load I decided to load the results from one source first then to dynamically load more results as it finishes searching other sources. So far I have the first set of results re...

Display an ajaxloader inside the <div> that's being updated?

I use jquery 1.3.2 and jquery-ui tabs version 1.7.2. All of my tabs are loaded via Ajax. Within each tab, I want to display an Ajax loader whenever any Ajax call is active. The Ajax loader is inside the <div> that's being updated by the Ajax call. I've tried the following: $(function() { $("#ajaxLoader").ajaxStart(function...

jQuery .ajax not triggering the error callback on localhost requests

I've created a windows service that runs locally and provides a web service which can be communicated with via ajax calls. I'm trying to write some code to detect if the web service is running on localhost so I can prompt users to install the application if it isn't running. When the service isn't running, the .ajax call isn't triggering...

JQuery Ajax call

I have a url like: http://localhost:8080/myapp/discussions/voteup?id=1 which returns the following json: {"vote":{"value":"100"}} I am trying to make a JQuery Ajax Call to post a vote to the url. $(function(){ $(".vote-up-post").click(function() { var postId = $("#postId"); alert("Post Value" + postId.val()); ...

Mysql not retaining line breaks from Jquery ajax post?

Hey SO, I've got a PHP/Mysql app that lets users post text from a form. When I insert text from an HTML textarea into my mysql table, it's not keeping the carriage returns/line breaks. The text is not stored in the DB as "Hey SO, \n This is a new line". It's stored with white space in the column (exactly like it's typed), but there is ...

How can i return a form using ajax into a view ASP.Net MVC

Hi All, i just started building a small test app to help me learn MVC. i have a view that displays user comments. Under each comment i would like to have a reply action link. Clicking on the link should return a small form for adding a comment directly above the reply link. What is the general approach for this? I'm imaging the form wou...

jquery S.get sending data with trim()

How to send triimed data using $.get() see code snippet below: $("#txtSearch").keyup(function() { $.get("/controller/method/", { 'param1': $.trim($("#txtSearch").val()) !== "" ? $.trim($("#txtSearch").val()) : return false; }, function(data) { $("#div").html(data); }); }); This results in syntax error whether or...