尝试使用新的LearnStreet在线教程学习Ruby.
试图通过他们的Q&A系统获得帮助,但似乎没有人回答他们.
"你现在可以在账户对象上实施withdraw!方法,该方法需要一个参数金额并将余额减少指定金额吗?定义方法后,继续从账户中提取100美元并检查余额."
这个问题和我得到了两个提示
"提示1代码@balance = @balance - 金额减少@balance的金额.
提示2然后调用方法撤销!在帐户对象 - account.withdraw!(100)."
我的尝试是
def
account.widthdraw!
@balance = @balance - amount
end
account.withdraw!(100)
Run Code Online (Sandbox Code Playgroud)
我缺少什么想法?
<a href="http://link" target="_blank" title="Check out our NEW E-Catalogue" alt="Check out our NEW E-Catalogue" name="Check out our NEW E-Catalogue"><img alt="Check out our NEW E-Catalogue" title="Check out our NEW E-Catalogue" src="http:/image" border="0px"></a>
Run Code Online (Sandbox Code Playgroud)
上面的代码是我在HTML电子邮件中使用的,通过电子邮件营销平台发送.
将鼠标悬停在Outlook 2010和其他电子邮件客户端上的此图像时,将显示链接而不是标题文本.
有什么建议?
尝试在每次加载页面时从数组中随机生成一个div.
我已经设法将来自几个随机图像生成器的位组合在一起以创建下面的内容.
当数组中的[0]包含图像时,就像其他图像一样,一切都按预期工作.一旦我用div或视频替换[0]的图像,一切都没有显示,页面是空白的.
我出错的任何建议?
<link rel="stylesheet" type="text/css" href="style.css" >
<script type="text/javascript">
function random()
{
video = new Array(4);
video[0] = "<div class="clip"> </div> ";
video[1] = "<a href=''><img src='http://lorempixel.com/output/city-q-c-640-480-3.jpg' alt='' /></a>";
video[2] = "<a href=''><img src='http://lorempixel.com/output/fashion-q-c-640-480-6.jpg' alt='' />";
video[3] = "<a href=''><img src='http://lorempixel.com/output/technics-q-c-640-480-1.jpg' alt='' />";
for(var i = 0; i < video.length; i++)
{
index = Math.floor(Math.random() * video.length);
document.write(video[index]);
}
}
</script>
</head>
<body>
<script type="text/javascript">
random();
</script>
</body>
Run Code Online (Sandbox Code Playgroud)