R
Join ServerReactiflux
help-js
✅ – drilkmops – 23-31 Apr 12
bro ive been doing js for like 6 years and I have never done this before. I make a POST request and get something like the response below. How do I fire that JS..?
<!DOCTYPE html>
<html>
<body>
<script>
var redirectUrl = "https://www.example.com";
var anchor = encodeURIComponent(window.location.hash);
if (anchor.length > 0) {
redirectUrl = redirectUrl.replace("", anchor);
}
window.location = redirectUrl;
</script>
</body>
</html>
Looks like I can use
eval()
or new Function
and pass in the things in the script tag. Neat!