a.html:
a.html
<script language="javascript">
function a(){
document.cookie="aaa1111";
//alert(document.cookie);
//window.location.href("b.html");
top.window.location = 'b.html';
}
</script>
<div>
<input type="button" onclick="a()" value="转到b.html" />
</div>