How to create url in JS

Hi all,

I’m very new in Yii.

I’m building a search box using ESelect2 extention.

When a item is selected, I want to run controller to process selected data.

In view:




              'data'=> CHtml::listData(Job::model()->findAll(), 'id', 'name'),




                  'placeholder'=>'Tìm kiếm Plan',


                  'class' => 'search-box',








So, what I should do in plan_search() to create url.

// Search box

function job_search(){

    var id = document.getElementById('search_box').value;

    // What I should to do next ?


I looked for other posts, they’re using Ajax, but I dont know about Ajax.

If you have other solution, please help me to solve this.

Thanks in advance.

ajax is very straightforward using jquery instead of javascript

Thanks for the link.

I solved my problem.

I tried to post my solution, but this website warned me that "Your post seems to be a spam…".