[jQuery] Re: Using jQuery in requested file by $.ajax

2009-04-27 Thread Kevin King

According to http://docs.jquery.com/Ajax/jQuery.ajax#options if
datatype is = 'html', the script code will be evaluated when the ajax
response is inserted into the DOM.  So change your code to do more
than an alert and you should be fine.

-K2


[jQuery] Re: Using jQuery in requested file by $.ajax

2009-04-26 Thread Colonel

Anybody?

On 26 апр, 03:37, Colonel tcolo...@gmail.com wrote:
 Is it possible ti use jQuery or JS in file which I get by $.ajax?

 For example, I have a file like this file.php:
 ?
  div id=my_div_1pSome text .../p/div
  div id=my_div_2pSome text .../p/div
  div id=my_div_3pSome text .../p/div
  
  script type=text/javascript/script - use JS ???
  
  $(my_container).html(Some text ...); - use jQuery ???
 ?

 And I use $.ajax from main_file.php:
 $.ajax({
  type: POST,
  dataType: html,
  data: data= + $(#container).html(),
  url: file.php,
  cache: false,
  error:  function(msg) {alert(Error Saved:  + msg);},
  success: function(msg) {alert(container =  + $(#container).html
 ());},
  complete: function() {$.unblockUI();}

 });