我目前正在开发我的网站:用户个人资料部分 - 选择个人资料图片; 在我的html结构中的位置是:
<tr>
<td>
<img src="a.jpg"><br>
<input type="radio" name="profile" value="a" >
</td>
<td>
<img src="b.jpg"><br>
<input type="radio" name="profile" value="b" >
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
我想要做的是使用jquery ajax提交值onchange但是我已经尝试了几种方法和测试,如:
$("input:radio[name='profile']").click(function(){
alert($(this).val());
});
Run Code Online (Sandbox Code Playgroud)
和
$("input:radio[name='profile']").change(function(){
alert($(this).val());
});
Run Code Online (Sandbox Code Playgroud)
仅供参考:我知道ajax部分我不知道如何接近onchange/onclick部分..请指导我开始
大家好,我是yii框架工作的新手,我正在关注电子书上的拉里·奥尔曼的指示.我遇到的问题是:当我创建新的迁移时,我不断收到此错误
The migration directory does not exists:application.migrations
I use the command : $ yiic migrate create <name>
Run Code Online (Sandbox Code Playgroud)
谢谢你们帮助我理解你们.
嗨,我是yii的新手,我目前正在开展一个项目,我遇到了CDbCriteria问题.
我的目标查询是:
title LIKE '$_GET['search']%' OR description LIKE '$_GET['search']%'
Run Code Online (Sandbox Code Playgroud)
是否有可能使用CDbCriteria比较获得相同的结果?
控制器动作:
public function actionClassifieds(){
$model = new Classifieds('search');
$model->unsetAttributes();
if(isset($_GET['category'])){
if( $_GET['category'] == 0 ){
$model->classified_category_id = '';
}else{
$model->classified_category_id = $_GET['category'];
}
}
if(isset($_GET['search'])){
$model->title = $_GET['search'];
$model->description = $_GET['search'];
}
$this->render('classifieds',array('model'=>$model));
}
Run Code Online (Sandbox Code Playgroud)
我的模特:
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('classified_category_id',$this->classified_category_id);
$criteria->compare('title',$this->title,true);
$criteria->compare('description',$this->description,true);
$criteria->compare('price',$this->price,true);
$criteria->compare('timestamp',$this->timestamp);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'pagination'=>array(
'pageSize'=>10,
), …Run Code Online (Sandbox Code Playgroud) 我发现很难发出一个事件,因为我不太了解创建一个事件/发出一个带有套接字IO的事件.
这是CASE"/ publish"的问题:
var app = http.createServer(function (req, res) {
if (req.method == "OPTIONS") {
res.header('Access-Control-Allow-Origin', '*:*');
res.send(200);
} else {
var u = url.parse(req.url,true),
body = '';
req.on('data',function(chunk) {
body += chunk;
});
req.on('end',function() {
if(body) {
var data =JSON.parse(body);
if(data._app_secret && data._app_secret == 'nonexistent') {
switch(u.pathname) {
case '/generateusersecret' :
findTokenByUser(req.headers.host+'_'+data.user_id,function(reply) {
if(reply) {
jsonResponse(res,{userSecret : reply});
} else {
generateToken(req.headers.host + '_' + data.user_id,data.user_id,res);
}
});
break;
case '/getusersecret' :
findTokenByUser(req.headers.host + '_' + data.user_id,function(reply) {
jsonResponse(res,{userSecret …Run Code Online (Sandbox Code Playgroud) 我目前正在开发我的网站应用程序,我需要在实时服务器上进行测试.
在本地计算机上它运行良好,但在实时服务器上它不起作用.
这是我的问题描述:
When I access the domain root folder "mydomain.com" it is working.
It displays the
webpage index. But when I try to access site/action it
gives me 404 not found. Same thing happens for other controller action.
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我有什么问题.我不是真正服务器的专家所以我不擅长术语我只能描述正在发生的事情.
我不确定这是否值得一提,但我使用的是yii urlManager
有了这个设置
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<action:\w+>' => 'site/<action>',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
'showScriptName'=>false
),
Run Code Online (Sandbox Code Playgroud)
和根文件夹上的htaccess ..
服务器是:LAMP
非常感谢您的帮助..感谢所有人.