我正在进行第二次活动(主要),如下所示:
Login -> Main -> Vforum
Run Code Online (Sandbox Code Playgroud)
我设法在Login活动中使用类似的Intent进入Main活动:
Intent logMeIn = new Intent(this,Main.class);
startActivity(logMeIn);
Run Code Online (Sandbox Code Playgroud)
这很好.我现在的问题是从Main到Vforum.
projectList.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
Intent launchVforum = new Intent(this, Vforum.class);
startActivity(launchVforum);
}
});
Run Code Online (Sandbox Code Playgroud)
projectList是一个ListView.Eclipse说:
The constructor Intent(new AdapterView.OnItemClickListener(){}, Class<Vforum>) is undefined
Run Code Online (Sandbox Code Playgroud)
我不知道该把this它放在哪里修理它.我只想参加我的第三项活动(Vforum).
我有一个删除链接,可以删除我页面上的当前评论。它使用 ajax 更改数据库,成功后,我想删除评论所在的 div。页面上的每个评论如下所示:
<div class="aComment">
<span class="commentTitle">Posted by xxx at xxx - <a href="javascript:void(0)" class="deleteComment" data-commentid="anID"><img src="resources/images/delete_comment.png" title="Remove this comment" /></a></span>
<span class="commentText">comment text here</span>
</div>
Run Code Online (Sandbox Code Playgroud)
一旦返回成功,我无法弄清楚如何删除 div。我试过了
$(this).parent().remove();
Run Code Online (Sandbox Code Playgroud)
没有运气。$(this)指锚标签所以parent()锚应该是<div class="aComment">对的?
对PHP来说并不陌生,但对PDO只有一天的时间.当然我在这里做错了.
$query = $conn->prepare("SELECT * FROM admins WHERE username = :username AND password = :password");
$query->execute(array('username' => $username,'password' => sha1($password)));
$result = $query->fetchAll(PDO::FETCH_ASSOC);
if (count($result) > 0)
{
$_SESSION['user']['who'] = $result[0]['who'];
$_SESSION['user']['email'] = $result[0]['email'];
$_SESSION['user']['username'] = $result[0]['username'];
echo REFRESH;
}
else
{
$message = "Invalid username / password.";
}
Run Code Online (Sandbox Code Playgroud)
我可以$_SESSIONS正确声明这些的唯一方法是,如果我使用我$result[0]['fieldName'];怎样才能通过它访问它$result['fieldName'];?
我有一个运行一些任意代码的函数,称为calculate()。我if有病,如果有,true我会发出离子确认警报。
我可以弹出确认警报,但是,我试图使用async / await等待确认中的响应,但是我对async / await的理解一定是错误的。这基本上是我在做什么:
import { AlertController } from '@ionic/angular';
export class Calculator {
private cancelResults:boolean = false;
constructor(private alertController:AlertController) {}
async calculate() {
// If my condition is true.
if (true) {
// show the user a confirm alert.
await this.warn();
// break out of function since they hit cancel.
if (this.cancelResults) return;
}
// The user hit Okay, continue with this function.
}
async warn() {
const alert = await …Run Code Online (Sandbox Code Playgroud) 我下载了eclipse for PHP,虽然代码提示适用于大多数PHP,但它们只适用于HTML.我该如何解决这个问题?
我对 laravel(特别是 L5)相当陌生,我正在制作自己的待办事项应用程序版本,而不是遵循那里的教程之一。到目前为止,我已经学到了很多东西,但是我目前在刀片模板中放置这段代码的方式让我认为它们可能是一种更简单的方法。
我的TodosController@indexfn 是
public function index()
{
$todos = Todo::get();
return view('todos', compact('todos'));
}
Run Code Online (Sandbox Code Playgroud)
App\Todo扩展了一个Eloquent模型,使数据处理变得非常容易!
我的路线是:
Route::bind('todos', function($slug)
{
return App\Todo::whereSlug($slug)->first();
});
Run Code Online (Sandbox Code Playgroud)
所以我的页面只是显示一个无序的“todos”列表。我想要两个单独的列表。一种用于已完成的待办事项,一种用于未完成的。我的刀片模板到目前为止看起来像这样,看起来有点凌乱。此外,我将结果循环两次,这是我认为可以改进的地方。
<h3>Incomplete</h3>
<ul>
@foreach ($todos as $todo)
@if ($todo->completed == 'No')
<li>
<a href="{{ route('todos.show', [$todo->slug]) }}">{{ $todo->title }}</a>
</li>
@endif
@endforeach
</ul>
<h3>Complete</h3>
<ul>
@foreach ($todos as $todo)
@if ($todo->completed == 'Yes')
<li>
<a href="{{ route('todos.show', [$todo->slug]) }}">{{ $todo->title }}</a>
</li>
@endif
@endforeach
</ul>
Run Code Online (Sandbox Code Playgroud)
有什么建议可以简化刀片模板吗?
我在IE6和7中有一个问题,我正在制作一个ajax请求.错误是:Expected identifier, string or number第262行指向:
$("#submitNewAdmin").live('click',function()
{
$.ajax({
type: "POST",
url: "resources/ajax/ajax_new_admin.php",
data:{
username:$(".pp_inline #username").val(),
password1:$(".pp_inline #password1").val(),
password2:$(".pp_inline #password2").val(),
email:$(".pp_inline #email").val(),
},
success: function(msg)
{
if (msg == "success")
{
location.reload(true);
}
else
{
alert(msg);
}
}
});
});
Run Code Online (Sandbox Code Playgroud)
其中线success发生.我已经google了,其他人的问题的解决方案是他们有一个额外的逗号.我查看了我的代码,我找不到额外的逗号.任何人都可以看到我做错了什么?所有这些代码都包含在内$(document).ready(function(){});.另外,我正在使用jquery-1.7.1.min.js
我正在尝试创建一个创建简单文本文件的.bat文件.我的问题是Windows XP的主文件夹是C:\Documents and Settingsvista及其之上C:\Users\
我正在运行这个,无论我为路径名称添加什么,我总是得到 it exists
@echo off
if exist C:\Documents and Settings\ (
echo it exists
Pause
) else (
echo file not found
Pause
)
Run Code Online (Sandbox Code Playgroud)
当我运行上面的it exists时候,我知道它实际上并不是因为我是Windows 7.我做错了什么?
php ×3
jquery ×2
android ×1
angular ×1
batch-file ×1
click ×1
eclipse ×1
ecmascript-6 ×1
javascript ×1
laravel ×1
laravel-5 ×1
listview ×1
mysql ×1
pdo ×1