Being new to Ajax, I would like to understand which data exchange format - JSON or XML - would be easier to work with while doing Ajax in Rails.
Do the various Rails helpers make one or the other format easier to deal with or does it depend on the context or does it not matter at all?
...
How could a page display different content based on the URL hash?
I'm not talking about the browser scrolling down to display the anchored section, but something like JavaScript reacting to that hash and loading different content via AJAX.
Is this common or even probable?
...
I am looking into QUnit for JavaScript unit testing. I am in a strange situation where I am checking against the value returned from the Ajax call.
For the following test I am purposely trying to fail it.
// test to check if the persons are returned!
test("getPersons", function() {
getPersons(
func...
Hi,
I was wondering if somebody could shed some light on this browser behaviour:
I have a form with a textarea that is submitted to to the server either via XHR (using jQuery, I've also tried with plain XMLHttpRequest just to rule jQuery out and the result is the same) or the "old fashioned" way via form submit. In both cases method="P...
I'm currently using Prototype, but I'd like to rewrite this function to jQuery:
function post(div,url,formId) {
new Ajax.Updater(div, url, {
asynchronous:true,
parameters:Form.serialize(formId)
});
}
HTML example that goes with it:
<form method="post" action="" id="foo"
onsubmit="post('result','getdata.php','foo');retu...
We recently had a web app that went out to site acceptance testing where they found severe performance problems related to request size (massive viewstate ASP.net).
We need to ammend our testing strategy to include performance testing, can anyone give us guidance on best practices please?
...
Hello everybody.
I have good knowledge in Php, Mysql, and with Stack Overflow users help i started understanding a bit more of Javascript. Which by the way thanks for all those who have helped so far.
I always want learn a bit more, and I always had a little admiration for Ajax, and once in Ajax i can use Php and MySql...
So i wanted ...
I'm working on some old AJAX code, written in the dark dark days before jQuery. Strangely, it has been working fine for years, until today when it suddenly stopped firing its callback. Here's the basic code:
var xml = new XMLHttpRequest(); // only needs to support Firefox
xml.open("GET", myRequestURL, true);
xml.onreadystatechange = fu...
<item>
<guid>http://jahboo.fliggo.com/video/kPZj01cs</guid>
<pubDate>Tue, 10 Mar 2009 18:31:38 -0500</pubDate>
<title>How to be perverted with water proof cam</title>
<author>Jennisita@fliggo</author>
<link>http://jahboo.fliggo.com/video/kPZj01cs</link>
<description>
This vid shows how easy it is to make perverted vids with ...
I have some action methods behind an Authorize like:
[AcceptVerbs(HttpVerbs.Post), Authorize]
public ActionResult Create(int siteId, Comment comment) {
The problem I have is that I'm sending a request through AJAX to Comment/Create with
X-Requested-With=XMLHttpRequest
which helps identify the request as AJAX. When the user is not l...
Hi all
I am using the following javascript code to refresh another page
window.opener.location.replace(url)
The problem is when entering the url, do not find the page as the page is located in the root and this calling code is placed in a page inside another folder. How do I specify the path to point to the root, which is where the pag...
Recently making the switch from Prototype to jQuery, I am struggling with some basic issues.
I use several AJAX-requests in my application; for 95% of these requests, I'd like to have some global events executed, such as showing or hiding a loading indicator. Apart from the global functionality, every request should also have some custo...
My company creates web surveys and once in a while I get asked if we can do an exit survey on a website. So when a visitor is about to leave the site a "popup" appears asking if they'd take a quick survey. By "popup" I'm referring to a floating CSS div, not a child window (although sometimes clients don't realise this).
Is it technicall...
We had some "strange" issues when using UpdatePanels and RadioButtonLists in that a PostBack was not occuring when you changed the values.
I've managed to track down the issue in that it occurs when the value of the RadioButtonList is set in the PreLoad of a page and you are re-selecting this initial value.
I have the full code of the ...
I have some very simple sample code like this:
$.ajax({
url: 'demo2.htm',
success: function(loadeddata){
$("#loaded_data").after(loadeddata);
alert('success');
},
error: function(){
alert('failure');
}
});
Loaded data currently returns everything. What I need to is to get only a specific div and after it add it t...
Currently, in all of our environments we have healthmonitoring turned on to alert us when ever a user has caused an error:
<healthMonitoring enabled="true">
<providers>
<add name="MailWebEventProvider" type="System.Web.Management.SimpleMailWebEventProvider" to="[email protected]" from="[email protected]" buffer="false" subjectPrefix="pr...
Hi,
I'm looking for a way to encrypt a HTML form in PHP in a way so I can then decrypt it in the browser using JavaScript. This should work transparently to the user and JavaScript input validation must also work on the form (I know how to do this). When user submits the form, it must be encrypted again and sent to the server using an "...
I am trying to access an instance variable from a js.erb file.
#controller
def get_person
@person = Person.find(1)
respond_to do |format|
format.js{}
end
end
#get_person.js.erb
alert('<%= @person.last_name %>')
When I browse to [controller_name_here]/get_person.js ... I get a nil object error on @person. (I know Person.find...
Hi,
I'm starting to write quite a few ajax heavy website, but I've never really read up on best practices and now that I want too I can't find an article that address what I want to know. What I really want to learn about is dealing with AJAX calls server side, things such as, should all data be passed back using JSON/XML,.. or is pure...
Hi Guys,
I am using following code for ajax rating system
jQuery.fn.rater = function(url, options)
{
if(url == null) return;
var settings = {
url : url, // post changes to
maxvalue : 5, // max number of stars
curvalue : 0 // number of selected stars
};
if(options) { jQuery.extend(settings, ...