在一个项目上工作,其中一个网页将显示一个人员列表(具体来说,还有一个尚未找到的毕业班人员列表).我不想手动更新表格中的这些列表,这是一种骨干的Web 1.0方式,我想提取名称的提交列表,将它们转换为简单的.txt列表,然后在网页上显示该列表.
到目前为止,执行此操作的简单方法是使用iframe元素...唯一的事情是,我不能(或不知道如何)将任何文本样式应用于iframe的内容.我已经发布了一个我能够在这里完成的示例:http://dongarber.com/test//helpus-iframetest.html
默认字体是快递,客户端可能不会太热衷于它.有没有更好的方法来做到这一点,那不需要ASP.NET或数据库?
#list p {
font: arial;
font-size: 14px;
}
...
<p>Help us locate all of our classmates from the High School class of 1961. If you know where they live or their e-mail addresses contact the Reunion Committee.</p>
<p> </p>
<div id="list"><p><iframe src="missingmen.txt" width=200 height=400 frameborder=0 ></iframe></p></div>
</div>
Run Code Online (Sandbox Code Playgroud) 这是一个非常基本的问题,如果我正在考虑做的事情很复杂/涉及,那么我不希望你详细说明......我读过这可能涉及结构或哈希或其他一些可怕的程序我还没到.如果是这样,我相信它会很快得到我.
学习类,方法和返回值.
我想让我的班级/方法返回当前小时和分钟.很简单,真的.这是正确构造还是正确构造?
class MyClass
{
public int GetHour (int hr, int min)
{
DateTime dt = DateTime.Now;
int hour = dt.Hour;
int minute = dt.Minute;
return hour;
return minute;
}
}
Run Code Online (Sandbox Code Playgroud)
并且,从Main()以下方面调用它:获得一些错误(No overload for method和Unreachable code detected)
static void Main ( string[] args )
{
MyClass mc = new MyClass ();
Console.WriteLine ("Hour: {0} \n Minute: {1}", mc.GetHour());
Console.ReadLine ();
}
Run Code Online (Sandbox Code Playgroud)
问题是:我关闭了吗?
常规文本字段,用户输入字符串.测试a)输入中是否有东西,b)输入中没有空格,c)只是整数,没有其他字符.然后是提交按钮.你会注意到我没有使用html行为,输入中没有onclick,严格的内容/表示/行为分离.
我的HTML:
<form name="basicText" id="basicText" action="">
<p>Enter any ol' integer:
<input type="text" id="inputBox" name="inputBox" size="14"/>
<input value = "Next...?" type="submit" id="mySubmitBtn" name="mySubmitBtn"/>
</p>
</form>
<script src="js/w1bscript.js" type="text/javascript"></script>
Run Code Online (Sandbox Code Playgroud)
另请注意,外部javascript文件在末尾添加,因此所有元素都可以加载(现在不用担心onload).
JavaScript:
var myButton1 = document.getElementById("mySubmitBtn");
var myForm1 = document.getElementById("basicText");
var myTextBox = myForm1.inputBox;
function submitPress() {
if(myTextBox.value.length == 0) {
alert("You didn't enter anything! Once more time, with feeling...")
basicText.focus();
basicText.select();
} else if(/\s/.test(myTextBox.value)) {
alert("Eh... No spaces. Just integers. Try again...");
basicText.focus();
basicText.select();
} else if (isNaN(myTextBox.value)==true) {
alert("Eh... Gonna need …Run Code Online (Sandbox Code Playgroud)