51Job自动收藏职位

javascript代码如:(现在只限于两个条件java+上海,可自己更改内容.将代码放到html文件中,在IE中运行就可以)!!!切记先登录,在同一个浏览器里(用EditPlus),一定要先登录51Job,让内存中产生一个cookice,在服务器上产生相应的session才行。不然报错. 大家有什么问题请留言

<html>

<head>

<title> 51job </title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/Base.js?20101126"></script>

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/Base.ZzLayer.js?20101126"></script>

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/Base.ZzLayer.ExtZzLayer.js?20101126"></script>

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/search/Base.Search.js?20100407"></script>

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/payservice/GetCompetition.js?20100604"></script>

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/my/My_SMS_Self.js?20100421"></script>

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/fans.js?20101126"></script>

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/cv/CV_QuickApply.js?20100726"></script>

 

 

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/jQuery.js"></script>

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/JsBase.js"></script>

<script language="javascript" src="http://js.51jobcdn.com/in/js/2009/login.js"></script>

<script type="text/javascript">

var xmlrequest=null;

function createXMLHttpRequest()

{if(window.XMLHttpRequest){xmlrequest=new XMLHttpRequest();}

else if(window.ActiveXObject){try{xmlrequest=new ActiveXObject("Msxml2.XMLHTTP");

}catch(e){try{xmlrequest=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}} }

 

 

function submit51()

{

createXMLHttpRequest();

var username=document.getElementById("username").value;

var userpwd=document.getElementById("userpwd").value;

var url="http://my.51job.com/my/My_Pmc.php?username="+username+"&userpwd="+userpwd;

 

xmlrequest.open("get",url,true);

xmlrequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

xmlrequest.onreadystatechange=search51;

xmlrequest.send(null);

}

 

function search51()

{

if (xmlrequest.readyState==4)

{

if(xmlrequest.status==200)

{

for(var i=1;i<20;i++)

{

var url="http://search.51job.com/jobsearch/search_result.php?fromJs=1&jobarea=0200&district=0000&funtype=0000&industrytype=00&issuedate=9&providesalary=99&keyword=java&keywordtype=2&curr_page="+i+"&lang=c&stype=2&postchannel=0000&workyear=99&cotype=99&degreefrom=99&jobterm=01&lonlat=0,0&radius=-1&ord_field=0&list_type=0&fromType=14";

 

search51pg(url);

}

}

}

}

 

function search51pg(url)

{

createXMLHttpRequest();

xmlrequest.open("get",url,true);

xmlrequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

xmlrequest.onreadystatechange=search51back;

xmlrequest.send(null);

}

 

 

function search51back()

{

if (xmlrequest.readyState==4)

{

if(xmlrequest.status==200)

{

str = xmlrequest.responseText;

var ary = str.split("http://search.51job.com/job/");

for(var i=1;i<ary.length;i++)

{

//var url="http://search.51job.com/job/"+ary[i].split(",")[0]+",c.html";

//alert(url);

 

zzSearch.saveJobClk( ary[i].split(",")[0] , event );

}

 

}

}

}

 

</script>

 

</head>

 

<body>

 

<table>

<tr>

<td align="right">username:</td>

<td><input name="username" type="text" id="username" value="" class="input140" style="color:#000;" /></td>

</tr>

<tr>

<td align="right">userpwd:</td>

<td><input name="userpwd" type="password" id="userpwd" value="" class="input140" style="color:#000;" /></td>

</tr>

<tr>

<td align="right" colspan=1><input type="button" onclick="submit51()" value="login" /></td>

</tr>

</table>

 

 

<script language="JavaScript" type="text/javascript">

var obj1;

var sUrl = 'http://my.51job.com' + '/payservice/fans/fans_ajax.php?jsoncallback=?';

var coidArr = document.getElementsByName('coid');

var fansnum = document.getElementById('fansnum');

if(fansnum){

obj1 = $("#fansnum");

}else if(coidArr[0]){

obj1 = $("#" + coidArr[0].value);

}

var obj2 = $("#message");

if(obj1){

var offset = obj1.offset();

document.getElementById('message').style.top = offset.top - obj2.height() / 2 + obj1.height() / 5 + 'px';

document.getElementById('message').style.left = offset.left - obj2.width() + 'px';

}

for(var i = 0;i < coidArr.length; i++){

if(coidArr[i].value){

var flg = 0;

for(var j = 0;j < i; j++){

if(coidArr[j].value && coidArr[i].value == coidArr[j].value){

flg = 1;

break;

}

}

if(flg == 0){

$.getJSON(sUrl, {type:'0',coid:coidArr[i].value,step:i}, function (data){

var fansnum1 = document.getElementById(coidArr[data.index].value);

if(fansnum){

fansnum.innerHTML = data.searchData;

}

if(fansnum1){

fansnum1.innerHTML = data.searchData;

}

if(data.compfans != "1" && document.getElementById('message').style.display == 'none'){

document.getElementById('message').style.display = 'block';

}

});

}

}

}

</script>

<script language="javascript">

<!--

window.cfg = {

fileName: 'show_job_detail.php' ,

lang : 'c' ,

stype : '' ,

fullLang : 'Chinese' ,

langs : {

sqzwml : 'applyjob' ,

qzzwqdg : '请在要选择的职位前打勾!' ,

myml : 'my' ,

ts_qxjzw : '请选择职位' ,

queren : '确认' ,

guanbi : '关闭' ,

nzdnxj : '您最多能选择' ,

xiang : '项' ,

xzdq : '选择地区' ,

xj_xg : '选择/修改' ,

zycs : '主要城市' ,

sysf : '所有省份' ,

buxian : '不限' ,

qingxj : '请选择' ,

yixuan : '已选' ,

znlb : '职能类别' ,

hylb : '行业类别' ,

gzdd : '工作地点' ,

quanbu : '全部' ,

zhineng : '职能' ,

hangye : '行业' ,

didian : '地点' ,

qsrgjz : '请输入关键字' ,

srpcgjz : '输入排除关键字'

} ,

url : {

root : 'http://search.51job.com/jobsearch' ,

image : 'http://img01.51jobcdn.com/im/2009' ,

image_search : 'http://img01.51jobcdn.com/im/2009/search' ,

image_search_lang : 'http://img01.51jobcdn.com/im/2009/search/c' ,

image_search_c : 'http://img01.51jobcdn.com/im/2009/search/c' ,

image_search_e : 'http://img01.51jobcdn.com/im/2009/search/e'

} ,

domain : {

my : 'http://my.51job.com' ,

search : 'http://search.51job.com'

} ,

isJobview : '1' ,

isAcStatRecJob : '1' ,

acStatRecJobType : '0803111457'

};

 

function searchInit() {

if ( window.Search ) {

clearInterval( intVal );

window.zzSearch = new Search( {

searchForm : document.searchForm ,

pageForm : document.pageForm ,

excludeForm : document.excludeForm ,

pageJumpForm : document.pageJumpForm ,

selJobPageForm : document.selJobPageForm ,

cfg : cfg

} );

}

}

var intVal = window.setInterval( searchInit , 50 );

//-->

</script>

</body>

 

</html>

 

你可能感兴趣的:(job)