[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread indre1

Well, the problem still seems to be in the get() function. For
example, IE gives the following error: Object doesn't support this
property or method
With:
(function($) {
  $.fn.followUser = function(userId) {
  this.fadeOut(250, function(){
  $.get('profile.php', { do: addfriend, id: userId }, function
(data){
  return this.html('pFollower added/p').fadeIn(250);
  });
  });
  }
})(jQuery);

If I remove the whole $.get() part, the error is gone. Chrome will
start fading out too. The code will then look like:
(function($) {
  $.fn.followUser = function(userId) {
  this.fadeOut(250, function(){

  });
  }
})(jQuery);


I even tried replace the get() with ajax(), but ran into the same
problem.


Btw, thanks for the attr('rel') suggestion. This is something I was
also looking for, but couldn't figure it out :) The html is now:
script type=text/Javascript
$(function(){
$('div#followButton a').click(function(){
$('div#followButton a').followUser($(this).attr('rel'));
});
});
/script

...

div id=followButton
a rel=2test1/a
/div

On Sep 26, 6:48 pm, Matt Quackenbush quackfu...@gmail.com wrote:
 @ Mike - Thanks for making me take a closer look at the original code.  I
 get it now.  My bad.

 /me crawls back into his cave to hibernate some more


[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread indre1

After 3 DAYS, I finally figured it out:
$.get('profile.php', { do: 'addfriend', id: userId }

The problem is, that the word do is reserved or something, thus you
can't use it in get, ajax and probably elsewhere. test.php?
do=something will never work from jQuery then, or how should I escape
it?
Is this a bug or just something everyone has to know? Strangely, on FF
it all worked.

$.get('profile.php', { action: 'addfriend', id: userId } works
perfectly.

On Sep 27, 1:27 pm, indre1 ind...@gmail.com wrote:
 Well, the problem still seems to be in the get() function. For
 example, IE gives the following error: Object doesn't support this
 property or method
 With:
 (function($) {
   $.fn.followUser = function(userId) {
           this.fadeOut(250, function(){
                   $.get('profile.php', { do: addfriend, id: userId }, 
 function
 (data){
                           return this.html('pFollower 
 added/p').fadeIn(250);
                   });
           });
   }

 })(jQuery);

 If I remove the whole $.get() part, the error is gone. Chrome will
 start fading out too. The code will then look like:
 (function($) {
   $.fn.followUser = function(userId) {
           this.fadeOut(250, function(){

           });
   }

 })(jQuery);

 I even tried replace the get() with ajax(), but ran into the same
 problem.

 Btw, thanks for the attr('rel') suggestion. This is something I was
 also looking for, but couldn't figure it out :) The html is now:
 script type=text/Javascript
 $(function(){
         $('div#followButton a').click(function(){
                 $('div#followButton a').followUser($(this).attr('rel'));
         });});

 /script

 ...

 div id=followButton
 a rel=2test1/a
 /div

 On Sep 26, 6:48 pm, Matt Quackenbush quackfu...@gmail.com wrote:

  @ Mike - Thanks for making me take a closer look at the original code.  I
  get it now.  My bad.

  /me crawls back into his cave to hibernate some more


[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread indre1

Tested, it can be bypassed with ajax():

 $.ajax({
   type: GET,
   url: profile.php,
   data: do=addfriendid=2
 });

But is the get and do thing a bug?

On Sep 27, 3:37 pm, indre1 ind...@gmail.com wrote:
 After 3 DAYS, I finally figured it out:
 $.get('profile.php', { do: 'addfriend', id: userId }

 The problem is, that the word do is reserved or something, thus you
 can't use it in get, ajax and probably elsewhere. test.php?
 do=something will never work from jQuery then, or how should I escape
 it?
 Is this a bug or just something everyone has to know? Strangely, on FF
 it all worked.

 $.get('profile.php', { action: 'addfriend', id: userId } works
 perfectly.

 On Sep 27, 1:27 pm, indre1 ind...@gmail.com wrote:

  Well, the problem still seems to be in the get() function. For
  example, IE gives the following error: Object doesn't support this
  property or method
  With:
  (function($) {
    $.fn.followUser = function(userId) {
            this.fadeOut(250, function(){
                    $.get('profile.php', { do: addfriend, id: userId }, 
  function
  (data){
                            return this.html('pFollower 
  added/p').fadeIn(250);
                    });
            });
    }

  })(jQuery);

  If I remove the whole $.get() part, the error is gone. Chrome will
  start fading out too. The code will then look like:
  (function($) {
    $.fn.followUser = function(userId) {
            this.fadeOut(250, function(){

            });
    }

  })(jQuery);

  I even tried replace the get() with ajax(), but ran into the same
  problem.

  Btw, thanks for the attr('rel') suggestion. This is something I was
  also looking for, but couldn't figure it out :) The html is now:
  script type=text/Javascript
  $(function(){
          $('div#followButton a').click(function(){
                  $('div#followButton a').followUser($(this).attr('rel'));
          });});

  /script

  ...

  div id=followButton
  a rel=2test1/a
  /div

  On Sep 26, 6:48 pm, Matt Quackenbush quackfu...@gmail.com wrote:

   @ Mike - Thanks for making me take a closer look at the original code.  I
   get it now.  My bad.

   /me crawls back into his cave to hibernate some more


[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread Mike McNally

You can always quote the word do on the left side of the colon:

  { do: something, x: y }

It's not a bug, it's part of the Javascript language.

On Sun, Sep 27, 2009 at 7:49 AM, indre1 ind...@gmail.com wrote:

 Tested, it can be bypassed with ajax():

  $.ajax({
                   type: GET,
                   url: profile.php,
                   data: do=addfriendid=2
                 });

 But is the get and do thing a bug?

 On Sep 27, 3:37 pm, indre1 ind...@gmail.com wrote:
 After 3 DAYS, I finally figured it out:
 $.get('profile.php', { do: 'addfriend', id: userId }

 The problem is, that the word do is reserved or something, thus you
 can't use it in get, ajax and probably elsewhere. test.php?
 do=something will never work from jQuery then, or how should I escape
 it?
 Is this a bug or just something everyone has to know? Strangely, on FF
 it all worked.

 $.get('profile.php', { action: 'addfriend', id: userId } works
 perfectly.

 On Sep 27, 1:27 pm, indre1 ind...@gmail.com wrote:

  Well, the problem still seems to be in the get() function. For
  example, IE gives the following error: Object doesn't support this
  property or method
  With:
  (function($) {
    $.fn.followUser = function(userId) {
            this.fadeOut(250, function(){
                    $.get('profile.php', { do: addfriend, id: userId }, 
  function
  (data){
                            return this.html('pFollower 
  added/p').fadeIn(250);
                    });
            });
    }

  })(jQuery);

  If I remove the whole $.get() part, the error is gone. Chrome will
  start fading out too. The code will then look like:
  (function($) {
    $.fn.followUser = function(userId) {
            this.fadeOut(250, function(){

            });
    }

  })(jQuery);

  I even tried replace the get() with ajax(), but ran into the same
  problem.

  Btw, thanks for the attr('rel') suggestion. This is something I was
  also looking for, but couldn't figure it out :) The html is now:
  script type=text/Javascript
  $(function(){
          $('div#followButton a').click(function(){
                  $('div#followButton a').followUser($(this).attr('rel'));
          });});

  /script

  ...

  div id=followButton
  a rel=2test1/a
  /div

  On Sep 26, 6:48 pm, Matt Quackenbush quackfu...@gmail.com wrote:

   @ Mike - Thanks for making me take a closer look at the original code.  I
   get it now.  My bad.

   /me crawls back into his cave to hibernate some more



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.


[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread indre1

Ok, thanks. Should've noticed the highlighted word in editor.

But if it's javascript, then why doesn't it throw errors with Firefox?

On Sep 27, 3:55 pm, Mike McNally emmecin...@gmail.com wrote:
 You can always quote the word do on the left side of the colon:

   { do: something, x: y }

 It's not a bug, it's part of the Javascript language.



 On Sun, Sep 27, 2009 at 7:49 AM, indre1 ind...@gmail.com wrote:

  Tested, it can be bypassed with ajax():

   $.ajax({
                    type: GET,
                    url: profile.php,
                    data: do=addfriendid=2
                  });

  But is the get and do thing a bug?

  On Sep 27, 3:37 pm, indre1 ind...@gmail.com wrote:
  After 3 DAYS, I finally figured it out:
  $.get('profile.php', { do: 'addfriend', id: userId }

  The problem is, that the word do is reserved or something, thus you
  can't use it in get, ajax and probably elsewhere. test.php?
  do=something will never work from jQuery then, or how should I escape
  it?
  Is this a bug or just something everyone has to know? Strangely, on FF
  it all worked.

  $.get('profile.php', { action: 'addfriend', id: userId } works
  perfectly.

  On Sep 27, 1:27 pm, indre1 ind...@gmail.com wrote:

   Well, the problem still seems to be in the get() function. For
   example, IE gives the following error: Object doesn't support this
   property or method
   With:
   (function($) {
     $.fn.followUser = function(userId) {
             this.fadeOut(250, function(){
                     $.get('profile.php', { do: addfriend, id: userId }, 
   function
   (data){
                             return this.html('pFollower 
   added/p').fadeIn(250);
                     });
             });
     }

   })(jQuery);

   If I remove the whole $.get() part, the error is gone. Chrome will
   start fading out too. The code will then look like:
   (function($) {
     $.fn.followUser = function(userId) {
             this.fadeOut(250, function(){

             });
     }

   })(jQuery);

   I even tried replace the get() with ajax(), but ran into the same
   problem.

   Btw, thanks for the attr('rel') suggestion. This is something I was
   also looking for, but couldn't figure it out :) The html is now:
   script type=text/Javascript
   $(function(){
           $('div#followButton a').click(function(){
                   $('div#followButton a').followUser($(this).attr('rel'));
           });});

   /script

   ...

   div id=followButton
   a rel=2test1/a
   /div

   On Sep 26, 6:48 pm, Matt Quackenbush quackfu...@gmail.com wrote:

@ Mike - Thanks for making me take a closer look at the original code. 
 I
get it now.  My bad.

/me crawls back into his cave to hibernate some more

 --
 Turtle, turtle, on the ground,
 Pink and shiny, turn around.


[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread Mike McNally

That particular aspect of Javascript syntax is basically  a mistake
from its original design. Different parsers may be more lenient.
(There's no good reason for the syntax for object constants { x : y,
... } to forbid reserved words on the left side of the colons, because
there's no ambiguity as to the meaning of the construct.

That said, I don't know exactly what the story here is.


On Sun, Sep 27, 2009 at 8:09 AM, indre1 ind...@gmail.com wrote:

 Ok, thanks. Should've noticed the highlighted word in editor.

 But if it's javascript, then why doesn't it throw errors with Firefox?

 On Sep 27, 3:55 pm, Mike McNally emmecin...@gmail.com wrote:
 You can always quote the word do on the left side of the colon:

   { do: something, x: y }

 It's not a bug, it's part of the Javascript language.



 On Sun, Sep 27, 2009 at 7:49 AM, indre1 ind...@gmail.com wrote:

  Tested, it can be bypassed with ajax():

   $.ajax({
                    type: GET,
                    url: profile.php,
                    data: do=addfriendid=2
                  });

  But is the get and do thing a bug?

  On Sep 27, 3:37 pm, indre1 ind...@gmail.com wrote:
  After 3 DAYS, I finally figured it out:
  $.get('profile.php', { do: 'addfriend', id: userId }

  The problem is, that the word do is reserved or something, thus you
  can't use it in get, ajax and probably elsewhere. test.php?
  do=something will never work from jQuery then, or how should I escape
  it?
  Is this a bug or just something everyone has to know? Strangely, on FF
  it all worked.

  $.get('profile.php', { action: 'addfriend', id: userId } works
  perfectly.

  On Sep 27, 1:27 pm, indre1 ind...@gmail.com wrote:

   Well, the problem still seems to be in the get() function. For
   example, IE gives the following error: Object doesn't support this
   property or method
   With:
   (function($) {
     $.fn.followUser = function(userId) {
             this.fadeOut(250, function(){
                     $.get('profile.php', { do: addfriend, id: userId }, 
   function
   (data){
                             return this.html('pFollower 
   added/p').fadeIn(250);
                     });
             });
     }

   })(jQuery);

   If I remove the whole $.get() part, the error is gone. Chrome will
   start fading out too. The code will then look like:
   (function($) {
     $.fn.followUser = function(userId) {
             this.fadeOut(250, function(){

             });
     }

   })(jQuery);

   I even tried replace the get() with ajax(), but ran into the same
   problem.

   Btw, thanks for the attr('rel') suggestion. This is something I was
   also looking for, but couldn't figure it out :) The html is now:
   script type=text/Javascript
   $(function(){
           $('div#followButton a').click(function(){
                   $('div#followButton a').followUser($(this).attr('rel'));
           });});

   /script

   ...

   div id=followButton
   a rel=2test1/a
   /div

   On Sep 26, 6:48 pm, Matt Quackenbush quackfu...@gmail.com wrote:

@ Mike - Thanks for making me take a closer look at the original 
code.  I
get it now.  My bad.

/me crawls back into his cave to hibernate some more

 --
 Turtle, turtle, on the ground,
 Pink and shiny, turn around.



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.


[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread Scott Haneda


That would make sense, since `do` is a language keyword:
do {
code to be executed
}

while (var = endvalue);

I am sure there is a way to escape it, though in the same way I am  
fearful of using if/else/for/while/var and all the test as name/value  
pairs in JS or jQ, I would look to change it.


I have for a long time used 'act' which to me works better than do, as  
do means positive action, so you get into cases where you will see  
do=noprocess, or do=donotprocess, the cases of double-negative can  
lead to confusion.


act={add, update, delete, inset} that all is pretty clear.
Sorry I was not more help, just my opinion.
--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 27, 2009, at 5:37 AM, indre1 wrote:



After 3 DAYS, I finally figured it out:
$.get('profile.php', { do: 'addfriend', id: userId }

The problem is, that the word do is reserved or something, thus you
can't use it in get, ajax and probably elsewhere. test.php?
do=something will never work from jQuery then, or how should I escape
it?
Is this a bug or just something everyone has to know? Strangely, on FF
it all worked.

$.get('profile.php', { action: 'addfriend', id: userId } works
perfectly.

On Sep 27, 1:27 pm, indre1 ind...@gmail.com wrote:

Well, the problem still seems to be in the get() function. For
example, IE gives the following error: Object doesn't support this
property or method
With:
(function($) {
  $.fn.followUser = function(userId) {
  this.fadeOut(250, function(){
  $.get('profile.php', { do: addfriend, id:  
userId }, function

(data){
  return this.html('pFollower added/ 
p').fadeIn(250);

  });
  });
  }

})(jQuery);

If I remove the whole $.get() part, the error is gone. Chrome will
start fading out too. The code will then look like:
(function($) {
  $.fn.followUser = function(userId) {
  this.fadeOut(250, function(){

  });
  }

})(jQuery);

I even tried replace the get() with ajax(), but ran into the same
problem.

Btw, thanks for the attr('rel') suggestion. This is something I was
also looking for, but couldn't figure it out :) The html is now:
script type=text/Javascript
$(function(){
$('div#followButton a').click(function(){
$('div#followButton a').followUser($ 
(this).attr('rel'));

});});

/script

...

div id=followButton
a rel=2test1/a
/div

On Sep 26, 6:48 pm, Matt Quackenbush quackfu...@gmail.com wrote:

@ Mike - Thanks for making me take a closer look at the original  
code.  I

get it now.  My bad.



/me crawls back into his cave to hibernate some more




[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-26 Thread Mike McNally

On Sat, Sep 26, 2009 at 10:18 AM, Matt Quackenbush quackfu...@gmail.com wrote:

 That code should not work on _any_ browser.  In the onclick attribute you
 are grqbbing a reference to the containing div ($('#followButton2')), which
 clearly has no method named followUser.

... except that he's created his own jQuery extension called followUser.

Personally I'd be suspicious of the way that the handler is set up (as
a string value for the a tag's onclick attribute).

Also, in the followUser code, I think that the stuff to load the new
page (or whatever that is) should be in the finish handler for the
initial call to fadeOut() in order to make things work right.


Try something like this instead:
 script
 $(document).ready(function(){
   $('div a').click(function(){
        followUser($(this).attr('rel');
   });
 });

 div id=followButton2
 a rel=2test1/a
 /div

 Sent from my iPhone

 On Sep 26, 2009, at 6:26, indre1 ind...@gmail.com wrote:


 Any suggestions, why this code is not working on Webkit browsers:

 (function($) {
  $.fn.followUser = function(userId) {
     this.fadeOut(250);
     $.get(profile.php, { do: addfriend, id: userId }, function(data)
 {
         return this.html('pFollower added/p').fadeIn(250);
     });

  }
 })(jQuery);

 Only jquery and the plugin printed above are loaded, so there
 shouldn't be any conflicts.

 HTML:
 div id=followButton2
 a onclick=$('#followButton2').followUser('2')test1/a
 /div


 Chrome gives the following error:
 Uncaught TypeError: Object #an Object has no method 'followUser




-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.


[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-26 Thread Matt Quackenbush


That code should not work on _any_ browser.  In the onclick attribute  
you are grqbbing a reference to the containing div ($ 
('#followButton2')), which clearly has no method named followUser. Try  
something like this instead:


script
$(document).ready(function(){
   $('div a').click(function(){
followUser($(this).attr('rel');
   });
});


div id=followButton2
a rel=2test1/a
/div


Sent from my iPhone

On Sep 26, 2009, at 6:26, indre1 ind...@gmail.com wrote:



Any suggestions, why this code is not working on Webkit browsers:

(function($) {
 $.fn.followUser = function(userId) {
 this.fadeOut(250);
 $.get(profile.php, { do: addfriend, id: userId }, function 
(data)

{
 return this.html('pFollower added/p').fadeIn(250);
 });

 }
})(jQuery);

Only jquery and the plugin printed above are loaded, so there
shouldn't be any conflicts.

HTML:
div id=followButton2
a onclick=$('#followButton2').followUser('2')test1/a
/div


Chrome gives the following error:
Uncaught TypeError: Object #an Object has no method 'followUser


[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-26 Thread Matt Quackenbush
@ Mike - Thanks for making me take a closer look at the original code.  I
get it now.  My bad.

/me crawls back into his cave to hibernate some more


[jQuery] Re: $ajax() problem

2009-08-10 Thread Eduardo Pinzon
If the type is POST you could set arguments by 'data', or set the type to
GET to pass the paraments in querystring
...
type: GET,
url: mywebpage.aspx?Arg=+args2,
...

OR

...
type: POST,
url: mywebpage.aspx,
data:{Arg:args2}
...

Eduardo Pinzon
Web Developer


2009/8/10 yi falconh...@gmail.com


 $.ajax({

type: POST,

url: mywebpage.aspx?Arg=+args2,

contentType: text,

data:{},

dataType: text,

success: CompleteInsert,

error: onFail

});

 I dont know why the onFail function is going to be executed when args2
 is too big.
 args2 is a string type
 can anyone explain this
 thanks



[jQuery] Re: AJAX Problem

2009-05-08 Thread Arak Tai'Roth

Awesome, Mauricio had the right solution. I had figured that e was
working on the link, but now that I think about it, that makes no
sense. So that works, now I have to figure out how to inject the
incoming html, because apparently that's not working, just not sure
yet if it's my javascript or my PHP (I'm working with CakePHP).

Thanks for your help.

On May 7, 4:43 pm, Mauricio \(Maujor\) Samy Silva
css.mau...@gmail.com wrote:
 -Mensagem Original-
 De: Arak Tai'Roth nielsen.dus...@gmail.com

 ... Here is my code:

  $(document).ready(function(){
  $('#events_box a.ajax_replace').click(function(e){
  e.preventDefault();
  $('.news_border').slideUp('slow');

  $.ajax({
  method: 'get',
  url: e.attr('href'),
  data: { 'do' : '1' },

 ...
 -
 You are catching the URL for request in a wrong way.
 There isn't an object  *e.attr('href')*
 Try this:
 $(document).ready(function(){
 $('#events_box a.ajax_replace').click(function(e){
 e.preventDefault();

 var url = $(this).attr('href');    == add

 $('.news_border').slideUp('slow');

 $.ajax({
 method: 'get',
 url: url,                == modified
 data: { 'do' : '1' },
 ...

 Maurício


[jQuery] Re: AJAX Problem

2009-05-08 Thread Mauricio (Maujor) Samy Silva




Awesome, Mauricio had the right solution. I had figured that e was
working on the link, but now that I think about it, that makes no
sense. So that works, now I have to figure out how to inject the
incoming html, because apparently that's not working, just not sure
yet if it's my javascript or my PHP (I'm working with CakePHP).

---
It appear that there is nothing wrong with the jQuery sintax.
Does you made what Arak pointed?

method: 'get'
should be:
type: 'get'

Maurício



[jQuery] Re: AJAX Problem

2009-05-08 Thread Arak Tai'Roth

Yea I changed method to type, but it still isn't working.

Here is my code for the controller (if you don't know CakePHP, this
likely won't mean anything to you):

function view($slug)
{
if ($this-RequestHandler-isAjax())
{
$dbdirector = $this-Director-find('first', 
array(
'conditions' = array(
'Director.slug' = 'slug'
),
'fields' = array(
'Director.id', 'Director.name', 
'Director.description',
'Director.picture'
)
));
$this-set('dbdirector', $dbdirector);

Configure::write('debug', 0);

$this-pageTitle = 'URSU - Director ' . 
$dbdirector['Director']
['name'];
}
else
{
$this-redirect('/directors/');
$this-exit();
}
}

And my code for my corresponding view.ctp file:

?php
echo $html-image('/img/directors/uploads/thumb.medium.' . $dbdirector
['Director']['picture'], array('alt' = $dbdirector['Director']
['name']));

echo $dbdirector['Director']['description'];

if ($admin)
{
echo 'div class = admin';
echo $html-link('Edit Director', '/directors/edit/' . 
$dbdirector
['Director']['id']);
echo ' --- ';
echo $html-link('Delete Director', 
'/directors/delete/' .
$dbdirector['Director']['id'], null, 'Are you sure you want to delete
this director?');
echo '/div';
}
?

What happens is a person goes to the index page, clicks a link, this
gets processed by the AJAX request, which sends it off to function view
($slug), which sets all the data and sends that data to view.ctp,
which then creates all of the html which I was hoping would be
injected into the div set in the ajax request.

On May 8, 9:16 am, Mauricio \(Maujor\) Samy Silva
css.mau...@gmail.com wrote:
 Awesome, Mauricio had the right solution. I had figured that e was
 working on the link, but now that I think about it, that makes no
 sense. So that works, now I have to figure out how to inject the
 incoming html, because apparently that's not working, just not sure
 yet if it's my javascript or my PHP (I'm working with CakePHP).

 ---
 It appear that there is nothing wrong with the jQuery sintax.
 Does you made what Arak pointed?

 method: 'get'
 should be:
 type: 'get'

 Maurício


[jQuery] Re: AJAX Problem

2009-05-08 Thread Arak Tai'Roth

Okay, so correction, I got it, it was a dumb mistake, makes me thing I
should go back to high school to learn how to spell.

Anyways, while I'm here, is there anyway I can force the callback
function beforeSend to run for a certain amount of seconds before to
stops running? Essentially what I want is to force the loading
animation I have going to run for at least 3 seconds or so before the
content loads, so it doesn't give a seizure inducing flash while 3
things happen all at once because the content loads too fast.

On May 8, 10:40 am, Arak Tai'Roth nielsen.dus...@gmail.com wrote:
 Yea I changed method to type, but it still isn't working.

 Here is my code for the controller (if you don't know CakePHP, this
 likely won't mean anything to you):

                 function view($slug)
                 {
                         if ($this-RequestHandler-isAjax())
                         {
                                 $dbdirector = $this-Director-find('first', 
 array(
                                         'conditions' = array(
                                                 'Director.slug' = 'slug'
                                         ),
                                         'fields' = array(
                                                 'Director.id', 
 'Director.name', 'Director.description',
 'Director.picture'
                                         )
                                 ));
                                 $this-set('dbdirector', $dbdirector);

                                 Configure::write('debug', 0);

                                 $this-pageTitle = 'URSU - Director ' . 
 $dbdirector['Director']
 ['name'];
                         }
                         else
                         {
                                 $this-redirect('/directors/');
                                 $this-exit();
                         }
                 }

 And my code for my corresponding view.ctp file:

 ?php
         echo $html-image('/img/directors/uploads/thumb.medium.' . $dbdirector
 ['Director']['picture'], array('alt' = $dbdirector['Director']
 ['name']));

         echo $dbdirector['Director']['description'];

         if ($admin)
         {
                 echo 'div class = admin';
                         echo $html-link('Edit Director', '/directors/edit/' 
 . $dbdirector
 ['Director']['id']);
                         echo ' --- ';
                         echo $html-link('Delete Director', 
 '/directors/delete/' .
 $dbdirector['Director']['id'], null, 'Are you sure you want to delete
 this director?');
                 echo '/div';
         }
 ?

 What happens is a person goes to the index page, clicks a link, this
 gets processed by the AJAX request, which sends it off to function view
 ($slug), which sets all the data and sends that data to view.ctp,
 which then creates all of the html which I was hoping would be
 injected into the div set in the ajax request.

 On May 8, 9:16 am, Mauricio \(Maujor\) Samy Silva

 css.mau...@gmail.com wrote:
  Awesome, Mauricio had the right solution. I had figured that e was
  working on the link, but now that I think about it, that makes no
  sense. So that works, now I have to figure out how to inject the
  incoming html, because apparently that's not working, just not sure
  yet if it's my javascript or my PHP (I'm working with CakePHP).

  ---
  It appear that there is nothing wrong with the jQuery sintax.
  Does you made what Arak pointed?

  method: 'get'
  should be:
  type: 'get'

  Maurício


[jQuery] Re: AJAX Problem

2009-05-08 Thread Mauricio (Maujor) Samy Silva


De: Arak Tai'Roth nielsen.dus...@gmail.com
Okay, so correction, I got it, it was a dumb mistake, makes me thing I
should go back to high school to learn how to spell.

Anyways, while I'm here, is there anyway I can force the callback
function beforeSend to run for a certain amount of seconds before to
stops running? Essentially what I want is to force the loading
animation I have going to run for at least 3 seconds or so before the
content loads, so it doesn't give a seizure inducing flash while 3
things happen all at once because the content loads too fast.

---
Use the standard JavaScript method setTimeout
Maurício 



[jQuery] Re: AJAX Problem

2009-05-07 Thread James

method: 'get'
should be:
type: 'get'

Try changing that to see if it works.

On May 7, 7:17 am, Arak Tai'Roth nielsen.dus...@gmail.com wrote:
 Hi there, so I am trying out jQuery recently, moving from MooTools,
 and needed to do some AJAX. Here is my code:

 $(document).ready(function(){
         $('#events_box a.ajax_replace').click(function(e){
                 e.preventDefault();
                 $('.news_border').slideUp('slow');

                 $.ajax({
                         method: 'get',
                         url: e.attr('href'),
                         data: { 'do' : '1' },
                         beforeSend: function(){
                                 alert('beforeSend');
                                 $('#loader').show('fast');
                         },
                         complete: function(){
                                 alert('complete');
                                 $('#loader').hide('fast');
                         },
                         success: function(html){
                                 alert('success');
                                 $('.news_border').html(html).show('slow');
                         }
                 });
         });

 });

 As far as I have read on these groups, the documentation, and some
 tutorials I found this should work. Everything before the $.ajax
 request works fine, however nothing within the $.ajax gets processed.

 I'm pretty positive what I am using in the data: area is wrong, it's
 what I use in MooTools. However I have heard before that my current
 host (Dreamhost) requires data to be sent in an AJAX request in order
 to make it work, so I think I need to include something even though I
 need no actual data sent in this request. Taking out the data line
 does not fix the problem.

 Can anyone point me in the right direction?


[jQuery] Re: AJAX Problem

2009-05-07 Thread Mauricio (Maujor) Samy Silva


-Mensagem Original- 
De: Arak Tai'Roth nielsen.dus...@gmail.com


... Here is my code:


$(document).ready(function(){
$('#events_box a.ajax_replace').click(function(e){
e.preventDefault();
$('.news_border').slideUp('slow');

$.ajax({
method: 'get',
url: e.attr('href'),
data: { 'do' : '1' },

...
-
You are catching the URL for request in a wrong way.
There isn't an object  *e.attr('href')*
Try this:
$(document).ready(function(){
$('#events_box a.ajax_replace').click(function(e){
e.preventDefault();

var url = $(this).attr('href');== add

$('.news_border').slideUp('slow');

$.ajax({
method: 'get',
url: url,== modified
data: { 'do' : '1' },
...

Maurício 



[jQuery] Re: AJAX Problem

2009-04-17 Thread Karl Swedberg
You have run into a fairly common issue: how to get events to work  
with elements that are added to the DOM, through either ajax or simple  
DOM mainpulation, after the document ready code has already fired.


This FAQ topic should answer your question:

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F

If you still have problems after reading through it and trying one of  
the many solutions, let us know.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Apr 17, 2009, at 2:28 PM, Rogue Lord wrote:



Hey folks, I noticed that when I was using $.ajax() on a $('a').click
() to pull up an external page (eg stats.php within the same
folkder) within a div called #main_content that any link that was
pulled up in that would not have the same effects as outside of it. Is
there a way to pass the inheritance over to the links in the in div
that is holding the new page? I appreciate any advice before hand!




[jQuery] Re: AJAX Problem

2009-04-17 Thread Rogue Lord

Ok got the pages to work with the livequery plugin but now I am having
a problem with the get data function... I know that the data: 
should when using 'type: GET' should give me a similar effect to ?
id=1...

var replacement = $(this).attr(title);
var content_show = $(this).attr(id);
$.ajax({
type: GET, url: replacement, data: 
content_show,
async: true,
beforeSend: 
function(){$(#loading).show(fast);},
complete: 
function(){$(#loading).hide(fast);},
success: function(html){ //so, if data is 
retrieved, store it in
html
$(#main_content).slideDown(slow); 
//animation
$(#main_content).html(html); //show 
the html inside .content
div
}
});

any extra suggestions? Thanks!

On Apr 17, 12:56 pm, Karl Swedberg k...@englishrules.com wrote:
 You have run into a fairly common issue: how to get events to work  
 with elements that are added to the DOM, through either ajax or simple  
 DOM mainpulation, after the document ready code has already fired.

 This FAQ topic should answer your question:

 http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st...

 If you still have problems after reading through it and trying one of  
 the many solutions, let us know.

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Apr 17, 2009, at 2:28 PM, Rogue Lord wrote:



  Hey folks, I noticed that when I was using $.ajax() on a $('a').click
  () to pull up an external page (eg stats.php within the same
  folkder) within a div called #main_content that any link that was
  pulled up in that would not have the same effects as outside of it. Is
  there a way to pass the inheritance over to the links in the in div
  that is holding the new page? I appreciate any advice before hand!


[jQuery] Re: ajax problem in IE

2009-03-31 Thread Ricardo

$('#myspan').text( $('#partnum').val() );
http://docs.jquery.com/Attributes

On Mar 29, 6:07 pm, webguy262 webguy...@yahoo.com wrote:
 I have two forms on a page (www.eastexhaust.com/inventory.php).

 One uses ajax to generate a part number by selecting values from a series of
 selection boxes.

 The other form emails the part number so we can reply with a quote.

 Everything works fine in FFox, but does not work in IE.

 Therefore, I have had to make things harder by asking the user to copy and
 paste their part number into the email form instead of having it entered
 there automatically.

 To display the part number to the user, I'm using this in the JS...

 document.getElementById('myspan').innerHTML = result;

 ...and this in the html...

 To get the variable in the email form, I'm using this in the JS...

 document.getElementById('partnum').value= result;

 ...and this in the html...

 input type=text name=partnum id=partnum readonly

 As I said, this works everywhere but not in IE.

 How can I use Jquery to make it work across the board?

 Thanks!
 --
 View this message in 
 context:http://www.nabble.com/ajax-problem-in-IE-tp22772776s27240p22772776.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: [AJAX] Problem with loading jquery through ajax

2009-02-17 Thread Rick Faircloth

Sounds like it may be a livequery issue, which this plug-in
addresses:

http://docs.jquery.com/Plugins/livequery

It basically re-applies functionality to newly inserted DOM elements.

hth,

Rick

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
 Behalf Of
r1u0...@gmail.com
 Sent: Tuesday, February 17, 2009 8:12 AM
 To: jQuery (English)
 Subject: [jQuery] [AJAX] Problem with loading jquery through ajax
 
 
 Hi,
 
 I've got master page with menu. When I click on menu option new page
 should be loaded (quite normal :P).
 I'm trying to do that using:
 $.post(hotline.aspx, function(data) { $(#load).html(data); });
 
 And div load is populated with html, but it seems like it isn't
 executed (there is f.e. jquery.js included, it's loaded - I've checked
 with firebug - but it isn't executed).
 
 When I open hotline.aspx in new window, everything is ok, but when
 from master page - fail.
 
 I was trying to do that with get, $.ajax, load, post but nothing is
 changed. Should I fire some additional function after load completed?
 
 Regards
 Radek



[jQuery] Re: Ajax Problem with IE works fine on FF

2009-02-04 Thread James

I haven't looked into it deeply, but try removing the space in
#gender :selected

so:
Usex = $(#gender :selected).val();

becomes:
Usex = $(#gender:selected).val();

I'm not sure if that'll make a differences. Do you know which part of
your code is not working? Have you tried printing/loggin variable
values at each step of your code?

On Feb 4, 5:52 am, Xross tam...@gmail.com wrote:
 Hi,

 I am having problem with IE6 / IE7 but IE8 works fine.

 Here's my ajax call

 ***

 function getJSonDate() {
         var Usex =;
         var Uminage = ;
         var Umaxage =;
         var Ucountry =;
         var Uplace = ;
         var Uzip =;

         Usex = $(#gender :selected).val();
         Uminage = $(#minage :selected).val();
         Umaxage = $(#maxage :selected).val();
         Ucountry = $(#country :selected).val();
         Uplace = $(#place :selected).val();
         Uzip = $(#zipcode).val();
         $(#preloader).show();
         $.getJSON(
                         getdateJSon.php, {gender: Usex, minage: Uminage, 
 maxage: Umaxage,
 zip: Uzip, cache: false},
                         function(data){
                                 $.each(data.userdata, function(i,user){
                                         ckuserid = user.id;
                                         var name_text  =  user.pname;
                                         var age_text = user.page;
                                         var place_text = user.pplace;
                                         var state_text = user.pState;
                                         var country_text = user.pCountry;
                                         var hello_text = user.ptextdesc;
                                         var imgurl = user.imgurl;
                                         var imagepath = images/user/ + 
 imgurl;
                                         $(#preloader).hide();

                                         if (name_text == ){

                                                 $(#imageControl).hide
 ();
                                                 $(#text_holder).hide();
                                                 $(#ZeroEntry).show();
                                                         } else {

                                                                 
 $(#ZeroEntry).hide();
                                                                 
 $(#imageControl).show();
                                                                 
 $(#text_holder).show();
                                                                 
 $('#imageholder').attr('src', imagepath);

                                                                 //Populate 
 the page with data
                                                                 
 $('h2.date_name').html(name_text);
                                                                 
 $('h3.date_details').html(age_text + y,  + place_text + ,
 + country_text );
                                                                 
 $('P.hellotext').html(hello_text);

                                                         }

                                 });
                         }
                 );

 } //end of getJSonDate

 
 Here is PHP page output
 

 { 'userdata': [ { 'id':'10001', 'pname':'Mikeala', 'page':'18',
 'pplace':'New York', 'pState':'New York', 'pCountry':'USA',
 'ptextdesc':'I like reading books, Travel, what about you ?',
 'imgurl':'mikeala.jpg' } ] }

 

 It works perfectly fine with FF / IE 8 but nothing comes up with IE
 6 / IE 7 i have tried many solution but none worked i wonder if their
 exists any solution. i have other functions like get state/city/
 Country name from mysql db through the same method they work fine but
 this is the only problem.

 i have everything online you can check it at

 http://clickdate24.com/beta/

 Any help is appreciated.

 Thanks.


[jQuery] Re: Ajax Problem

2009-01-28 Thread ragx


On Jan 28, 8:23 am, saiful.ha...@gmail.com saiful.ha...@gmail.com
wrote:
 hi all,

 I have 2 file

 rating.js
 $(document).ready(function() {
   var behav = function(){
     $(.rating_class).hover(function(){
       $(#tooltip_star).css({visibility:visible, top:($
 (this).offset().top - 60), left:($(this).offset().left+$(this).width
 ()+ 2)});
       $.ajax({
         type: POST,
         url: $(this).attr(href),
         success: function(msg){
           $(#tooltip_star).html(msg);
         }
       });
     }, function(){
       $(#tooltip_star).css(visibility,hidden);
     }).ajaxStart(function(){
       $(#tooltip_star).html(table class=\table_animation
 \trtdimg style=\text-align:center\ src=\/resource/images/
 loading.gif\/td/tr/table);
     });

     $(.rating_class).click(function(){
       location = $(this).attr(href).replace(ajax_, );
       return false;
     });
   }

   behav();

 });

 there is just call function behav(); to run all sintax in this file,

 and i have some ajax sintax in other file file this

 $(document).ready(function() {

 var mainApp = function(page){
       $.ajax({
         type: POST,
         url: ?= base_url();?product/related/?= $idProduct ?/+page,

         success: function(msg){
           $(#displayRelated).html(msg);
           behav();
         }
       });
     }

     mainApp(1);

 });

 But i get some error in my firebug like this

 behav is not defined
 success()()6 (line 652)
 success()jquery-1.2.6.js (line 2818)
 onreadystatechange()()jquery-1.2.6.js (line 2773)
 [Break on this error] behav();

 my question is, why my function behav() in rating.js can't called from
 success: function(msg){...}, there is need something like global
 function?

 thang's

 ~ saiful haqqi ~


Hi saiful,

1 = try to define ur behave(); function in that .js file where ur
above ajax
code.
2 = - if u have another .js file for behave(); function
- if ur bringing html file with response then include ur .js file
in that html response like this
script type=text/javascript src=rating.js  charset=utf-8/
script

hope this will work.

regards
Regx :)



[jQuery] Re: Ajax Problem

2009-01-28 Thread Saiful Haqqi
hi all,

Thang for ragx replay :D, but i still get the same error

this is my code

rating_star.js
$(document).ready(function() {
  var behav = function(){
$(.rating_class).hover(function(){
  $(#tooltip_star).css({visibility:visible,
top:($(this).offset().top - 60),
left:($(this).offset().left+$(this).width()+ 2)});
  $.ajax({
type: POST,
url: $(this).attr(href),
success: function(msg){
  $(#tooltip_star).html(msg);
}
  });
}, function(){
  $(#tooltip_star).css(visibility,hidden);
}).ajaxStart(function(){
  $(#tooltip_star).html(table class=\table_animation\trtdimg
style=\text-align:center\
src=\/resource/images/loading.gif\/td/tr/table);
});

$(.rating_class).click(function(){
  location = $(this).attr(href).replace(ajax_, );
  return false;
});
  }

  behav();
});


in detail.php I am just declare the js sintax like this,
script src=?= $base_url;?resource/j_s/rating_star.js
type=text/javascript charset=utf-8/script
$('#displayRelated').load(?= base_url();?product/related/?= $idProduct
?/+page, function() {
*behav();*
  });

I m still get error in firebug

*behav is not defined*

there is any wrong with my code?

~ saiful haqqi ~


[jQuery] Re: AJAX problem

2007-10-19 Thread Yaz

I'm not completely sure about this, but I think it doesn't like the
http://129.219.208.31/email/email.php; bit. I had to change my file
and put it in the same directory as mine. Hope it helps. Maybe someone
else can give you a better explanation, and/or prove me right/
wrong. :o)

-yaz

On Oct 19, 12:08 pm, VJ [EMAIL PROTECTED] wrote:
 I am unable to get the ajax to work in jquery.
 Whenever i pass a .php url to $.ajax. it does not return and none of
 the callbacks are executed. It justt hangs with no error.

 It looks very smple but does not seem to work..

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html;
 charset=iso-8859-1 /
 script language=javascript src=jquery-1.2.1.js/script
 titleUntitled Document/title
 /head

 body
 a href=javascript:void(0);Click here to send email/a
 /body
 script language=javascript
 $(a).click(function() {
 alert(about to send);
 $.ajax({
   type: GET,
   url: 
 http://129.219.208.31/email/email.php?
 [EMAIL PROTECTED]subject=hibody=hellofrompage,
   error:function(msg) { 
 alert(msg); }
 });

 });

 /script
 /html



[jQuery] Re: AJAX problem on Internet Explorer

2007-10-18 Thread HarryKC

You're welcome, I'm glad I could help.

Hrvoje



[jQuery] Re: AJAX problem on Internet Explorer

2007-10-17 Thread Hrvoje

Did you try to append a random  string or number to the URL, so the
browser does not cache the response?

example:

$('.orders').load('/shopping_carts/minicart/?
a='+random_string_or_number,function(){...

I had a similar problem (IE did not display the change on the page)
and when I added a randomly generated string at the end of the query,
IE started to change the page as FF did.




[jQuery] Re: Ajax Problem?

2007-05-23 Thread Benjamin Sterling

I could be wrong on this, but you have json as the dataType and your are
passing xml, so, although firebug says it sees the file correctly, jquery is
not successfully getting json, it's getting xml.

--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Re: Ajax problem with mac osX

2007-04-22 Thread junior2000

Hi,
thanks for your help.
The radio buttons code is ok (I've used form plugin).
I've found the problem. It was in the php page called by the ajax
script. I've searched the problem in the wrong place! sorry :-)

Thanks

On Apr 22, 12:27 am, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 Let's take the code apart
 nTipoDurata=$(:radio).fieldValue();
 make a value out of all the radio buttons on the page?? weird!

 I would usually use $([EMAIL PROTECTED]:checked).val()

 Little else looks weird to me.

 Although without a live link would help!

 PS I advocate using as few ids as possible, forms fields need name
 attributes, so I like to use them, I narrow down the search by using code
 like
 form.find([EMAIL PROTECTED]) where form is a jquery object already set to
 the form in question.

 Hope it helps!

 On 4/21/07, junior2000 [EMAIL PROTECTED] wrote:





  Hi,

  I've the same problem on safari and firefox for mac and in some
  windows based system.
  The problem is only on the call to the page costonoleggio.php. I don't
  know why in the most part of the systems (windows) all work correctly.
  It will be surely a bug in my script but I don't find it.

  On Apr 21, 7:22 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
   it might be this line that safari is croaking on!
   $(#costo).html($(costo,xmlData).text());

   Safari is very conservative about adding nodes from an xml ajax request
  to
   the html page. I've done some kluges, that help skirt the issue.

   Have you tried the nightly build of webkit to determine if it's been
  fixed?

   Simplifying the code will help, and running  with the javascript console
   will give you at minimum the way you are croaking!

   Do you have a live url, I can run it through safari and webkit to see if
  I
   get any extra info.

   On 4/21/07, junior2000 [EMAIL PROTECTED] wrote:

Hi,
I've a problem with an ajax call only on mac systems. On windows and
linux works well.
In the systems with problem firebug displays that the post request
don't load.
I've used the last jquery and the forms plugin.
Here the script:

Thanks for any suggestion.

script type=text/javascript language=JavaScript
!--

$(document).ready(function(){

function calcolaCostoNoleggio() {

nSettimane=0;
nMesi=0;
nTipoDurata=$(:radio).fieldValue();
nDurata=$(#durata).val();
nCliente=$(#idc).val();
nProduct=$(#id).val();

$.ajax({ type: POST, url: costonoleggio.php, data:
durata=+nDurata+tipo_durata=+nTipoDurata+idc=+nCliente
+id=+nProduct, dataType: xml, success: function(xmlData) {

$(#costo).html($(costo,xmlData).text());
abbonamento=$(abbonamento,xmlData).text();
if (abbonamento2) $(#copertura_abbonamento).html(L'abbonamento non
copre interamente il noleggio);
else $(#copertura_abbonamento).html(L'abbonamento copre interamente
il noleggio);

}
});

}

calcolaCostoNoleggio();

  $(#durata).change(function(event){
calcolaCostoNoleggio();
});

$(#tipi input).click(function(event){
calcolaCostoNoleggio();
})

});

//--
/script

   --
   Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ



[jQuery] Re: Ajax problem with mac osX

2007-04-21 Thread Ⓙⓐⓚⓔ

it might be this line that safari is croaking on!
$(#costo).html($(costo,xmlData).text());

Safari is very conservative about adding nodes from an xml ajax request to
the html page. I've done some kluges, that help skirt the issue.

Have you tried the nightly build of webkit to determine if it's been fixed?

Simplifying the code will help, and running  with the javascript console
will give you at minimum the way you are croaking!

Do you have a live url, I can run it through safari and webkit to see if I
get any extra info.



On 4/21/07, junior2000 [EMAIL PROTECTED] wrote:



Hi,
I've a problem with an ajax call only on mac systems. On windows and
linux works well.
In the systems with problem firebug displays that the post request
don't load.
I've used the last jquery and the forms plugin.
Here the script:

Thanks for any suggestion.

script type=text/javascript language=JavaScript
!--

$(document).ready(function(){

function calcolaCostoNoleggio() {

nSettimane=0;
nMesi=0;
nTipoDurata=$(:radio).fieldValue();
nDurata=$(#durata).val();
nCliente=$(#idc).val();
nProduct=$(#id).val();

$.ajax({ type: POST, url: costonoleggio.php, data:
durata=+nDurata+tipo_durata=+nTipoDurata+idc=+nCliente
+id=+nProduct, dataType: xml, success: function(xmlData) {


$(#costo).html($(costo,xmlData).text());
abbonamento=$(abbonamento,xmlData).text();
if (abbonamento2) $(#copertura_abbonamento).html(L'abbonamento non
copre interamente il noleggio);
else $(#copertura_abbonamento).html(L'abbonamento copre interamente
il noleggio);


}
});

}

calcolaCostoNoleggio();



  $(#durata).change(function(event){
calcolaCostoNoleggio();
});


$(#tipi input).click(function(event){
calcolaCostoNoleggio();
})


});


//--
/script





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: Ajax problem with mac osX

2007-04-21 Thread Ⓙⓐⓚⓔ

if you're using full firebug and firefox croaks, it's not likely a safari
problem!

firefox runs almost the same on mac and pc.

My offer still stands as I run 3 mac browsers.

On 4/21/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:


it might be this line that safari is croaking on!
$(#costo).html($(costo,xmlData).text());

Safari is very conservative about adding nodes from an xml ajax request to
the html page. I've done some kluges, that help skirt the issue.

Have you tried the nightly build of webkit to determine if it's been
fixed?

Simplifying the code will help, and running  with the javascript console
will give you at minimum the way you are croaking!

Do you have a live url, I can run it through safari and webkit to see if I
get any extra info.



On 4/21/07, junior2000 [EMAIL PROTECTED] wrote:


 Hi,
 I've a problem with an ajax call only on mac systems. On windows and
 linux works well.
 In the systems with problem firebug displays that the post request
 don't load.
 I've used the last jquery and the forms plugin.
 Here the script:

 Thanks for any suggestion.

 script type=text/javascript language=JavaScript
 !--

 $(document).ready(function(){

 function calcolaCostoNoleggio() {

 nSettimane=0;
 nMesi=0;
 nTipoDurata=$(:radio).fieldValue();
 nDurata=$(#durata).val();
 nCliente=$(#idc).val();
 nProduct=$(#id).val();

 $.ajax({ type: POST, url:  costonoleggio.php, data:
 durata=+nDurata+tipo_durata=+nTipoDurata+idc=+nCliente
 +id=+nProduct, dataType: xml, success: function(xmlData) {


 $(#costo).html($(costo,xmlData).text());
 abbonamento=$(abbonamento,xmlData).text();
 if (abbonamento2) $(#copertura_abbonamento).html(L'abbonamento non
 copre interamente il noleggio);
 else $(#copertura_abbonamento).html(L'abbonamento copre interamente
 il noleggio);


 }
 });

 }

 calcolaCostoNoleggio();



   $(#durata).change(function(event){
 calcolaCostoNoleggio();
 });


 $(#tipi input).click(function(event){
 calcolaCostoNoleggio();
 })


 });


 //--
 /script




--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: Ajax problem with mac osX

2007-04-21 Thread junior2000

Hi,

I've the same problem on safari and firefox for mac and in some
windows based system.
The problem is only on the call to the page costonoleggio.php. I don't
know why in the most part of the systems (windows) all work correctly.
It will be surely a bug in my script but I don't find it.


On Apr 21, 7:22 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 it might be this line that safari is croaking on!
 $(#costo).html($(costo,xmlData).text());

 Safari is very conservative about adding nodes from an xml ajax request to
 the html page. I've done some kluges, that help skirt the issue.

 Have you tried the nightly build of webkit to determine if it's been fixed?

 Simplifying the code will help, and running  with the javascript console
 will give you at minimum the way you are croaking!

 Do you have a live url, I can run it through safari and webkit to see if I
 get any extra info.

 On 4/21/07, junior2000 [EMAIL PROTECTED] wrote:





  Hi,
  I've a problem with an ajax call only on mac systems. On windows and
  linux works well.
  In the systems with problem firebug displays that the post request
  don't load.
  I've used the last jquery and the forms plugin.
  Here the script:

  Thanks for any suggestion.

  script type=text/javascript language=JavaScript
  !--

  $(document).ready(function(){

  function calcolaCostoNoleggio() {

  nSettimane=0;
  nMesi=0;
  nTipoDurata=$(:radio).fieldValue();
  nDurata=$(#durata).val();
  nCliente=$(#idc).val();
  nProduct=$(#id).val();

  $.ajax({ type: POST, url: costonoleggio.php, data:
  durata=+nDurata+tipo_durata=+nTipoDurata+idc=+nCliente
  +id=+nProduct, dataType: xml, success: function(xmlData) {

  $(#costo).html($(costo,xmlData).text());
  abbonamento=$(abbonamento,xmlData).text();
  if (abbonamento2) $(#copertura_abbonamento).html(L'abbonamento non
  copre interamente il noleggio);
  else $(#copertura_abbonamento).html(L'abbonamento copre interamente
  il noleggio);

  }
  });

  }

  calcolaCostoNoleggio();

$(#durata).change(function(event){
  calcolaCostoNoleggio();
  });

  $(#tipi input).click(function(event){
  calcolaCostoNoleggio();
  })

  });

  //--
  /script

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ



[jQuery] Re: AJAX Problem

2007-04-08 Thread dropx

i have figure out the point: the responseXML  returns XMLHttpRequest.
this is why i could not see the xml text. i have faced with many
problems in this Ajax experience :(

On Apr 8, 2:07 am, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 I made sure my apache server uses application/xml. I make sure all dynamic
 xml content does to!

 is it your own server? perhaps you need to upgrade the server??

 On 4/7/07, dropx [EMAIL PROTECTED] wrote:





  i am directly getting my data from xml document. how can i make the
  content-type as application/xml ?

  On Apr 8, 12:49 am, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
   I serve my xml as application/xml... it may make a difference!

   On 4/7/07, dropx [EMAIL PROTECTED] wrote:

hi, you are right. firefox and other modern browsers restrict this.
however. IE confused me because it was working for IE. for firefox by
netscape.security. i have solved this.

Now i have another problem. After calling the
$.ajax({..}).responseXML; i am gettin null. however the responseText
returns the XML as text. Why it could be.(content-type is text/xml
actually i am directly getting XML file).

On Apr 7, 10:30 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 dropx schrieb:

  I know how to call from another host with javascript without using
  JQuery. my question:
  is it possible to solve this with just JQuery's ajax functions?

 XmlHttpRequest (Ajax) does not allow cross-domain requests. jQuery
  nor
 any other library can solve this, because it is not solvable.

 The only way to call JavaScript from another host is by
 including/appending script elements.

 -- Klaus

   --
   Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ



[jQuery] Re: AJAX Problem

2007-04-07 Thread Ⓙⓐⓚⓔ

 url:http://../../Posts.xml;
probably should be
 url:../../Posts.xml,


On 4/7/07, dropx [EMAIL PROTECTED] wrote:



hi guys,
i am trying to write a simple ajax code with $.ajax() function.
however the Firebug plug-in in Firefox show this error:

[Exception... 'Permission denied to call method XMLHttpRequest.open'
when calling method: [nsIDOMEventListener::handleEvent]  nsresult:
0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)  location: unknown
data: no]

in the IE it is working there is not any problem.

my code is this:
var txt = $.ajax({
url:http://../../Posts.xml;,
type:GET,
dataType:xml
}).responseText;

i need help. thnks...





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: AJAX Problem

2007-04-07 Thread dropx

thnks,
whatabout if they are on the different hosts. For example,  if i want
to get xml feeds of a website how can i do that.


On Apr 7, 7:07 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 don't specify the host name in the ajax call! If it's not on the same host,
 you shouldn't be able to do it in the first place... IE cares so little for
 the rules!

 On 4/7/07, dropx [EMAIL PROTECTED] wrote:





  no,
  i omitted some part of the url:
  it is likehttp://localhost/jquery/Posts.xml

  On Apr 7, 6:28 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 url:http://../../Posts.xml;
   probably should be
 url:../../Posts.xml,

   On 4/7/07, dropx [EMAIL PROTECTED] wrote:

hi guys,
i am trying to write a simple ajax code with $.ajax() function.
however the Firebug plug-in in Firefox show this error:

[Exception... 'Permission denied to call method XMLHttpRequest.open'
when calling method: [nsIDOMEventListener::handleEvent]  nsresult:
0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)  location: unknown
data: no]

in the IE it is working there is not any problem.

my code is this:
var txt = $.ajax({
url:http://../../Posts.xml;,
type:GET,
dataType:xml
}).responseText;

i need help. thnks...

   --
   Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ



[jQuery] Re: AJAX Problem

2007-04-07 Thread Ⓙⓐⓚⓔ

then you need a work-around! I just posted my 6 line perl program the other
day!

On 4/7/07, dropx [EMAIL PROTECTED] wrote:



thnks,
whatabout if they are on the different hosts. For example,  if i want
to get xml feeds of a website how can i do that.


On Apr 7, 7:07 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 don't specify the host name in the ajax call! If it's not on the same
host,
 you shouldn't be able to do it in the first place... IE cares so little
for
 the rules!

 On 4/7/07, dropx [EMAIL PROTECTED] wrote:





  no,
  i omitted some part of the url:
  it is likehttp://localhost/jquery/Posts.xml

  On Apr 7, 6:28 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 url:http://../../Posts.xml;
   probably should be
 url:../../Posts.xml,

   On 4/7/07, dropx [EMAIL PROTECTED] wrote:

hi guys,
i am trying to write a simple ajax code with $.ajax() function.
however the Firebug plug-in in Firefox show this error:

[Exception... 'Permission denied to call method
XMLHttpRequest.open'
when calling method:
[nsIDOMEventListener::handleEvent]  nsresult:
0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)  location: unknown
data: no]

in the IE it is working there is not any problem.

my code is this:
var txt = $.ajax({
url:http://../../Posts.xml;,
type:GET,
dataType:xml
}).responseText;

i need help. thnks...

   --
   Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: AJAX Problem

2007-04-07 Thread dropx

I know how to call from another host with javascript without using
JQuery. my question:
is it possible to solve this with just JQuery's ajax functions?


On Apr 7, 7:17 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 then you need a work-around! I just posted my 6 line perl program the other
 day!

 On 4/7/07, dropx [EMAIL PROTECTED] wrote:





  thnks,
  whatabout if they are on the different hosts. For example,  if i want
  to get xml feeds of a website how can i do that.

  On Apr 7, 7:07 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
   don't specify the host name in the ajax call! If it's not on the same
  host,
   you shouldn't be able to do it in the first place... IE cares so little
  for
   the rules!

   On 4/7/07, dropx [EMAIL PROTECTED] wrote:

no,
i omitted some part of the url:
it is likehttp://localhost/jquery/Posts.xml

On Apr 7, 6:28 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
   url:http://../../Posts.xml;
 probably should be
   url:../../Posts.xml,

 On 4/7/07, dropx [EMAIL PROTECTED] wrote:

  hi guys,
  i am trying to write a simple ajax code with $.ajax() function.
  however the Firebug plug-in in Firefox show this error:

  [Exception... 'Permission denied to call method
  XMLHttpRequest.open'
  when calling method:
  [nsIDOMEventListener::handleEvent]  nsresult:
  0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)  location: unknown
  data: no]

  in the IE it is working there is not any problem.

  my code is this:
  var txt = $.ajax({
  url:http://../../Posts.xml;,
  type:GET,
  dataType:xml
  }).responseText;

  i need help. thnks...

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

   --
   Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ



[jQuery] Re: AJAX Problem

2007-04-07 Thread Ⓙⓐⓚⓔ

it's an ajax thing, not a jquery thing.

On 4/7/07, dropx [EMAIL PROTECTED] wrote:



I know how to call from another host with javascript without using
JQuery. my question:
is it possible to solve this with just JQuery's ajax functions?


On Apr 7, 7:17 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
 then you need a work-around! I just posted my 6 line perl program the
other
 day!

 On 4/7/07, dropx [EMAIL PROTECTED] wrote:





  thnks,
  whatabout if they are on the different hosts. For example,  if i want
  to get xml feeds of a website how can i do that.

  On Apr 7, 7:07 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
   don't specify the host name in the ajax call! If it's not on the
same
  host,
   you shouldn't be able to do it in the first place... IE cares so
little
  for
   the rules!

   On 4/7/07, dropx [EMAIL PROTECTED] wrote:

no,
i omitted some part of the url:
it is likehttp://localhost/jquery/Posts.xml

On Apr 7, 6:28 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
   url:http://../../Posts.xml;
 probably should be
   url:../../Posts.xml,

 On 4/7/07, dropx [EMAIL PROTECTED] wrote:

  hi guys,
  i am trying to write a simple ajax code with $.ajax()
function.
  however the Firebug plug-in in Firefox show this error:

  [Exception... 'Permission denied to call method
  XMLHttpRequest.open'
  when calling method:
  [nsIDOMEventListener::handleEvent]  nsresult:
  0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)  location:
unknown
  data: no]

  in the IE it is working there is not any problem.

  my code is this:
  var txt = $.ajax({
  url:http://../../Posts.xml;,
  type:GET,
  dataType:xml
  }).responseText;

  i need help. thnks...

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

   --
   Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: AJAX Problem

2007-04-07 Thread Ariel Jakobovits

Might it be that you are trying to access the responseText of the 
XMLHttpRequest object that is returned from $.ajax() before it is ready? Your 
call seems like it would have to be a synchronous call to work.

- Original Message 
From: dropx [EMAIL PROTECTED]
To: jQuery (English) jquery-en@googlegroups.com
Sent: Saturday, April 7, 2007 8:39:26 AM
Subject: [jQuery] Re: AJAX Problem


no,
i omitted some part of the url:
it is like http://localhost/jquery/Posts.xml


On Apr 7, 6:28 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
   url:http://../../Posts.xml;;
 probably should be
   url:../../Posts.xml,

 On 4/7/07, dropx [EMAIL PROTECTED] wrote:





  hi guys,
  i am trying to write a simple ajax code with $.ajax() function.
  however the Firebug plug-in in Firefox show this error:

  [Exception... 'Permission denied to call method XMLHttpRequest.open'
  when calling method: [nsIDOMEventListener::handleEvent]  nsresult:
  0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)  location: unknown
  data: no]

  in the IE it is working there is not any problem.

  my code is this:
  var txt = $.ajax({
  url:http://../../Posts.xml;;,
  type:GET,
  dataType:xml
  }).responseText;

  i need help. thnks...

 --
 Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ






[jQuery] Re: AJAX Problem

2007-04-07 Thread dropx

hi, you are right. firefox and other modern browsers restrict this.
however. IE confused me because it was working for IE. for firefox by
netscape.security. i have solved this.

Now i have another problem. After calling the
$.ajax({..}).responseXML; i am gettin null. however the responseText
returns the XML as text. Why it could be.(content-type is text/xml
actually i am directly getting XML file).




On Apr 7, 10:30 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 dropx schrieb:

  I know how to call from another host with javascript without using
  JQuery. my question:
  is it possible to solve this with just JQuery's ajax functions?

 XmlHttpRequest (Ajax) does not allow cross-domain requests. jQuery nor
 any other library can solve this, because it is not solvable.

 The only way to call JavaScript from another host is by
 including/appending script elements.

 -- Klaus



[jQuery] Re: AJAX Problem

2007-04-07 Thread Ⓙⓐⓚⓔ

I serve my xml as application/xml... it may make a difference!

On 4/7/07, dropx [EMAIL PROTECTED] wrote:



hi, you are right. firefox and other modern browsers restrict this.
however. IE confused me because it was working for IE. for firefox by
netscape.security. i have solved this.

Now i have another problem. After calling the
$.ajax({..}).responseXML; i am gettin null. however the responseText
returns the XML as text. Why it could be.(content-type is text/xml
actually i am directly getting XML file).




On Apr 7, 10:30 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 dropx schrieb:

  I know how to call from another host with javascript without using
  JQuery. my question:
  is it possible to solve this with just JQuery's ajax functions?

 XmlHttpRequest (Ajax) does not allow cross-domain requests. jQuery nor
 any other library can solve this, because it is not solvable.

 The only way to call JavaScript from another host is by
 including/appending script elements.

 -- Klaus





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ