HighDots Forums  

[ ajax jQuery]

jQuery jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.


Discuss [ ajax jQuery] in the jQuery forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lord Gustavo Miguel Angel
 
Posts: n/a

Default [ ajax jQuery] - 11-04-2009 , 08:55 PM






Hi,
Why this code not is ok?

-----8<-------------------
$(document).ready(function(){
$(".button").click(function(){
$.ajax({
url: "ejemplo.html",
success: function(datos){
alert(datos);
}
});
});

});
----->8------------------


When y click en Button it not show "datos".

thank´s

Reply With Quote
  #2  
Old   
brian
 
Posts: n/a

Default Re: [jQuery] [ ajax jQuery] - 11-04-2009 , 09:00 PM






Normally, one would direct an AJAX request to some server-side script
(eg. PHP, Python, Perl, etc.) not a plain HTML page.

On Wed, Nov 4, 2009 at 8:55 PM, Lord Gustavo Miguel Angel
<goosfancito (AT) gmail (DOT) com> wrote:
Quote:
Hi,
Why this code not is ok?

-----8<-------------------
$(document).ready(function(){
Â*Â*Â*Â*$(".button").click(function(){
Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*$.ajax({
Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* url: "ejemplo.html",
Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* success: function(datos){
Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* alert(datos);
Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* }
Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*});
Â*Â*Â*Â*Â*Â*Â*Â*Â*});

Â*Â*Â*Â*});
----->8------------------


When y click en Button it not show "datos".

thank´s

Reply With Quote
  #3  
Old   
Lord Gustavo Miguel Angel
 
Posts: n/a

Default Re: [jQuery] [ ajax jQuery] - 11-04-2009 , 09:22 PM



if i change "ejemplo.html" for "example.php" error.

if i change for this:
$(document).ready(function(){
$.ajax({
type: "POST",
url: "uno.php",
data: "nombre=juan&apellido=luna",
success: function(datos){
alert(datos);
}
});
});

script run!.

before not.

--------------------------------------------------
From: "brian" <zijn.digital (AT) gmail (DOT) com>
Sent: Wednesday, November 04, 2009 11:00 PM
To: <jquery-en (AT) googlegroups (DOT) com>
Subject: Re: [jQuery] [ ajax jQuery]

Quote:
Normally, one would direct an AJAX request to some server-side script
(eg. PHP, Python, Perl, etc.) not a plain HTML page.

On Wed, Nov 4, 2009 at 8:55 PM, Lord Gustavo Miguel Angel
goosfancito (AT) gmail (DOT) com> wrote:
Hi,
Why this code not is ok?

-----8<-------------------
$(document).ready(function(){
$(".button").click(function(){
$.ajax({
url: "ejemplo.html",
success: function(datos){
alert(datos);
}
});
});

});
----->8------------------


When y click en Button it not show "datos".

thank´s

Reply With Quote
  #4  
Old   
Michel Belleville
 
Posts: n/a

Default Re: [jQuery] [ ajax jQuery] - 11-05-2009 , 01:39 AM



Quote:
Normally, one would direct an AJAX request to some server-side script
(eg. PHP, Python, Perl, etc.) not a plain HTML page.
Is not exactly the issue, you can direct an AJAX request to any text
resource available on a server (php script returning json, Ruby on Rails
controller returning xml, plain html file, etc.).

The issue was apparently your target didn't respond.

Also keep in mind you can't test AJAX requests locally (= without a server
to respond to an URL). Files accessed through your local file system can't
be read using AJAX.

Michel Belleville


2009/11/5 Lord Gustavo Miguel Angel <goosfancito (AT) gmail (DOT) com>

Quote:
if i change "ejemplo.html" for "example.php" error.

if i change for this:
$(document).ready(function(){
$.ajax({
type: "POST",
url: "uno.php",
data: "nombre=juan&apellido=luna",

success: function(datos){
alert(datos);
}
});
});

script run!.

before not.

--------------------------------------------------
From: "brian" <zijn.digital (AT) gmail (DOT) com
Sent: Wednesday, November 04, 2009 11:00 PM
To: <jquery-en (AT) googlegroups (DOT) com
Subject: Re: [jQuery] [ ajax jQuery]


Normally, one would direct an AJAX request to some server-side script
(eg. PHP, Python, Perl, etc.) not a plain HTML page.

On Wed, Nov 4, 2009 at 8:55 PM, Lord Gustavo Miguel Angel
goosfancito (AT) gmail (DOT) com> wrote:

Hi,
Why this code not is ok?

-----8<-------------------
$(document).ready(function(){
$(".button").click(function(){
$.ajax({
url: "ejemplo.html",
success: function(datos){
alert(datos);
}
});
});

});
----->8------------------


When y click en Button it not show "datos".

thank´s



Reply With Quote
  #5  
Old   
Arunkumar Puppala
 
Posts: n/a

Default Re: [jQuery] [ ajax jQuery] - 11-05-2009 , 01:52 AM



The issue is because of no return value from your server script

On Wed, Nov 4, 2009 at 6:22 PM, Lord Gustavo Miguel Angel <
goosfancito (AT) gmail (DOT) com> wrote:

Quote:
if i change "ejemplo.html" for "example.php" error.

if i change for this:
$(document).ready(function(){
$.ajax({
type: "POST",
url: "uno.php",
data: "nombre=juan&apellido=luna",

success: function(datos){
alert(datos);
}
});
});

script run!.

before not.

--------------------------------------------------
From: "brian" <zijn.digital (AT) gmail (DOT) com
Sent: Wednesday, November 04, 2009 11:00 PM
To: <jquery-en (AT) googlegroups (DOT) com
Subject: Re: [jQuery] [ ajax jQuery]


Normally, one would direct an AJAX request to some server-side script
(eg. PHP, Python, Perl, etc.) not a plain HTML page.

On Wed, Nov 4, 2009 at 8:55 PM, Lord Gustavo Miguel Angel
goosfancito (AT) gmail (DOT) com> wrote:

Hi,
Why this code not is ok?

-----8<-------------------
$(document).ready(function(){
$(".button").click(function(){
$.ajax({
url: "ejemplo.html",
success: function(datos){
alert(datos);
}
});
});

});
----->8------------------


When y click en Button it not show "datos".

thank´s



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.