Archive for category Website

[转]css模拟title和alt的提示效果

  1. <style type="text/CSS">
  2. div#nifty{margin:0;background:#9BD1FA;font-size:12px;}
  3. p {padding:0 5px;margin:0;}
  4. div.rtop {display:block;background:#fff}
  5. div.rtop div {display:block;height:1px;overflow:hidden;background:#9BD1FA}
  6. div.r1{margin:0 3px}
  7. div.r2{margin:0 2px}
  8. div.r3{margin:0 1px}
  9. div.rtop div.r4 {margin:0 1px;height:1px}
  10. </style>
  11. <div id="nifty">
  12. <div class="rtop">
  13. <div class="r1"></div>
  14. <div class="r2"></div>
  15. <div class="r3"></div>
  16. <div class="r4"></div>
  17. </div>
  18. <p>div + CSS 圆角矩形--From <a href="http://www.achome.cn">www.achome.cn</a></p>
  19. <div class="rtop">
  20. <div class="r4"></div>
  21. <div class="r3"></div>
  22. <div class="r2"></div>
  23. <div class="r1"></div>
  24. </div>
  25. </div>

Tags:

正确截取中文字符长度的len及left函数

vbs中自带的len及left函数无法对中文字符长度进行正确的截取,可使用下2函数替代。

  1. <%
  2. Function Strleft(Str,L)
  3. Temp_Str=Len(Str)
  4. For I=1 To Temp_Str
  5. Test_Str=(Mid(Str,I,1))
  6. Strleft=Strleft&Test_Str
  7. If Asc(Test_Str)>0 Then
  8. lens=lens+1
  9. Else
  10. lens=lens+2
  11. End If
  12. If lens>=L Then Exit For
  13. Next
  14. End Function
  15.  
  16. function strLength(str)
  17. ON ERROR RESUME NEXT
  18. dim WINNT_CHINESE
  19. WINNT_CHINESE = (len("中国")=2)
  20. if WINNT_CHINESE then
  21. dim l,t,c
  22. dim i
  23. l=len(str)
  24. t=l
  25. for i=1 to l
  26. c=asc(mid(str,i,1))
  27. if c<0 then c=c+65536
  28. if c>255 then
  29. t=t+1
  30. end if
  31. next
  32. strLength=t
  33. else
  34. strLength=len(str)
  35. end if
  36. if err.number<>0 then err.clear
  37. end function
  38. %>

Tags:

禁止页面操作

如何禁止打印页面

解决思路:

要真正禁止打印页面是办不到的,但是如果能设置让用户打印到的是空白,也算是实现禁止打印的目的了。
具体步骤:
代码示例:

  1. <html>
  2. <head><title>不可打印的页面</title>
  3. <style>
  4. @media print{
  5. body{display:none}
  6. }
  7. </style>
  8. </head>
  9. <body>
  10. 文档主要内容
  11. </body>
  12. </head>

注意:@media print{}规则中所定义的CSS仅对打印时的页面生效。
技巧:在很多论坛中在打印帖子时都是用一个专门的页面来实现,如果能熟练运用@media print{}规则,就不用单独做一个打印用的页了。
提示:
@media print{}规则中可以用来代码print的还有all和screen。
类似@media的规则如表2.2.1所示。

规则说明
@import指定导入的外部样式表及目标媒体。该规则必须在样式表头部最先声明
@charset在外部样式表文件内使用。指定该样式表使用的字符集。
@font-face设置嵌入HTML文档的OpenType字体(需IE5+支持)
@media指定样式表规则用于指定的媒体类型(需IE5.5+支持)

特别提示
运行本例代码,然后打印网页,打印结果将不包括”文档主要内容”。

特别说明

本例主要运用了@media规则来定义页面对于打印时应用的样式,print意思是所定义的CSS应用于打印机,类似的print媒体类型还有:
all 应用于所有类型的设备
screen 应用于计算机的显示器

禁止选取,禁止右键,禁止拷贝

  1. <BODY onselectstart="return false" oncopy="return false;" oncut="return false;" oncontextmenu="window.event.returnValue=false" >

1.oncontextmenu=”window.event.returnValue=false” 将彻底屏蔽鼠标右键
2.onselectstart=”return false” 取消选取、防止复制
3.onpaste=”return false” 不准粘贴
4.oncopy=”return false;” oncut=”return false;” 防止复制

禁止Ctrl+P

  1. <!--
  2. function fKey(){
  3. var keycode = event.keyCode;
  4. if(event.ctrlKey && keycode == 80){
  5. alert("此功能已禁止.");
  6. return false;
  7. }
  8. }
  9. //-->
  10. </script>

body中添加 onkeydown=”return fKey();”

Tags:

access的demo及w2k的form

access的demo字段限值65k,windows 2k的form每个域的大小限制为100k…………

解决" 超大文本提交的处理"的方法

65k的限制的话,只能换mssql了…………

PRB: Error \"Request Object, ASP 0107 (0×80004005)\" When You Post a Form

The information in this article applies to:

Microsoft Active Server Pages

This article was previously published under Q273482

SYMPTOMS

When you post a large form field, you may receive the following error message:

Error Type:

Request object, ASP 0107 (0×80004005)

The data being processed is over the allowed limit.

In Microsoft Internet Information Server (IIS) 4.0, you may receive the following error message:

Request object error \'ASP 0107 : 80004005\'

Stack Overflow

/projectname/page.asp, line XX

The data being processed is over the allowed limit.

CAUSE

The size limit of each form field that is retrieved in the Request object is 102,399 bytes. The error occurs when you exceed this limit.

RESOLUTION

To resolve this problem, use one of the following methods:

Instead of reading form variable values with the Request.Form collection, use Request.BinaryRead (Request.TotalBytes), and parse the form values from the output of Request.BinaryRead.

Use a File Upload scheme, such as Microsoft Posting Acceptor.

Break the HTML form variables into multiple form variables before you submit the form. The 102,399 byte limit is for each form variable, so you can have multiple form variables of 102,399 characters or less. The following sample code illustrates this: WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code \"as is\" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

程序代码 程序代码

<FORM method=post action=LargePost.asp name=theForm onsubmit=\"BreakItUp()\">

<Textarea rows=3 cols=100 name=BigTextArea>A bunch of text…</Textarea>

<input type=submit value=go>

</form>



<SCRIPT Language=JavaScript>

function BreakItUp()

{

//Set the limit for field size.

var FormLimit = 102399



//Get the value of the large input object.

var TempVar = new String

TempVar = document.theForm.BigTextArea.value



//If the length of the object is greater than the limit, break it

//into multiple objects.

if (TempVar.length > FormLimit)

{

document.theForm.BigTextArea.value = TempVar.substr(0, FormLimit)

TempVar = TempVar.substr(FormLimit)



while (TempVar.length > 0)

{

var objTEXTAREA = document.createElement(\"TEXTAREA\")

objTEXTAREA.name = \"BigTextArea\"

objTEXTAREA.value = TempVar.substr(0, FormLimit)

document.theForm.appendChild(objTEXTAREA)



TempVar = TempVar.substr(FormLimit)

}

}

}

</SCRIPT>



The receiving Active Server Page (ASP) page reconstructs the variable:

<%

Dim BigTextArea



For I = 1 To Request.Form(\"BigTextArea\").Count

BigTextArea = BigTextArea & Request.Form(\"BigTextArea\")(I)

Next

%>

—–

Tags:

用CSS实现圆角

  1. <style type="text/CSS">
  2. div#nifty{margin:0;background:#9BD1FA;font-size:12px;}
  3. p {padding:0 5px;margin:0;}
  4. div.rtop {display:block;background:#fff}
  5. div.rtop div {display:block;height:1px;overflow:hidden;background:#9BD1FA}
  6. div.r1{margin:0 3px}
  7. div.r2{margin:0 2px}
  8. div.r3{margin:0 1px}
  9. div.rtop div.r4 {margin:0 1px;height:1px}
  10. </style>
  11. <div id="nifty">
  12. <div class="rtop">
  13. <div class="r1"></div>
  14. <div class="r2"></div>
  15. <div class="r3"></div>
  16. <div class="r4"></div>
  17. </div>
  18. <p>div + CSS 圆角矩形--From <a href="http://www.achome.cn">www.achome.cn</a></p>
  19. <div class="rtop">
  20. <div class="r4"></div>
  21. <div class="r3"></div>
  22. <div class="r2"></div>
  23. <div class="r1"></div>
  24. </div>
  25. </div>

Tags: