- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
最诚挚的问候,对不起,我的英语不好 ,我有ajax perl chat script ,
索引页是传入的.cgi
use strict;
use warnings;
use CGI;
use Fcntl qw(:DEFAULT :flock);
use File::Basename;
#DEBUG
#use Carp qw( confess );
#$SIG{__DIE__} = \&confess;
# Not so elegant... to be improved
my ($scriptname,$scriptdir,$scriptsuffix) = fileparse($ENV{SCRIPT_FILENAME});
my %config = (do $scriptdir.'config.pl');
my $query = new CGI;
my $text = $query->param('text');
my $user = $query->param('user');
if ( !defined $text || !defined $user) { print $query->header('text/plain; charset="UTF-8"',401); exit; } # Bad formed request
# Check for unwanted clients
my $badipfilename = $config{pathonserver}."banlist.dat";
open(my $badipfile, "<:encoding(UTF-8)", $badipfilename ) or die "Unable to load file $badipfilename: $!";
my $ban = <$badipfile> || "";
if( $ban ne "" && $ENV{'REMOTE_ADDR'} =~ /$ban/ ) { print $query->header('text/plain; charset="UTF-8"',403); exit; } # Banned IP
close($badipfile);
# OK Well formed request && accepted client
print $query->header('text/plain; charset="UTF-8"');
if ( length($text) > 1024 || length($text) == 0) { print "TEXTSIZE"; exit; }
if ( length($user) > 32 || length($text) == 0) { print "USERSIZE"; exit; }
# check for HTML
if ( $user =~ /<(?:.|\s)*?>/i ) { print "HTMLUSER|$&"; exit; }
if ( $text =~ /<(?:.|\s)*?>/i ) { print "HTMLTEXT|$&"; exit; }
# check for unwanted words
my $badwordsfilename = $config{pathonserver}."badwords.dat";
open(my $badwordsfile, "<:encoding(UTF-8)", $badwordsfilename ) or die "Unable to load file $badwordsfilename: $!";
my $bw = <$badwordsfile> || "";
close($badwordsfile);
my $bwregex = '(^|\s)('.$bw.')($|\s)';
if ( $bw ne "" && $user =~ /$bwregex/i ) { print "BADUSER|$&"; exit; }
if ( $bw ne "" && $text =~ /$bwregex/i ) { print "BADTEXT|$&"; exit; }
# OK all test passed
my $lidfilename = $config{pathonserver}."lastid.dat";
my $chatfilename = $config{pathonserver}."chat.dat";
open(LASTIDFILE, "+<:encoding(UTF-8)", $lidfilename ) or die "Unable to load file $lidfilename: $!";
# We use lock on this file to sync with other actions
# START OF CRITICAL SECTION
flock( LASTIDFILE, LOCK_EX ) or die "Cannot gain FLOCK on file $lidfilename: $!";
# Open this INTO critical section or other access will cause errors
open(my $chatfile, "+<:encoding(UTF-8)", $chatfilename ) or die "Unable to open file $chatfilename: $!";
my $newid;
if( -s $chatfile > 150000 )
{
# The file is too big, let's prune
my $newchatfilename = $config{pathonserver}."newchat.dat";
open( my $newchatfile, ">:encoding(UTF-8)", $newchatfilename) or die "Unable to create file $newchatfilename: $!";
my $i = 0;
while( <$chatfile> )
{
# Roll the file rows until we reach 75 K
if( tell($chatfile) > 75000 )
{
# Ok we can copy the following rows reassigning a new ID
my @chatfields = split /\|/;
$chatfields[0] = $i;
print $newchatfile join( '|' , @chatfields);
$i ++;
}
}
$newid = $i;
close $chatfile;
close $newchatfile;
# Cleanup deleting old chat.txt and replacing with the new chat.txt
if (unlink($chatfilename) != 1)
{
my $errstr = "Unable to delete file $chatfilename: $!";
unlink $newchatfilename;
die $errstr;
}
rename $newchatfilename,$chatfilename;
# Re-open chat.txt as if it was never modified
open($chatfile, "+<", $chatfilename ) or die "Unable to open file $chatfilename: $!";
}
else
{
seek(LASTIDFILE, 0, 0);
my $lastserverid = <LASTIDFILE>;
$newid = $lastserverid + 1;
}
# Do some checks on the text the user inserted
# We must do these tests here because we cannot trust the script input
chomp $text;
chomp $user;
$text =~ s/\|//g;
$user =~ s/\|//g;
# Ok let's format our record
my @localtime = localtime();
my @dateformat = ($localtime[3],$localtime[4] + 1,($localtime[5] + 1900)%100);
my $chatrow = $newid . '|' . $ENV{'REMOTE_ADDR'} . '|' . sprintf("%02d/%02d/%02d",$dateformat[$config{dateformat0}],$dateformat[$config{dateformat1}],$dateformat[$config{dateformat2}]) . '|' .
sprintf("%02d:%02d:%02d",$localtime[2],$localtime[1],$localtime[0]) . '|' .
$user . '|' . $text;
truncate(LASTIDFILE,0);
seek(LASTIDFILE, 0, 0);
print LASTIDFILE $newid;
seek($chatfile, 0, 2);
if( tell($chatfile) > 0 )
{
print $chatfile "\n";
}
print $chatfile $chatrow;
close($chatfile);
#END OF CRITICAL SECTION
close(LASTIDFILE);
print "OK";
这里是函数的 apc.js
function AJAXPerlChat()
{
// Config params
this.cgiDir = "/cgi-bin/apc/"; // Path to AJAX Perl Chat CGIs
this.documentDir = "/apc/"; // Path to AJAX Perl Chat JSs & HTMLs
///////////////////////////
this.ajax = false;
this.chatFrame = null;
this.lastMsgId = 0;
this.failedRequests = 0;
this.timeoutRequests = 0;
this.stick = true;
this.started = false;
this.resetted = false;
this.nickInput = null;
this.textInput = null;
this.adminLink = null;
this.refreshAJAXObj = null;
this.submitAJAXObj = null;
}
AJAXPerlChat.prototype.InstallAJAXObjects = function()
{
var self = this;
// The AJAX Objects
this.refreshAJAXObj = new AJAXObj();
this.submitAJAXObj = new AJAXObj();
// Data receive callback for refresh request
this.refreshAJAXObj.onReceiveResponse = function(status,statusText,responseText)
{
switch(status)
{
case 200:
self.failedRequests = 0;
self.timoeoutRequests = 0;
if(responseText == 'RESET')
{
self.Reset();
break;
}
else self.ReceiveChatData(responseText);
break;
default:
// We had some troubles
self.HandleFailedRequest();
break;
}
}
// Timeout callback for refresh request
this.refreshAJAXObj.onRequestTimeout = function()
{
// We had timeout
self.refreshAJAXObj.abort();
self.HandleTimeoutRequest();
}
if(this.refreshAJAXObj.CreateRequest())
this.ajax = true;
else
return;
// Data receive callback for submit request
this.submitAJAXObj.onReceiveResponse = function(status,statusText,responseText)
{
self.nickInput.disabled = false;
self.textInput.disabled = false;
if(status != 200)
{
// We had some troubles
self.HandleFailedRequest();
}
else
{
var splitresponse = responseText.split("|");
switch(splitresponse[0])
{
case "TEXTSIZE":
self.ReportError('Testo troppo lungo (o nullo)',4000);
break;
case "USERSIZE":
self.ReportError('Nickname troppo lungo (o nullo)',4000);
break;
case "HTMLUSER":
self.ReportError('Non è ammesso codice HTML nel nickname: "' + htmlentities(splitresponse[1],'ENT_NOQUOTES') + '"',4000);
break;
case "HTMLTEXT":
self.ReportError('Non è ammesso codice HTML nel testo: "' + htmlentities(splitresponse[1],'ENT_NOQUOTES') + '"',4000);
break;
case "BADUSER":
self.ReportError('Testo non ammesso nel nickname: "' + htmlentities(splitresponse[1],'ENT_NOQUOTES') + '"',4000);
break;
case "BADTEXT":
self.ReportError('Testo non ammesso nel messaggio: "' + htmlentities(splitresponse[1],'ENT_NOQUOTES') + '"',4000);
break;
case "OK":
self.textInput.value = "";
break;
}
// SEEMS NOT WORKING IN OPERA 9 AND IN FF3 the cursor caret hides if we had an error to report but the input focuses correctly
self.textInput.focus();
}
}
// Timeout callback for submit request
this.submitAJAXObj.onRequestTimeout = function()
{
// We had timeout
self.submitAJAXObj.abort();
self.HandleFailedRequest();
}
this.submitAJAXObj.onRequestAborted = function()
{
// Unlock controls to allow new submit
if( self.nickInput != undefined )
self.nickInput.disabled = false;
if( self.nickInput != undefined )
self.textInput.disabled = false;
}
if(this.submitAJAXObj.CreateRequest())
this.ajax = true;
else
return;
}
// This function can be overriden to install different handlers or to use different objects
AJAXPerlChat.prototype.InstallControls = function()
{
var self = this;
this.chatFrame = document.getElementById("apc_chatframe");
this.chatFrame.onscroll = function(event)
{
if(self.chatFrame.scrollTop == self.chatFrame.scrollHeight - self.chatFrame.clientHeight)
self.stick = true;
else
self.stick = false;
}
// Install handlers for chat controls
this.nickInput = document.getElementById("apc_nick");
this.textInput = document.getElementById("apc_text");
this.adminLink = document.getElementById("apc_adminlink");
this.nickInput.disabled = true;
this.textInput.disabled = true;
this.nickInput.onfocus = function(event) { if(self.nickInput.value == 'Nickname') self.nickInput.value = ''; }
this.nickInput.onblur = function(event) { if(self.nickInput.value == '') self.nickInput.value = 'Nickname'; }
this.nickInput.onkeydown = function(event) { if(event == undefined) event = window.event; if(event.keyCode && event.keyCode==13) self.textInput.focus(); }
this.textInput.onkeydown = function(event) { if(event == undefined) event = window.event; if(event.keyCode && event.keyCode==13) self.Submit(); }
this.adminLink.onclick = function(event)
{
open(self.documentDir + 'admin.html','AjaxPerlChatADMIN','width=620,height=600,status=yes,resizable=yes');
}
this.errorDiv = document.getElementById("apc_errordiv");
this.errorDiv.style.display = "none";
}
AJAXPerlChat.prototype.Start = function()
{
var self = this;
this.interval = setInterval(function(){self.Refresh();},1000);
this.started = true;
if( this.nickInput != undefined )
this.nickInput.disabled = false;
if( this.textInput != undefined )
this.textInput.disabled = false;
}
AJAXPerlChat.prototype.Stop = function()
{
if(this.interval)
clearInterval(this.interval);
if(this.overloadTimer)
clearTimeout(this.overloadTimer);
this.started = false;
if( this.nickInput != undefined )
this.nickInput.disabled = true;
if( this.textInput != undefined )
this.textInput.disabled = true;
}
AJAXPerlChat.prototype.Overload = function()
{
var self = this;
this.Stop();
this.ReportError('La chat è temporaneamente fuori uso. Attendere 10 secondi',10000);
this.overloadTimer = setTimeout(function(){ self.timeoutRequests = 0; self.Start();},10000);
}
AJAXPerlChat.prototype.Disconnection = function()
{
var self = this;
this.Stop();
this.ReportError('La chat è temporaneamente fuori uso. Attendere 30 secondi',30000);
this.overloadTimer = setTimeout(function(){ self.Reset(); self.Start();},30000);
}
AJAXPerlChat.prototype.Refresh = function()
{
if(!this.ajax || !this.started) return;
this.refreshAJAXObj.SendRequest(this.cgiDir + "refresh.cgi?lid=" + this.lastMsgId,null,950,false);
}
AJAXPerlChat.prototype.Reset = function()
{
this.resetted = true;
this.lastMsgId = 0;
this.failedRequests = 0;
this.timeoutRequests = 0;
}
AJAXPerlChat.prototype.ReceiveChatData = function(receivedText)
{
// Here we format the data
var lines = receivedText.split('\n');
var output = "";
for(var i = 0; i<lines.length;i++)
{
var elements = lines[i].split('|');
if(elements.length < 5) continue;
if(elements.length < 6) elements[5] = "";
//0:MSGID 1:IP 2:DATE 3:TIME 4:NICK 5:MESSAGE
elements[5] = htmlentities(elements[5],'ENT_NOQUOTES');
output += '<div class="apc_chatentrydiv"><table><tr><td class="apc_littledate">' + elements[2] + '<br />' + elements[3] + '</td><td class="apc_chatentry"><span class = "apc_chatentrynick">' + elements[4] + ':</span> <span class = "apc_chatentrytext">' + elements[5] + '</span></td></tr></table></div>';
this.lastMsgId = elements[0];
}
if(this.resetted)
{
this.resetted = false;
this.ClearChatData();
}
this.PushChatData(output);
}
AJAXPerlChat.prototype.PushChatData = function(formatted)
{
this.chatFrame.innerHTML += formatted;
if(this.chatFrame.scrollHeight > this.chatFrame.clientHeight && this.stick)
this.chatFrame.scrollTop = this.chatFrame.scrollHeight - this.chatFrame.clientHeight;
}
AJAXPerlChat.prototype.ClearChatData = function()
{
this.chatFrame.innerHTML = "";
}
AJAXPerlChat.prototype.ReportError = function(errorstring,timer)
{
var self = this;
if(this.errorDivTimer)
clearTimeout(this.errorDivTimer);
this.errorDiv.style.display = "";
this.errorDiv.innerHTML = errorstring;
this.errorDivTimer = setTimeout(function(){ self.errorDiv.style.display = "none";}, timer);
}
AJAXPerlChat.prototype.Submit = function()
{
if(!this.ajax) return;
if(!this.started) return;
username = encodeURIComponent(this.nickInput.value);
usertext = encodeURIComponent(this.textInput.value);
this.submitAJAXObj.SendRequest(this.cgiDir + "incoming.cgi?user=" + username + "&text=" + usertext,null,1500,false);
if( this.nickInput != undefined )
this.nickInput.disabled = true;
if( this.textInput != undefined )
this.textInput.disabled = true;
}
AJAXPerlChat.prototype.HandleFailedRequest = function()
{
this.failedRequests ++;
if(this.failedRequests > 5) this.Disconnection();
}
AJAXPerlChat.prototype.HandleTimeoutRequest = function()
{
this.timeoutRequests ++;
if(this.timeoutRequests > 5) this.Overload();
}
function htmlentities (string, quote_style) {
// http://kevin.vanzonneveld.net
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: nobbler
// + tweaked by: Jack
// + bugfixed by: Onno Marsman
// + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// - depends on: get_html_translation_table
// * example 1: htmlentities('Kevin & van Zonneveld');
// * returns 1: 'Kevin & van Zonneveld'
var histogram = {}, symbol = '', tmp_str = '', entity = '';
tmp_str = string.toString();
if (false === (histogram = get_html_translation_table('HTML_ENTITIES', quote_style))) {
return false;
}
for (symbol in histogram) {
entity = histogram[symbol];
tmp_str = tmp_str.split(symbol).join(entity);
}
return tmp_str;
}
function get_html_translation_table(table, quote_style) {
// http://kevin.vanzonneveld.net
// + original by: Philip Peterson
// + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: noname
// + bugfixed by: Alex
// + bugfixed by: Marco
// % note: It has been decided that we're not going to add global
// % note: dependencies to php.js. Meaning the constants are not
// % note: real constants, but strings instead. integers are also supported if someone
// % note: chooses to create the constants themselves.
// % note: Table from http://www.the-art-of-web.com/html/character-codes/
// * example 1: get_html_translation_table('HTML_SPECIALCHARS');
// * returns 1: {'"': '"', '&': '&', '<': '<', '>': '>'}
var entities = {}, histogram = {}, decimal = 0, symbol = '';
var constMappingTable = {}, constMappingQuoteStyle = {};
var useTable = {}, useQuoteStyle = {};
useTable = (table ? table.toUpperCase() : 'HTML_SPECIALCHARS');
useQuoteStyle = (quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT');
// Translate arguments
constMappingTable[0] = 'HTML_SPECIALCHARS';
constMappingTable[1] = 'HTML_ENTITIES';
constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
constMappingQuoteStyle[2] = 'ENT_COMPAT';
constMappingQuoteStyle[3] = 'ENT_QUOTES';
// Map numbers to strings for compatibilty with PHP constants
if (!isNaN(useTable)) {
useTable = constMappingTable[useTable];
}
if (!isNaN(useQuoteStyle)) {
useQuoteStyle = constMappingQuoteStyle[useQuoteStyle];
}
if (useQuoteStyle != 'ENT_NOQUOTES') {
entities['34'] = '"';
}
if (useQuoteStyle == 'ENT_QUOTES') {
entities['39'] = ''';
}
if (useTable == 'HTML_SPECIALCHARS') {
// ascii decimals for better compatibility
entities['38'] = '&';
entities['60'] = '<';
entities['62'] = '>';
} else if (useTable == 'HTML_ENTITIES') {
// ascii decimals for better compatibility
entities['38'] = '&';
entities['60'] = '<';
entities['62'] = '>';
entities['160'] = ' ';
entities['161'] = '¡';
entities['162'] = '¢';
entities['163'] = '£';
entities['164'] = '¤';
entities['165'] = '¥';
entities['166'] = '¦';
entities['167'] = '§';
entities['168'] = '¨';
entities['169'] = '©';
entities['170'] = 'ª';
entities['171'] = '«';
entities['172'] = '¬';
entities['173'] = '­';
entities['174'] = '®';
entities['175'] = '¯';
entities['176'] = '°';
entities['177'] = '±';
entities['178'] = '²';
entities['179'] = '³';
entities['180'] = '´';
entities['181'] = 'µ';
entities['182'] = '¶';
entities['183'] = '·';
entities['184'] = '¸';
entities['185'] = '¹';
entities['186'] = 'º';
entities['187'] = '»';
entities['188'] = '¼';
entities['189'] = '½';
entities['190'] = '¾';
entities['191'] = '¿';
entities['192'] = 'À';
entities['193'] = 'Á';
entities['194'] = 'Â';
entities['195'] = 'Ã';
entities['196'] = 'Ä';
entities['197'] = 'Å';
entities['198'] = 'Æ';
entities['199'] = 'Ç';
entities['200'] = 'È';
entities['201'] = 'É';
entities['202'] = 'Ê';
entities['203'] = 'Ë';
entities['204'] = 'Ì';
entities['205'] = 'Í';
entities['206'] = 'Î';
entities['207'] = 'Ï';
entities['208'] = 'Ð';
entities['209'] = 'Ñ';
entities['210'] = 'Ò';
entities['211'] = 'Ó';
entities['212'] = 'Ô';
entities['213'] = 'Õ';
entities['214'] = 'Ö';
entities['215'] = '×';
entities['216'] = 'Ø';
entities['217'] = 'Ù';
entities['218'] = 'Ú';
entities['219'] = 'Û';
entities['220'] = 'Ü';
entities['221'] = 'Ý';
entities['222'] = 'Þ';
entities['223'] = 'ß';
entities['224'] = 'à';
entities['225'] = 'á';
entities['226'] = 'â';
entities['227'] = 'ã';
entities['228'] = 'ä';
entities['229'] = 'å';
entities['230'] = 'æ';
entities['231'] = 'ç';
entities['232'] = 'è';
entities['233'] = 'é';
entities['234'] = 'ê';
entities['235'] = 'ë';
entities['236'] = 'ì';
entities['237'] = 'í';
entities['238'] = 'î';
entities['239'] = 'ï';
entities['240'] = 'ð';
entities['241'] = 'ñ';
entities['242'] = 'ò';
entities['243'] = 'ó';
entities['244'] = 'ô';
entities['245'] = 'õ';
entities['246'] = 'ö';
entities['247'] = '÷';
entities['248'] = 'ø';
entities['249'] = 'ù';
entities['250'] = 'ú';
entities['251'] = 'û';
entities['252'] = 'ü';
entities['253'] = 'ý';
entities['254'] = 'þ';
entities['255'] = 'ÿ';
} else {
throw Error("Table: "+useTable+' not supported');
return false;
}
// ascii decimals to real symbols
for (decimal in entities) {
symbol = String.fromCharCode(decimal);
histogram[symbol] = entities[decimal];
}
return histogram;
}
我已向传入.cgi 添加了一个提交按钮,以使用参数文本和用户发送
<input type="submit" value=" POST " name="apc_text">
当我尝试通过按钮发送(名称和文本)时,它失败并且(默认情况下)刷新整个页面,这需要很长时间才能响应,我正在尝试使提交按钮仅重新加载内部框架
我这里出了什么问题,为什么我的文字和名字没有出现抱歉话题太长而且英语不好
最佳答案
我承认我浏览了你的代码,而不是扫描它,但我确实注意到你禁用了文本输入,并在其上挂了一个按键事件。
您可能还需要一个单击事件处理程序,并且您可能希望从处理程序返回 false,以便表单不会提交到服务器。
关于jquery - ajax perl 聊天提交按钮发送参数并仅在框架内重新加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13960257/
所以我有这个 javascript 片段,它有两个按钮可以进入全屏,一个按钮可以退出全屏。我想做到这一点,如果我不在全屏模式下,按钮会显示转到全屏模式,而当我处于全屏模式时,按钮会显示退出全屏模式..
我在自定义控件中添加了一个新属性作为可扩展属性,例如属性网格中的字体属性。在 Windows 窗体应用程序项目中使用我的自定义控件后,我在属性网格中看到一个省略号 (…) 按钮,如字体属性的“…”按钮
我在自定义控件中添加了一个新属性作为可扩展属性,例如属性网格中的字体属性。在 Windows 窗体应用程序项目中使用我的自定义控件后,我在属性网格中看到一个省略号 (…) 按钮,如字体属性的“…”按钮
我尝试将 Twitter 上的“Tweet Me”按钮 ( http://twitter.com/goodies/tweetbutton ) 添加到我的网站。然而,每当按下按钮时,我都会收到此 Jav
我试图在我的文本区域中获取一个按钮值,如果我使用 则工作正常但如果我使用那么它就不起作用了。你能找出问题所在吗? HTML 1 2 3 4 JavaScript $(document).read
我的 C# Winform 面板中有一堆文本框。每行文本框的命名如下: tb1 tbNickName1 comboBox1 tb2 tbNickName2 comboBox2 tb3 tbNickNa
我有一个表单,其中过滤器下方有按钮(应用过滤器和清除过滤器),我试图在单击“应用”按钮时显示“清除”,并在单击“清除”按钮时隐藏“清除”按钮。 下面的代码(如果我的表有的话):
excel 按钮正在工作,但是当我添加 pdf 按钮时,它添加仅显示 pdf 按钮 excel 按钮在 pdf 按钮添加后隐藏 $(document).ready(function() { $
我想创建一个 div 作为标题并分成 3 列,并按以下顺序在其中放置 2 个按钮和一个标题:Button1(左位) Title(居中) Button2(右位) 这是我为这个 div 编写的代码:
仅当选中所有框时才应禁用“允许”按钮。我该怎么做?我已经完成了 HTML 部分,如下所示。如何执行其中的逻辑部分?即使未选中一个复选框,也应禁用“允许”按钮
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
如您所知,您可以使用 2 种方法在 HTML5 中呈现按钮: 使用 void 元素 或 如果您需要内容,请使用 元素(不是空元素)。 在JSF2中,有2种方式生成按钮;与UICommand或 UIOu
我尝试根据表单元素的更改禁用/启用保存按钮。但是,当通过弹出按钮选择更改隐藏输入字段值时,保存按钮不受影响。 下面是我的代码。我正在尝试序列化旧的表单值并与更改后的表单值进行比较。但我猜隐藏的字段值无
我有用于在消息(电子邮件、短信)上输入内容的 EditText。我希望在单击 ActionDone 按钮时立即发布消息。我为此使用以下代码: message.setOnEditorActionList
我的 Android 应用程序中有一堆 EditText,每个都将 InputMethod 设置为 numberSigned。我的目标设备没有硬件键盘,而是使用软件键盘输入数字。 Android 将输
我无法以编程方式隐藏弧形菜单中的 fab 按钮。我正在使用https://github.com/saurabharora90/MaterialArcMenu在我的代码中。如何在Java中以编程方式隐藏
我已经看到这在其他类型的对话框窗口中是可能的,例如“showConfirmDialog”,其中可以指定按钮的数量及其名称;但是使用“showInputDialog”时是否可以实现相同的功能?我似乎无法
相同的按钮用于激活和停用。第一次,当代码运行按钮单击并成功“停用”时。但第二次,代码无法找到该元素。第一个案例按钮位于第二个“a”标签中,然后停用第一个“a”标签中的按钮。 案例1: Edit
是否可以将按钮的 onclick 操作设置为 JavaScript 变量?这个想法是我们用 JavaScript 控制一个表。每当点击该表的一行时,我们就会更新一个 JavaScript 变量。该 v
我想创建一个按钮,它包含左侧的文本和右侧的复选框(或任何其他组件)。我怎样才能做到这一点? 我发现我可以制作自己的 View extends Button,但是如果可以的话我应该如何实现 onDraw
我是一名优秀的程序员,十分优秀!