convert php to jquery or js

convert php to jquery or js

hi all
i want to convert this code to js or jquery

<?php $Q = $_GET['jamal']; function hexToStr($hex){ $string=''; for ($i=0; $i < strlen($hex)-1; $i+=2){ $string .= chr(hexdec($hex[$i].$hex[$i+1])); } return $string; } header('location:'.hexToStr($Q)); exit; ?>