I've this function js

function findCity(){
   if ($('selectCity').value == ''){
       $('msgCity').update("{$findError['empty']}");
       $('msgRif').update('');
   }
   else{
    var url = '{$mainurl2}/search/findCity.php';
    var mainBox = $('mainBox');
    var pars = 'city='+$('selectCity').value+'&Submit=Search';
    clean();
    new Ajax.Request(url, {
        method: 'post',
        parameters:  pars,
        onSuccess: function(transport) {

          new Effect.Fade('load',{duration:0.3});
          new Effect.Appear('mainBox',{duration:0.1,queue: 'end'});
          $('searchButtonRif').enable();
          $('searchButtonCity').enable();
        },
        onComplete: function (transport){
             var json = transport.responseText.evalJSON(true);
              Element.insert(mainBox,{top: json[0].script});
              mainBox.innerHTML=json[0].button;
        }
     });
   }

----------------------
findCity.php
----------------------
code PHP:

$scriptino[] = array('status'=>"<script language=JavaScript type=text/
javascript>
<!--
function search(){
  alert();
} --> </script>
",'button'=>'
<input type="button" onclick="search()" name="test" value="test" />');
    header('Content-type: application/x-json');
    echo json_encode($scriptino);

why into code html i view the button but the <script>code</script> no?

FireBug on firefox say that function not found
Why?
I need your help.

p.s.
Sorry for my english... :(

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---