I have fiddled for ages with escaping special characters and not, and doing this and that. I've exhausted the best part of a couple of hours and I need a fresh pair of eyes! What am I doing wrong?
Updated.
echo <<<EOT
<script type="text/javascript">
$( document ).ready( function () {
var w = window.open("{$address} result", "#", "width=800,height=600");
var d = w.document.open();
d.write("<!DOCTYPE html>
<html>
<head>
<title>{$address} result</title>
<link rel="stylesheet" href="css/base.css" type="text/css" />
</head>
<body>
<code>
Request method: {$request_method}
{$address}?{$qry_cfg}&{$man_qry}
$result
</code>
</body>
</html>");
d.close();
});
</script>
EOT;
I'm getting an Uncaught SyntaxError: Unexpected token ILLEGAL
on line 15
which is where the d.write
begins. This answer may help me but I'm having no luck thus far.
OUPUT:
<script type="text/javascript">
$( document ).ready( function () {
var w = window.open("https://api.classmarker.com/v1/groups/recent_results.json result", "#", "width=800,height=600");
var d = w.document.open();
d.write("<!DOCTYPE html>
<html>
<head>
<title>https://api.classmarker.com/v1/groups/recent_results.json result</title>
<link rel="stylesheet" href="css/base.css" type="text/css" />
</head>
<body>
<code>
Request method: 0
https://api.classmarker.com/v1/groups/recent_results.json?api_key=d4tsE7SvEgzAKlJPFrlvAz3oe9uFQnxy&signature=4495a14efc483aa5ee2f6d4cd480f968&timestamp=1335783600&finishedAfterTimestamp=1335783600&=
{"status":"error","request_path":"v1\/groups\/recent_results","server_timestamp":1415026084,"finished_after_timestamp_used":1413809284,"error":{"error_code":"timeStampOutOfRange","error_message":"Access denied. Timestamp issue. Recalculate the digital signature with each call. (There is a 5-minute window of time variance allowed.) Use seconds since the UNIX Epoch, not milliseconds. Make sure your server calling our service is in sync with an atomic clock."}}
</code>
</body>
</html>");
d.close();
});
</script>