jquery-ajax

jQuery AJAX request (Rails 3) gets redirected and returns empty message body (only with SSL)!

I'm trying to do a manual jQuery AJAX request the following way: $("#user_plan_id").change(function() { $("#plan_container").load('/plans/' + this.value); }); I have the "rails.js" file included in my header, and a "<%= csrf_meta_tag %>". I see from my log that the request IS getting to the server (although without the authentici...

dynamic link_to_remote in rails with jquery

Hi I'm trying to pass a string with a link_to_remote call as the :id, and the string should be collected from an input field with and id of "movie_title". <div id="search_list">Nothing here yet</div> <br /> <% semantic_form_for @movie do |f| %> <% f.inputs do -%> <%= f.input :title, :class => "movie_title" %> <%= link_to_r...

jQuery ajax only works first time

I have a table of data that on a button click certain values are saved to the database, while other values are retrieved. I need the process to be continuous, but I can only get it to work the first time. At first I was using .ajax() and .replaceWith() to rewrite the entire table, but because this overwrites the DOM it was losing events...

jQuery session in ASP.NET

Hi everybody, I write a countdown timer in jQuery and i need to keep some datas in a session when countdown ends. Datas have to be sent to server to update. How can i handle this situation. I am new in jQuery and asp.net so could you explain this briefly ...

jQuery.ajax(): discard slow requests

I've build a livesearch with the jQuery.ajax() method. On every keyup events it receives new result data from the server. The problem is, when I'm typing very fast, e.g. "foobar" and the GET request of "fooba" requires more time than the "foobar" request, the results of "fooba" are shown. To handle this with the timeout parameter is im...

Ajax - Back button?

I have the following jQuery code: $("a").click(function() { if ($(this).attr('href') != '#') { if (strpos($(this).attr('href'), 'mob.php') !== false) { $.ajax({ url: $(this).attr('href')+"&logo=0", cache: false, success: function(html){ $("#ajax").html(htm...

jQuery: Traversing AJAX response in Chrome/Safari

I'm trying to traverse an AJAX response, which contains a remote web page (an HTML output). My goal is to iterate through the 'script', 'link', and 'title' elements of the remote page - load them if necessary, and embed its contents to the current page. Its working great in FF/IE, but for some reason - Chrome & Safari behaves differen...

JQuery Load() syntax - Changing data source on mouseenter

Hey everyone. I've written this simple function that is supposed to load a portion of an XML file on mouseenter. It works fine when I specify the data source explicitly, shown below. I have a number of '.invest-port-thumb' divs, each with a unique link. The following code works finebut it loads the whole XML fileand I only want a po...

What do you do if a webservice in unavailable when updating a dropdown?

I am populating a dropdown from a jquery ajax call to a web service that is returning json data. If for some reason the webservice fails or is unavailable how do I handle this? I don't want to have my users looking at an empty dropdown. How can I cache the last successful call and use that instead? ...

Catch/Intercept all mouse clicks

I have this simple script that catches all mouse clicks, unless you click on something that actually works. Links, flash videos, etc. How can I adjust this so no matter what a user clicks on, before the video loads, new page loads, etc. It sends the simple GET request I built? (function($) { $.fn.saveClicks = function() { $(this).bin...

Continuous Flash music player while navigating site

I have a site that includes a Flash music player integrated into the layout. I want users to be able to navigate around the site without interrupting the music. I've done plenty of research and thinking and the following are the options I came up with (keeping in mind I want to be as SEO friendly as possible). Anyone have another idea...

jquery ajax success problem

Why is it that the following script works clientside by removing the relievant html entity: $(".ui-delete").click(function() { $.ajax({ url: 'delete.aspx', type: 'POST', data: { strWidgetID:$(this).parents(".widget").attr("id") }, error: function() { alert('Error'); }, success: function() { a...

Can I refresh a Yii CGridView from js?

When a "Create" modal dialog is submitted via XHR Then the rows in a Yii CGridView should be refreshed. I've tried to achieve this by rendering the new gridview in the XHR "create" action and then inserting it into the page via $("#list").html(response), but rendering a CGridView causes jQuery <script> include tags to be registered for ...

jQuery.ajax checking if there is already another xhr

I have a page when, if the user is near the bottom of the page, loads the next page. I just recently switched it to jQuery, and now use the jQuery.ajax() function to get the data. However, now i cannot check if the xhr is already loading, making the page load multiple xhrs when the user near the bottom. My listener is: $(document).scr...

jquery problem with loaded page and querystring

hi everybody, Is it possible to parse querystring data from a page loaded inside a div? I'd like to load a form page on a div and depending to querystring sent show or not some contents, any idea? Example: $("#scheda_sch").load("./schemi/sch_"+schemi[indice]+".html?azione="+azione); I need to read querystring azione=... inside the l...

Jquery ajax load div content from Web Server to Local Server

Hello,this code work fine on localhost,when loading div from one blog to another(both on localhost),but when try to load from blog that is on internet to another blog(localhost),it doesn't work,what could be the problem?Here is the code. <?php $urlPage = 'http://www.somepage.com/'; //dont work //$urlPage = 'http://localhost/myBlog1/';...

render partial using ujs and without AJAX call on rails 3

I need to do multiple file uploads using nested form and jQuery. so I wrote an helper using link_to_function method: def add_document_link(title, form) link_to_function title do |page| form.fields_for :documents, Document.new, :child_index => Time.now.to_i do |f| page << "$('#documents').append('#{escape_javascript(r...

Submit Search query & get Search result without refresh

Hi, I want to submit search query form & get search result without redirecting/reloading/refreshing on the same page. My content is dynamic so can not use those "submit contact form without refreshing page which replies back on success" I am newbie, help would be appreciated. Thanks. ...

jQuery issues when using ajax and .attr('class', 'new_class')

I am using Zend Framework, and to illustrate what is working I added the saveAction() to this post and it works flawlessly. It will animate and change the class as I want. The function upload instead only change the text and ignore the javascript. I can do alerts that works, however jquery is not possible. I get error saying that $ is un...

Couple PHP with AJAX States

Hey everyone, I have a puzzling problem with trying to make an ajax/static state program. What I am trying to do is allow a static linked app have ajax dynamic urls and everything is kinda fine until a page refresh. The problem: PHP Does not see the hash so it only sees the original URI request. So PHP loads the original page but then...