针对“微博关注”无法嵌入在Visualforce Page的解决方案

来源:互联网 发布:java 日期选择控件 编辑:程序博客网 时间:2024/05/01 06:15
1.将以下代码,保存为一个heml页面:
  1. <HTML><HEAD><TITLE> 加密/解密HTML源代码</TITLE>
  2. <META content="text/HTML; charset=gb2312" http-equiv=Content-Type>
  3. <META content="script,windows" name=keywords>
  4. <STYLE>.tablinks A {COLOR: blue}
  5. .tablinks A:visited { COLOR: blue}
  6. .tablinks A:hover {COLOR: brown}
  7. input{ font-family: Tahoma; font-size: 9pt; color: #000080 }
  8. body,textarea{ font-family: Tahoma; font-size: 9pt; color: blue}
  9. </STYLE>
  10. </HEAD>
  11. <BODY bgColor=#D6D3CE leftMargin=0  marginwidth="0" scroll=no oncontextmenu="self.event.returnValue=false">
  12. <div align="center">
  13.   <center>
  14. <TABLE border=0 cellPadding=0 cellSpacing=0 width="600">  
  15.   <TBODY>  
  16.   <TR>  
  17.     <TD align=left vAlign=top>  
  18.       <div align="center" style="width: 598; height: 42">
  19.         <div align="center">
  20.           <font color="#0066ff">加密页面源代码脚本
  21.       

  22.         <p><font color="#800000">将 你 的 页 面 源 代 码 粘 贴 在 下 面 的 框 内</p>
  23.      

  24.       <P align=center> </P>   
  25.       <P align=left><!--webbot bot="HTMLMarkup" startspan -->   
  26.       <SCRIPT language=JavaScript>   
  27. var i=0;   
  28. var ie=(document.all)?1:0;   
  29. var ns=(document.layers)?1:0;   
  30.    
  31. function generate() /* Generation of "Compilation" */   
  32. {   
  33.   code = document.pad.text.value;   
  34.   if (code)   
  35.    {   
  36.     document.pad.text.value='正在加密中...请等待!';   
  37.     setTimeout("compile()",1000);   
  38.    }   
  39.   else alert('提醒:还没有放入要加密的网页代码!')   
  40. }   
  41. function compile() /* The "Compilation" */   
  42. {   
  43.   document.pad.text.value='';   
  44.   compilation=escape(code);   
  45.   document.pad.text.value="<script>\n<!--\ndocument.write(unescape(\""+compilation+"\"));\n//-->\n<\/script>";   
  46.   i++;   
  47.   alert("已将所选内容加密成功!请点预览查看效果!");   
  48. }   
  49. function selectCode() /* Selecting "Compilation" for Copying */   
  50. {   
  51.   if(document.pad.text.value.length>0)   
  52.    {   
  53.     document.pad.text.focus();   
  54.     document.pad.text.select();   
  55.    }   
  56.   else alert('提醒:没有任何内容可以选定!')   
  57. }   
  58. function preview() /* Preview for the "Compilation" */   
  59. {   
  60.   if(document.pad.text.value.length>0)   
  61.    {   
  62.     pr=window.open("","Preview","scrollbars=1,menubar=1,status=1,width=700,height=320,left=50,top=110");   
  63.     pr.document.write(document.pad.text.value);   
  64.    }   
  65.   else alert('提醒:没有任何内容可以预览!')   
  66. }   
  67. function uncompile() /* Decompiling

  68. a "Compilation" */   
  69. {   
  70.   if (document.pad.text.value.length>0)   
  71.    {   
  72.     source=unescape(document.pad.text.value);   
  73.     document.pad.text.value=""+source+"";   
  74.    }   
  75.   else alert('提醒:请把你需要解密的代码放到此处!')   
  76. }   
  77. // -->   
  78. </SCRIPT>   
  79.    
  80.       <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">   
  81.         <TBODY>   
  82.         <TR>   
  83.           <TD width="100%"><!-- Compilation Panel -->   
  84.             <FORM method=post name=pad align="center"><TEXTAREA cols=58 name=text rows=11 style="BACKGROUND-COLOR: #f0f0f0;width=100%"></TEXTAREA>
  85. <p align="center"><INPUT name=compileIt onclick=generate()  type=button value=加密>   
  86. <INPUT name=select onclick=selectCode()  type=button value=选定>   
  87. <INPUT name=view onclick=preview()  type=button value=预览>   
  88. <INPUT name=retur onclick=uncompile()  type=button value=解密>   
  89. <INPUT name=clear type=reset value=清除>   
  90.             </FORM><!-- Compilation Panel --></TD></TR></TBODY></TABLE><!--webbot bot="HTMLMarkup" endspan --></P>  
  91.   </table>
  92.   </center>

  93. </body>
  94. </HTML>
复制代码


2.获取 微博按钮的代码
http://open.weibo.com/widget/followbutton.php


最后你会得到一个,如下的代码(UID不同)。
<wb:follow-button uid="2991975565" type="red_1" width="67" height="24" ></wb:follow-button>

在将代码嵌入vf的时候,会报错,因为不允许<vb:follow-button> 这样的命名空间的语法。

然后使用刚才的HTML编码以下。

详见:http://www.hxdev.cn/thread-3488-1-4.html

原创粉丝点击