我正在尝试使用语义ui菜单.
但我不能让它工作,即当我点击菜单中的项目时,活动状态不会改变.我也没有在网上找到任何例子.
HTML:
<div class="ui grid">
<div class="one wide row">
<div class="ui green menu">
<a class="active item">
<i class="home icon"></i> Home
</a>
<a class="item">
<i class="mail icon"></i> Messages
</a>
<div class="right menu">
<div class="item">
<div class="ui transparent icon input">
<input type="text" placeholder="Search...">
<i class="search link icon"></i>
</div>
</div>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
JS:
$(document).ready(function() {
$('.ui .green .menu').menu();
});
Run Code Online (Sandbox Code Playgroud)
我从semantic-ui网站上获取了代码片段.
一些帮助表示赞赏.
我已经在互联网上看到并阅读了很多关于这个特定问题的内容.我正在写一个简单的聊天服务器和客户端使用python中的socket主要用于学习目的.
我在这里发现了一个问题.
这是我的服务器代码:
__author__ = 'pchakraverti'
import socket
import select
import sys
class NickSocketMap(object):
count = 0
def __init__(self, nick, client_socket):
self.nick = nick
self.client_socket = client_socket
NickSocketMap.count += 1
@staticmethod
def display_count():
print "Total number of clients is %d" % NickSocketMap.count
host = ""
port = 7575
socket_list = []
nick_list = []
cnt = 0
recv_buffer = 1024
def register_nick(nick, client_socket):
obj = NickSocketMap(nick, client_socket)
nick_list.append(obj)
def process_request(request_string, client_socket):
parts = request_string.split("|")
if parts[0] == "set_nick":
register_nick(parts[1], client_socket) …Run Code Online (Sandbox Code Playgroud) 我需要找出创建的表是否包含条目.
我需要的是,
if (TableIsEmpty) then
do_something
else
do_something_else;
Run Code Online (Sandbox Code Playgroud)
我为此目的写的是:
Function IsTableEmpty:Boolean;
Var
DataSource : string;
Begin
DataSource :=
'Provider=Microsoft.Jet.OLEDB.4.0'+
';Data Source=c:\mydb.mdb'+
';Persist Security Info=False';
Form2.ADOConnection1.ConnectionString := DataSource;
Form2.ADOConnection1.LoginPrompt := False;
Form2.ADOCommand1.Connection := Form2.ADOConnection1;
Form2.ADOTable1.ConnectionString := DataSource;
Form2.ADOTable1.Connection := Form2.ADOConnection1;
if (Form2.ADOTable1.IsEmpty)then
result := true
else
result := false;
End;
Run Code Online (Sandbox Code Playgroud)
但是无论表的状态如何,此函数都返回true!
编辑*** 修改代码:
Function IsTableEmpty:Boolean;
Var
DataSource, cs : string;
Begin
DataSource :=
'Provider=Microsoft.Jet.OLEDB.4.0'+
';Data Source=c:\Users.mdb'+
';Persist Security Info=False';
Form2.ADOConnection1.ConnectionString := DataSource;
Form2.ADOConnection1.LoginPrompt := False;
Form2.ADOCommand1.Connection := Form2.ADOConnection1;
Form2.ADOTable1.Connection := Form2.ADOConnection1; …Run Code Online (Sandbox Code Playgroud) 我是chrome扩展程序的新手,我在编写第一个chrome扩展程序时遇到了麻烦.我要做的是检测新的标签操作并重定向到预定义的(我的网页)网址.
我写了manifest.json和background.html,但它似乎不起作用.我浏览了关于功能以及如何使用它们的谷歌论文,但必须有一些我错过的东西.
我不太了解我在这里做过的一些事情,例如manifest.json中的内容脚本.
一些帮助解决这个问题将不胜感激.
编辑

EDIT2 这是更新的代码现在我没有background.html文件.的manifest.json
{
"name": "Tabber",
"manifest_version" : 2,
"version": "1.0",
"description": "MyExtension",
"background" : {
"scripts": ["code.js"]
},
"chrome_url_overrides": {
"newtab": "code.js"
},
"permissions": [
"tabs"
]
}
Run Code Online (Sandbox Code Playgroud)
code.js
<script>
chrome.browserAction.onClicked.addListener(function(tab){
var action_url = "www.xyz.com"
chrome.tabs.create({ url: action_url });
}
</script>
Run Code Online (Sandbox Code Playgroud)
现在当我打开一个新选项卡时,我会看到显示的.js文件的来源.截图:

为什么脚本没有被执行?
我一直在尝试使用简单的 HTTP POST 来将基于cordova 的应用程序连接到服务器(基于php)。
我编写了一个简单的 php 文件仅用于测试目的。
代码:
<?php
if (isset($_POST["TEST"])){
echo "TEST WORKS!!";
}
?>
Run Code Online (Sandbox Code Playgroud)
现在我的cordova应用程序中的jquery代码>
// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkID=397704
// To debug code on page load in Ripple or on Android devices/emulators: launch your app, set breakpoints,
// and then run "window.location.reload()" in the JavaScript Console.
(function () {
"use strict";
document.addEventListener('deviceready', onDeviceReady.bind(this), false);
function onDeviceReady() {
// Handle the Cordova pause and resume events
document.addEventListener('pause', onPause.bind(this), …Run Code Online (Sandbox Code Playgroud) jquery ×2
cordova ×1
database ×1
delphi ×1
is-empty ×1
javascript ×1
json ×1
ms-access ×1
php ×1
python ×1
python-2.7 ×1
semantic-ui ×1
sockets ×1