ajax

jQuery + Rails + ajaxForm + js.erb problem

I'm having an issue that is driving me nuts, and according to everything i have seen and read online, it should be working fine. I'm using jQuery with my Rails app instead of prototype and am using the ajaxForm plugin to submit some form data via ajax. The form data gets submitted fine, the corresponding controller action gets called f...

Jquery - Does the ajax/load() method automatically show the content it's loaded?

I'm really stuck here... I've built a small gallery to display images. It consists of an initial front page with 12 thumbnails arranged in a grid. When click on a thumbnail they collapse to the left of the screen and show the appropriate gallery item. When you rollback over the collapse thumbnails they expand and hide the gallery item u...

JQuery Call Function Outside of Ajax on Ajax Success?

Hey all, I currently have created a pagination js class that will automatically paginate comments when you get more than 10 to a page. This works fine, but I'd like to set some css properties only if there are more than 10 comments on the page (add space for the buttons to switch between pages). This COULD be done in the ajax success, bu...

jQuery RoundedCorners with AJAX

I am using the jQuery RoundedCorners and it works great. Since I am doing AJAX calls I wanted to continue rounding my corners on the divs that I am appending with my AJAX callbacks. To get rounded corners I use this syntax $(document).ready(function(){ $(".item").corner(); }); Since the document is already ready while I am making...

How can I load a tab on demand using the Ajax Control Toolkit?

The Ajax Control Toolkit's tab control loads all tabs on page load and displays the currently selected one to the user. Is there a way to make it load the tabs only when the user activates the tab by clicking on the tab button for it? I'm wanting to improve load time because there is quite a bit of stuff on each tab, and each of them req...

Salesforce web2lead ajax sbmission problems using jQuery

Has anyone been successful sending a web2lead form via ajax submission (jquery ajax object)? I'm having a heck of a time getting this to work. I have a form on a page that submits to salesforce without ajax, just fine. When I add in jquery's plugin for validation and then use jquery's $.ajax function to submit the page, NOTHING. (i kn...

Jquery delay link redirection for ajax

When a link is clicked, I want to clear the php session before redirecting to the destination page. The way I thought of doing it is by loading a php script that clears the session with ajax in the origin page and once that script has loaded, to redirect to the destination page. Here is the code I have: $(document).ready(function() { ...

How to dynamically fill an input text field in CakePHP using Ajax?

I have an "Add Person" form with a few fields (name, address, phone number, etc). I want to be able to pre-fill some of the fields using information from other fields BEFORE submitting the form. For example, once the user puts in a city, an Ajax query will pull the area-code for the phone number (the Controller has a "city to area code...

Suppress anchor tag <a> href when using jquery

I have the following code: <script type="text/javascript"> $(document).ready(function() { $("#thang").load("http://www.yahoo.com"); $(".SmoothLink").click( function() { $("#thang").fadeOut(); $("#thang").load($(this).attr("href")); $("#thang").fadeIn(); }); }); </script> <...

get form post data in mootools 1.1 response

Hi friends, I m using mootools 1.1 for developing joomla component. i want to get the form posted data in onComplete block. i don't want to set the post data in response. Is it possible? if yes then please reply how can i do that? Thanks in advance. ...

jQuery: query a $.get() returned string

Hi, How can i query a string i get via $.get? for example, i want form google only the body html: $.get("www.google.com", function(data){ var body = $("body", data).html(); //This doesnt work }); Is it even possible? thanks ...

how to auto refresh MVC PartialView every second

Hi , i need to auto refresh a partialView in the page every second (or a set interval of time) i thought of the following method is this rite loop { setInterval(function() { <%Html.RenderPartial("partialview", Model);%> } ,1000 ); } or is there a better way using ajax stuff ? ...

Showing a spinner during an AJAX request?

Hi, what is the best way to show a spinner? I have prepared a div(id="spinner"), that should be visible during loading. Best regards ...

parse xml in an iframe

Hi, I want to be able access an rss feed from js. I have the ability to configure both servers to use the same domain (but different subdomains - eg static.benanderson.us and tech.benanderson.us). I was hoping I could use the document.domain property to get around the xss issue. Here's a snippet http://static.benanderson.us/example.j...

How to create a link that triggers printing of a file?

I have some small images and each has a "print larger image" link. For example: <img src="thumb.jpg"> <a href="#">Print Larger Image</a> When the user clicks the "print larger image" link, my goal is to trigger the printing of "big.jpg". How can this be done? EDIT: ANTHONY HAD THE RIGHT SOLUTION FOR ME. I MODIFIED HIS CODE A BIT TO...

Is there an event for collapsing a rich:tree node?

I've finally managed to receive events if the user expands a node of my client side handled tree using the following method: public void processExpansion(NodeExpandedEvent event) throws AbortProcessingException { if (event != null && event.getSource() != null && event.getSource() instanceof HtmlTree) { this.expandedNodes.add(((UITree...

How does AJAX work?

What is the essence of AJAX? For example, I want to have a link on my page such that when a user clicks this link, some information is sent to my server without the reloading of the current page. Is that AJAX? I was able to get this behavior by using isoframes. In more details I put a link (let's say a small image) in a small isoframe. ...

Submitting a form more than once

I am try to have a forum submits more then once when a user clicks the submit button. Why? I am try to add more then one idem to a shopping cart, The shopping cart software I am using doesn't support adding more then one product at a time and I don't want to edit there core code. The hidden forum would have the product ids like '1,2,3' I...

ajax js serialize not reading form elements

Have a form that is not being read by serialize() function. <script type="text/javascript"> function submitTrans1(){ var formData = $('form1').serialize(); var options = { method:'post', postBody:'formData', onCreate: function(){alert(formData)}, onSuccess: function(transport){alert("onSuccess alert \n" + transpo...

Can Django/Javascript handle conditional "Ajax" responses to HTTP POST requests?

How do I design a Django/Javascript application to provide for conditional Ajax responses to conventional HTTP requests? On the server, I have a custom-built Form object. When the browser POSTS the form's data, the server checks the submitted data against existing data and rules (eg, if the form adds some entity to a database, does tha...