我认为这是微不足道的,但无法解决:(
我想用javascript更改mu url中传递的参数。
var url = "http://example.com/categoryname/5/%23date/archive";
url = url.replace(/%23date/g, newDateValue);
我在互联网上搜索了超过几个小时,但仍未修复。请帮忙!
更新
这是Yii中的完整代码
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'name' => 'inline_datepicker',
'flat' => true,
'language' => Yii::app()->language,
'value' => strtotime($date),
'themeUrl' => Yii::app()->baseUrl,
'theme' => 'themes/haber',
'cssFile' => '/lib/styles/datepicker.css',
'options' => array(
'dateFormat' => 'dd-mm-yy',
'showButtonPanel' => 'true',
'onSelect' => 'js:function(selectedDate){var url = \'' . Yii::app()->createAbsoluteUrl("category/archive", array("id" => $_GET['id'], "name" => $_GET['name'], "date" => "#date")) . '\'; url.replace(/#date/g, selectedDate); alert(url);}',
'showAnim' => 'slide',//$(location).attr("href", url);
))
);