博客 (63)

如何避免别人把你的网页放在框架中 <script>
<!--
    if (top.location != self.location) {top.location=self.location;}
//-->
</script>
针对上述屏蔽,有以下解决方法:
<script>
<!--
    var location="";
//-->
</script>

 


连续的英文或者一堆感叹号!!!不会自动换行的问题
只要在CSS中定义了如下句子,可保网页不会再被撑开了

table{table-layout: fixed;}
td{word-break: break-all; word-wrap:break-word;}

注释一下:

1.第一条table{table-layout: fixed;},此样式可以让表格中有!!!(感叹号)之类的字符时自动换行。

2.td{word-break: break-all},一般用这句这OK了,但在有些特殊情况下还是会撑开,因此需要再加上后面一句{word-wrap:break-word;}就可以解决。此样式可以让表格中的一些连续的英文单词自动换行。

xoyozo 18 年前
3,974

javascript:return confirm('你确认要删除吗?')


if(confirm('你确认要删除吗?')) {

    // 确定

} else {

    // 取消

}

xoyozo 18 年前
4,303
public static bool loadRss(string RssUrl, int RssCount)
{
bool ok = true;
XmlDocument doc = new XmlDocument();
if (RssUrl != "")
{
try
{
doc.Load(RssUrl);
XmlNodeList nodelist = doc.GetElementsByTagName("item");
XmlNodeList objItems1;

int i = 0;
int count = 0;

if (doc.HasChildNodes)
{
foreach (XmlNode node in nodelist)
{
string title = "";
string link = "";
string description = "";
string pubDate = "";
i += 1;
if (node.HasChildNodes)
{
objItems1 = node.ChildNodes;
foreach (XmlNode node1 in objItems1)
{
switch (node1.Name)
{
case "title":
title = node1.InnerText;
break;
case "link":
link = node1.InnerText;
break;
case "description":
description = node1.InnerText;
break;
case "pubDate":
pubDate = node1.InnerText;
break;
default: break;
}
}
}
if (i > RssCount)
{
break;
}
}
}
}
catch (Exception ex)
{
ok = false;
}
}

return ok;
}
xoyozo 18 年前
5,204