title: which is the best method to move php code out of js in ajax
body: <p>I am developing an application in Yii.. One issue i am facing is, when i am writing ajax functions, the url's will be in php. so i am unable to move the codes to another javascript file. </p>
  
  <pre><code>$.ajax({
               url: "&lt;?php echo Yii::app()-&gt;createUrl('provider/ajaxdetail');?&gt;",
               data: {'type':tagtype},
               beforeSend: function() { },
               success: function(data) {
  
                          }                   
  
               });
  </code></pre>
  
  <p>so what is the best method to move php out of the javascript so that i can move the javascript code to another js file.  I Thought of putting the url's in a hidden box and then call it in the javascript function. but i hope there will be better methods to do this . </p>
  
  <p>please help</p>