Error while trying to insert gist embed (Github) via PHP

Asked

Viewed 48 times

1

I am trying to insert an embed of a gist via PHP as follows:

<?php
    echo "<script src='https://gist.github.com/schacon/4277.js'></script>";
?>

However, when parsing the console, the following error is returned:

Failed to execute 'write' on 'Document': It isn’t possible to write into a Document from an asynchronously-Loaded External script unless it is explicitly opened.

I’ve tried too:

echo "<iframe src='https://gist.github.com/schacon/4277.js'></iframe>";

and:

echo "<embed src='https://gist.github.com/schacon/4277.js'></embed>";

but both return:

Refused to display 'https://gist.github.com/schacon/4277.js' in a frame because it set 'X-Frame-Options' to 'Deny'.

How can I get him to show gist? Or is it not possible that way?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.