ajax

query string always returns same value - JavaScript

Hey all, I don't expect anyone took read this whole script, but you will notice that there is a sort object with an insert() function that returns an object that use a ternary operator to return either "-order_value" or "order_value", where order_value is a local variable holding a value. Problem is in the query string it always passes ...

Browser specific AJAX call error

I have a web page that makes an AJAX call to the server to update some database tables. In Internet Explorer, everything goes in without a problem. But when you use the page in Firefox and make the AJAX call, the call goes through and updates the database tables, but instead of going into the success portion of the call, it goes to the e...

Scoping Issues inside jQuery.ajax()

I'm caching label strings by saving them into a variable, but running into weird scoping issues. I know this has to do with closures, but I can't seem to figure out what the issue is exactly. info_lbl = {}; $("#chkCorporateGift").click(function(){ var type = $(this).is(":checked") ? "Corporate" : "Personal"; if(!info_lbl.hasO...

Ajax pagination like Twitter

Is there any plugin/gem or an easy way for accomplish a pagination functionality like Twitter? This means, showing a "More" button that shows more posts (for example) below once it's clicked, using Ajax. If there's any easy way for modifying something from will_paginate plugin, that would be useful too. ...

Ajax Div positioning

I have an aspx page with ajax panel on it and a button. this is my button : <asp:Button ID="Button1" runat="server" OnClientClick="javascript:SetValues()" onclick="Button1_Click" Text="Button" /> when I click on the button I call the SetValues() function on the OnClientClick event. this function will change the position of the div o...

jquery function is not a function

Hi! I'm trying submit some form using ajax //include jquery-1.4.2.min.js var submitForm = document.createElement("FORM"); ... jQuery.post(submitForm.getAttribute('action'), submitForm.serialize(), function(data) { bla-bla }); But there is error : "Error: submitForm.serialize is not a function" (FF) What can I do? Thanks. ...

Multiple ajax calls are being executed when clicking on a page from will_paginate plugin

I'm trying Ajax Will Paginate plugin. For further info click here. My view's code is: <h4>Top Ten</h4> <div id="top_ten_results"> <p> <table border="0"> <% unless @top_ten_posts.nil? %> <% @top_ten_posts.each do |p| %> <tr> <td><%= link_to p.title, p %></td> </tr> <tr> ...

Retrieve Images From Server via Client Side

Hello StackOVerflow, I have a folder on the server with some images in it. I would like to have my client code read this folder's contents (images) and then display this image on a div. I thought this would be easy with AJAX, but it seems that AJAX returns some raw data embedded in the image. I have been looking all over for a way to...

ASP.NET AJAX UpdatePanel - cancelling postback in InitializeRequest will not set back to re-enabled.

Within an ASP.NET AJAX UpdatePanel on my page I have a submit button which has some custom javascript validation applied which set a global _cancelGeneralSettingsUpdate flag depending on the results of the validation. Everything works unless you enter an invalid value, correct it, and resubmit. In this case the variable _cancelGeneralS...

jquery - ajax application - multiple hashes?

So some web apps I've made have little "features" of ajax. Simple things usually, so I've only ever needed one hash (e.g. example.com/products#shirts). What if I wanted to have the "products" page loaded through ajax too? I know that it doesn't need to be in the hash, but for some functionality I prefer it (for user history and following...

problems with rails ajax call

I'm fairly new to rails so forgive me if I'm making some dumb mistake here. I'm trying to make an ajax call with link_to, and respond to a js.erb template. It isn't going so well. The link renders correctly: <a href="/show" data-method="post" data-remote="true" rel="nofollow">Click</a> The barebones show action: def show respond_t...

How to write a function to determine the population count of a 16-bit integer using php or javascript?

How to write a function to determine the population count of a 16-bit integer using php or javascript. Population count is defined as the number of bits that are "turned on," or in others, it is the number of 1s in a binary representation of a number. For example, the binary number 0b0000 has a population count of 0 because there aren't ...

How to create a progress bar

Hi, On a button click, I want to display a progress bar, When it completes 100% want to load something,For this stuff i want to use jQuery as well as css. I need some help, how to implement it. ...

jquery autocomplete needs to pull data

I am attempting to clone the functionality of google suggest. I have found google urls that return the the suggestions via json (google.com/complete/search?q=abc) I am already using jquery, so i would prefer to use code similar to this for the auto-complete http://docs.jquery.com/UI/Autocomplete the code that is lacking is the ajax t...

how to embed a linux bash terminal inside ruby on rails web page?

how to embed a bash prompt/terminal inside ruby on rails web page? how to execute a linux command from the web page, and get the output of the ommand? ...

writing JSON object to .json file on server

I'm trying to write my JSON object to a .json file on the server. The way I'm doing this now is: JavaScript: function createJsonFile() { var jsonObject = { "metros" : [], "routes" : [] }; // write cities to JSON Object for ( var index = 0; index < graph.getVerticies().length; index++) { jsonObj...

Load google maps v3 dynamically with ajax

When i try to load google maps v3 with ajax the result is: <script src="http://maps.gstatic.com/intl/en_us/mapfiles/api-3/2/8a/main.js" type="text/javascript"></script> in the source code, i suppose that writes with javascript document.write(); how i can do this without iframe? thanks. ...

Jquery/Ajax cookie pt2

Hi, Following on from a previous question, ( Previous question), I can't seem to be able to 'fire' the ajax call if a cookie is detected. The cookie is definitely set, and the alert is displayed, but I can't for the life of me get it to trigger the ajax call again. I just need it to 'fire' the ajax when the page is loaded if the cookie ...

How to trigger RenderAction from dropdown list selection?

I have an ajax form. In this form i have 2 drop down lists (Office and Departments) and a "Filter" Button. When filter button is clicked my ajax form is set to update "content_main" with my new filtered list. My question is... how can i get Office (when a selection is made) to trigger a RenderAction on the DIV element containing my li...

Get resource without file extension in Chrome

Hi, guys, I'm using VirtualPathProvider to respond to certain client requests. URLs like so: "http://host/SomeCategory/ObjectName" Everything works fine in IE and Opera but in Chrome and FireFox it doesn't. 1) Using the Address Bar, it is considered as a download and a file location is requested. 2) Through AJAX request, I the content...