linux php下Ajax请求时URL路径出现重复
程序员文章站
2022-05-06 20:49:26
...
1. 项目用的YII框架,在module下面的Usertest.php有一个方法:
开发在windows上,页面访问没有问题,访问路径是正确的: */usertest/ChangeComments
public function getTextArea($fieldName,$usertest_id) { return CHtml::activeTextArea($this,$fieldName,array("name"=>$fieldName."_".$usertest_id,'style'=>'rows:3;cols:20;',"ajax" => array("type"=>"POST","url"=>"/usertest/ChangeComments", "data"=>array("usertest_id"=>$usertest_id,"usertest_comments"=>"js:this.value"),"success"=>"js:alert(\"Update comments success!\")"))); }调用的地方在usertest/index.php里面,代码如下:
array( 'name' => 'usertest_comments', 'id' => 'usertest_comments', 'header'=>'Comments', 'type'=>'raw', 'value'=>'$data->getTextArea(\'usertest_comments\',$data->usertest_id)', 'htmlOptions'=>array('style'=>'width:100px;'), ),
开发在windows上,页面访问没有问题,访问路径是正确的: *
上一篇: php+mysql查询优化简单实例