How to open a url using javascript and set custom

2019-02-23 09:29发布

I want to redirect a user to a url through javascript after they click on a link. Now is there any way to send custom http headers along with this request. I want to send a particular cookie value with the request headers.

The url in question does not belong to my domain.

Is it possible to do it? If yes, how?

1条回答
Melony?
2楼-- · 2019-02-23 10:17

No.

You can set custom headers if you are using XMLHttpRequest (although it might ban you from setting a Cookie header), but not otherwise (and a redirect is otherwise).

查看更多
登录 后发表回答