Fixed CORS error with allorigins.win

This commit is contained in:
i12bretro 2021-07-31 15:06:05 -04:00 committed by GitHub
parent af44b9e594
commit d2ce62e414
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,8 +33,9 @@
</div>
</body>
<script>
$.ajax({ type:'GET', url: 'https://github.com/i12bretro/tutorials/file-list/main', success: function(html){
$.ajax({ type:'GET', url: 'https://api.allorigins.win/raw?url='+ encodeURIComponent('https://github.com/i12bretro/tutorials/file-list/main'), success: function(html){
m = null;
console.log(html);
regex = /<div role="rowheader".*?>.*?<a.*?href="\/i12bretro\/tutorials\/commit\/(.*?)">(\d{4}): (.*?)<\/a>.*?<time-ago.*?>(.*?)<\/time-ago>/gmsi
while ( (m = regex.exec( html )) != null ){
$('#tutorialList').append('<tr><td align="center">'+ m[2] +'</td><td align="left"><a href="https://i12bretro.github.io/tutorials/'+ m[2] +'.html" target="_blank">'+ m[3] +'</a></td><td align="center">'+ m[4] +'</td></tr>');