Category Archives: Ajax

SCRIPT5: Access is denied in IE9 for iframe on the same domain

Questions: i am trying to submit form with file attached using iframe(through AJAX). I am using rails & remotipart gem. actually i’ve tried jquery.form.js library as well, but no luck. when i submit form i am getting “SCRIPT5: access denied” only in IE9 and when i am redirected to the page from my gmail account.… Read More »

JQuery Ajax, No callback function is run in ASP.NET MVC 5

Questions: I’m trying to render a partial view in a container div using JQuery Ajax. Here’s my ajax-call: var href = { href: $(this).attr(“href”).substr(1) } var container = $(“.customer-main-content-container”); $.ajax({ url: “@Url.Action(” CustomerMenuSelection “)”, type: “POST”, dataType: “html”, contentType: “application/json”, data: JSON.stringify(href), error: function (jqXHR, textStatus, errorThrown) { alert(“ERROR: ” + errorThrown.text()); }, success: function… Read More »

Call to ajax function within replace()

Questions: I have a function containing an ajax call: function example(param, callback) { $.ajax({ type: “GET”, url: param, contentType: “application/json; charset=utf-8”, dataType: “jsonp”, success: function(data) { // do something with data callback(data); } }); } I call it by: example(“”, function(result) { // do something with result }) But, I’d like to use example() in… Read More »

Long polling with database data?

Questions: After a week of googling and search.I am hard to find even a single tutorial about long polling from a database table instead of from a flat text file named data.text. Currently, I write manually anything in data.text and it instantly appears in the browser. This is the question: Long polling using database? is… Read More »

how to change called class in javascript when button is click?

Questions: I have a div which is <div class=”add1″></div> I want the add1 become add+thenumber of length example: var n= $(‘.add1’).length + 1; $(‘.add1’).click(function(){ so what I did is $(‘.add+n’).click(function(){ but it doesnt work, please help me 🙁 Answers: You can store the number in a data attribute and increment on every click. Change the… Read More »

statechange load is causing multiple loads of the same page

Questions: It appears that this line in the statechange event: $(‘#content’).load(; …is causing the same page to load multiple times which is resulting in glitches on my site. What can I do to fix this? (function($) { function loadHome() { $(‘#content’).load(site.url + ‘/ #primary’, function() { $(this).fadeIn(50); }); } // User event $(‘.site-title a’).on(‘click’, function(e)… Read More »

Cross-Domain Cookie not sent to application after redirect

Questions: We are planning to support the integration of remote login forms to our application. For this I provide a CORS enabled API call that sets an authentication cookie for our application. The ajax call succeeds and the response contains the cookies, but once I redirect the browser to our application, the cookie is not… Read More »

How can I persist the data from a repeater after postback?

Questions: I have a repeater that displays financial data and prices for various stocks. On this page, I also have an “export” button that needs to take the data ~on the screen~ and convert it into a CSV for the user. The problem is, after I databind my list of “Stock” entities: List<Stock> stocks =… Read More »