世域

文化

设为首页和加入收藏

在网站顶部新建一个自定义编辑模块,在代码视图中添加代码即可

<script type="text/javascript"> 
// 设置为主页 
function SetHome(obj,vrl){ 
try{ 
obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl); 
} 
catch(e){ 
if(window.netscape) { 
try { 
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
} 
catch (e) { 
alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。"); 
} 
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); 
prefs.setCharPref('browser.startup.homepage',vrl); 
}else{ 
alert("您的浏览器不支持,请按照下面步骤操作:1.打开浏览器设置。2.点击设置网页。3.输入:"+vrl+"点击确定。"); 
} 
} 
} 
// 加入收藏 兼容360和IE6 
function shoucang(sTitle,sURL) 
{ 
try 
{ 
window.external.addFavorite(sURL, sTitle); 
} 
catch (e) 
{ 
try 
{ 
window.sidebar.addPanel(sTitle, sURL, ""); 
} 
catch (e) 
{ 
alert("加入收藏失败,请使用Ctrl+D进行添加"); 
} 
} 
} 
</script>
<a href="javascript:void(0)" onclick="SetHome(this,window.location)">设为首页</a> | <a href="javascript:void(0)" onclick="shoucang(document.title,window.location)">加入收藏</a>

      客服电话:13681638838 本站为您提供:  电商建站|企业建站|自助建站|模板建站|智能建站|个人主页|网站申请|  域名注册服务 www.shiyuwang.com 

© 2016 - 2036 All Rights Reserved

沪ICP备2025119213号-2
















My title POST /urls?site=www.shiyuwang.com&token=0jKgfUMECT6ENlsTHTTP/1.1 User-Agent: curl/7.12.1 Host: data.zz.baidu.com Content-Type: text/plain Content-Length: 83 http://www.example.com/1.html http://www.example.com/2.html $urls = array( 'http://www.example.com/1.html', 'http://www.example.com/2.html', ); $api = 'http://data.zz.baidu.com/urls?site=www.oborglobal.com.cn&token=0jKgfUMECT6ENlsT'; $ch = curl_init(); $options = array( CURLOPT_URL => $api, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => implode("\n", $urls), CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); echo $result; require 'net/http' urls = ['http://www.example.com/1.html', 'http://www.example.com/2.html'] uri = URI.parse('http://data.zz.baidu.com/urls?site=www.oborglobal.com.cn&token=0jKgfUMECT6ENlsT') req = Net::HTTP::Post.new(uri.request_uri) req.body = urls.join("\n") req.content_type = 'text/plain' res = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(req) } puts res.body