如何将背景音乐添加到网页?因此,当访问者打开页面时,音乐将自动播放.
我试过了<object> <embed>,<bgsound>但他们都没有在firefox中工作.为什么?
这不是重复的问题。我想在由C#编写的电报机器人中使用html代码。我搜索了SO,但没有找到任何答案。怎么做?我使用了TelegramBotSharp。这是与我所解释的部分有关的代码:
MessageTarget target = (MessageTarget)update.Chat ?? update.From;
if(Text.StartsWith("Hello")) {
bot.SendMessage(target, "Hello <a href='http://google.com'> dear</a>", true);
}
Run Code Online (Sandbox Code Playgroud) 实际上我被困了几个小时,我的老板希望我继续对上周编写的功能进行单元测试,当我开始 karma start 时,karma.conf.js它给了我以下问题:
"message": "An error was thrown in afterAll\nUncaught ReferenceError: angular is not defined",
我的文件结构:
webapp
-www
-services
api.service.js
-test
test.test.js
karma.conf.js
Run Code Online (Sandbox Code Playgroud)
karma.conf.js 的要点:
module.exports = function(config) {
config.set({
files: [
'www/js/services/api.service.js',
'test/**/*.test.js'
],
})
}
Run Code Online (Sandbox Code Playgroud)
我认为 Karma 找不到我的 api.service.js 但我不知道为什么,AngularJS 代码实际上在 Web 应用程序中工作。
我的 test.test.js 的内容:
(function() {
'use strict';
describe('apiService', function() {
it('should return an array of object', function() {
var artist = typeof getArtist(118680); // MGMT Artist
console.log(artist);
expect(artist).toEqual('array');
});
});
})();
Run Code Online (Sandbox Code Playgroud)
getArtist …
我正在尝试根据控制器中变量的值制作饼图,请建议最简单的方法来实现这一点。
我想使用 Telegram Bots 将文件从 URL 发送给用户,我的文件扩展名在,.attheme但我无法从 Url 上传此文件。
目前我可以上传.zip, .pdf,但我想.attheme从 PHP 代码上传文件。
该机器人可以将任何类型的文件上传到 Telegram:@uploadbot
我怎样才能做到这一点 ?
当我搜索它时,我得到了一些答案。但是当我使用这个解决方案时 - (附有屏幕截图)。
我收到错误
消息 156,级别 15,状态 1,第 38
行关键字“like”附近的语法不正确
我有一个表student_constraint,我想创建一个新表,例如student_constraint.
create table student_info like student_constraint
Run Code Online (Sandbox Code Playgroud)
您能解释一下这个概念吗?
谢谢你!
我是Laravel的初学者
public function allorders($param1){
$customerss=Customer::where('mobile_number',$param1)->first();
$customer_id1=$customerss->id;
$orderss= Order::where('customer_id',$customer_id1);
return view('admin.allorders')->with('orderss', $orderss);
}
Run Code Online (Sandbox Code Playgroud)
我有这个观点 admin.allorders
@foreach ($orderss as $tag)
<span class="label label-primary">{{ $tag['customer_id']}}</span>
@endforeach
Run Code Online (Sandbox Code Playgroud)
我确定$orderss它有数据,但它没有在视图中显示.
我正在创建一个页面访问者模块。目标是了解访问最多的用户,以及访问最多的模块。
我想获取当前页面的页面路由。
这是我想要做的:
'merchandiser/report/inventory'。(在routes.php,它是$route['merchandiser/report/inventory'])。这与我想要的路线相同。
我试过了:
<?php echo current_url(); ?>
Run Code Online (Sandbox Code Playgroud)
But it returns something like this.
192.168.3.3/portal/merchandiser/report/inventory
Run Code Online (Sandbox Code Playgroud)
192.168.3.3/portal/ is my base url`
Now my question is:
How can I remove 192.168.3.3/portal/ and just get merchandiser/report/inventory
Hope you can guide me or lead me where to find it.
Thank You.
我已经把我的网络挂接,这让我更新,但我不知道如何发送InlineQueryResult与php
我想发送这样的文字:
aaaaaaaaaaabbbbbbbbbcccccc
Run Code Online (Sandbox Code Playgroud)
我怎么能用php curl发送它?这就是我目前的尝试:
$token = 'bot###';
$chat_id = '###';
$keyboardl = ['inline_keyboard' => [[['text' => "one", 'callback_data' => "1"],['text' => "two", 'callback_data' => "2"]]]];
$data = array("chat_id" => $chat_id,"results" => "??????","reply_markup" => $keyboardl);
$data_string = json_encode($data);
$ch = curl_init('https://api.telegram.org/'.$token.'/answerinlinequery');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
echo $result;
}
Run Code Online (Sandbox Code Playgroud)
我不知道我必须使用哪个InlineQueryResult才能发送文本.
我在尝试删除时收到以下错误Message:
2018-04-10 13:58:57,646 (__init__.py:292 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body:
[b'{"ok":false,"error_code":400,"description":"Bad Request: message can\'t be deleted"}']"
Run Code Online (Sandbox Code Playgroud)
为什么留言无法删除?
import config
import telebot
bot = telebot.TeleBot(config.token)
@bot.message_handler(content_types=["text"])
def repeat_all_messages(message):
bot.send_message(message.chat.id, 'Hello World')
bot.delete_message(message.chat.id, message.message_id)
if __name__ == '__main__':
bot.polling(none_stop=True)
Run Code Online (Sandbox Code Playgroud) telegram-bot ×4
php ×3
angularjs ×2
telegram ×2
audio ×1
c# ×1
charts ×1
codeigniter ×1
graph ×1
html ×1
javascript ×1
laravel ×1
python ×1
sql-like ×1
sql-server ×1
unit-testing ×1