Yii手动Ajax发布

I am trying to manually send a ajax post request. I keep getting a "400 Bad Request". I am using yii 1.1.x on my localhost.

Here is my view:

view admin.php

<script type="text/javascript">
        function findDealerSettings(did){
                alert(did);
                $.ajax({
                        type: 'POST',
                        url: '/dealers/ajaxDs',
                        data: did,
                        success: function (data) {
                                alert("Made it");
                        }
                });
        }
</script>

<?php 
$this->widget('zii.widgets.grid.CGridView', array(
        'id'=>'dealers-grid',
        'dataProvider'=>$model->search(),
        'filter'=>$model,
    'template' => '{summary}{pager}{items}{pager}{summary}',
    'columns'=>array(
                'name',
                'address1',
                'city',
                'state',
                'phone',
                array(
                        'header'=>Yii::t('multi', 'Settings'),
                        'htmlOptions' => array('class' => 'button-column'),
                        'type'=>'raw',
                        'value'=> function($data) {
                                        return '<a onclick="findDealerSettings('.$data->did.');$(&quot;#mydialog&quot;).dialog(&quot;open&quot;); return false;" class="settings" title="Update Setting" href="#"><img src="/images/gear_sm.png" alt="Update Setting"></a>';
                                }
                ),

                array(
                        'class'=>'EButtonColumnWithClearFilters',
            'label'=>Yii::t('multi', 'Clear Search'),
        ),

        ),
)); 
?>

Controller - DealersController.php:

    public function accessRules()
    {
            return array(
                    array('allow', // allow dealerSettings user to perform 'manage' action
                            'actions'=>array('manage'),
                            'roles'=>array('dealersettings')
                    ),
        array('allow', 'actions'=>array('dealercontextswitch'), 'roles'=>array('authenticated')),
                    array('allow', // allow admin user to perform 'admin' and 'delete' actions
                            'actions'=>array('admin','delete', 'create', 'view', 'update', 'ajaxDs'),
                            'roles'=>array('admin'),
                    ),
                    array('deny',  // deny all users
                            'users'=>array('*'),
                    ),
            );
    }

...


    public function actionAjaxDs(){
            if (!YII_DEBUG && !Yii::app()->request->isAjaxRequest) {
                    throw new CHttpException('403', 'Forbidden access.');
            }
            echo "Made it";

    }

I had to add the accessRules for ajaxDs in order to access ajaxDs

From this code I am able to use js to alert the did. After that I get a 400 Bad Request error for http://localhost/dealers/ajaxDs

When I actually go to http://localhost/dealers/ajaxDs I get a page that says "Made it", Like it is supposed to.

I do not know why my ajax is not work.

How do I manually enter in an ajax url for yii

Any Help would be greatly appreciated!

**************EDIT*****************

If I remove the type: 'POST' it works

<script type="text/javascript">
        aXDS = '<?php echo Yii::app()->createUrl('/dealers/ajaxDs'); ?>';

        function findDealerSettings(did){
                alert(did);
                $.ajax({
                        //type: 'POST',
                        url: '/dealers/ajaxDs',
                        data: did,
                        success: function (data) {
                                alert("Made it");
                        }
                });
        }
</script>

I'm not sure why, and I need to post the data

You could have error in your path

<script type="text/javascript">
    aXDS = '<?php echo Yii::app()->createUrl('/dealers/ajaxDs'); ?>';

    function findDealerSettings(did){
            alert(did);
            $.ajax({
                    //type: 'POST',
                    url: <?php echo yii::app()->baseUrl . '/dealers/ajaxDs' ; ?>,
                    data: did,
                    success: function (data) {
                            alert("Made it");
                    }
            });
    }
</script>