Difference between revisions of "User talk:Jacky720"
JayRulesXKCD (talk | contribs) m (→To talk to me) |
(→To talk to me) |
||
| Line 19: | Line 19: | ||
:::::I never uploaded 'Darkness', but I did upload a 'teaser' for it and my account is : https://scratch.mit.edu/users/JayRulesScratch/ --[[User:JayRulesXKCD|JayRulesXKCD]] ([[User talk:JayRulesXKCD|talk]]) 12:17, 14 November 2016 (UTC) | :::::I never uploaded 'Darkness', but I did upload a 'teaser' for it and my account is : https://scratch.mit.edu/users/JayRulesScratch/ --[[User:JayRulesXKCD|JayRulesXKCD]] ([[User talk:JayRulesXKCD|talk]]) 12:17, 14 November 2016 (UTC) | ||
| + | |||
| + | |||
| + | ===[http://jackm.000webhostapp.com/transcript.html Official Transcript]=== | ||
| + | Here is the code: (with links to where I got it) | ||
| + | <code> | ||
| + | <!DOCTYPE html> | ||
| + | <html> | ||
| + | <head> | ||
| + | <script> | ||
| + | [https://www.html5rocks.com/en/tutorials/cors/ function createCORSRequest(method, url) { | ||
| + | var xhr = new XMLHttpRequest(); | ||
| + | if ("withCredentials" in xhr) { | ||
| + | // Check if the XMLHttpRequest object has a "withCredentials" property. | ||
| + | // "withCredentials" only exists on XMLHTTPRequest2 objects. | ||
| + | xhr.open(method, url, true); | ||
| + | } else if (typeof XDomainRequest != "undefined") { | ||
| + | // Otherwise, check if XDomainRequest. | ||
| + | // XDomainRequest only exists in IE, and is IE's way of making CORS requests. | ||
| + | xhr = new XDomainRequest(); | ||
| + | xhr.open(method, 'https://xkcd.com/info.0.json'); | ||
| + | } else { | ||
| + | // Otherwise, CORS is not supported by the browser. | ||
| + | xhr = null; | ||
| + | } | ||
| + | |||
| + | return xhr; | ||
| + | } | ||
| + | |||
| + | var xhr = createCORSRequest('GET', "https://xkcd.com/info.0.json"); | ||
| + | if (!xhr) { | ||
| + | alert('CORS not supported'); | ||
| + | } else { | ||
| + | alert('This site uses CORS.'); | ||
| + | } ] | ||
| + | |||
| + | [http://stackoverflow.com/questions/19706046/how-to-read-an-external-local-json-file-in-javascript function readTextFile(file, callback) { | ||
| + | var rawFile = new XMLHttpRequest(); | ||
| + | alert("raw file"); | ||
| + | rawFile.overrideMimeType("application/json"); | ||
| + | alert("json"); | ||
| + | rawFile.open("GET", file, true); | ||
| + | alert(rawFile.responseText); | ||
| + | alert(rawFile.readyState); | ||
| + | alert(rawFile.status); | ||
| + | rawFile.onreadystatechange = function() { | ||
| + | if (rawFile.readyState === 4 && rawFile.status == "200") { | ||
| + | callback(rawFile.responseText); | ||
| + | alert("done?"); | ||
| + | } | ||
| + | } | ||
| + | } ] | ||
| + | |||
| + | //My code | ||
| + | |||
| + | function getScript() { | ||
| + | if (parseInt(document.getElementById("ComicNumber").value)) { | ||
| + | var comic = new Number( | ||
| + | document.getElementById("ComicNumber").value); | ||
| + | var link = "https://xkcd.com/" + comic + "/info.0.json"; | ||
| + | try { | ||
| + | readTextFile(link, function(text) { | ||
| + | var output = JSON.parse(text); | ||
| + | alert(output); | ||
| + | document.getElementById("output").innerHTML = | ||
| + | output.transcript; | ||
| + | }); | ||
| + | } catch(Err) {alert("Oops! Something went wrong.");} | ||
| + | |||
| + | } else { | ||
| + | alert("This is not an integer!"); | ||
| + | } | ||
| + | alert("The function completed.") | ||
| + | } | ||
| + | </script> | ||
| + | </head> | ||
| + | <body> | ||
| + | <input type="text" id="ComicNumber"> | ||
| + | <input type="button" onclick="getScript();" value="Get Transcript"> | ||
| + | <br /> | ||
| + | <p id="output"></p> | ||
| + | </body> | ||
| + | </html> | ||
| + | </code> | ||
==To talk about me == | ==To talk about me == | ||
Revision as of 20:51, 28 November 2016
To talk to me
I will make my comments only in this section, and in bold. Be advised that although I may keep up-to-date, I might be shying away, screening my calls, so I could but won't answer everything. Jacky720 (talk) 02:23, 9 November 2016 (UTC)
Yay! Glad to see another happy user of the group! (And another coder!) :D I didn't know anyone else on this site played Minecraft... --JayRulesXKCD (talk) 12:08, 10 November 2016 (UTC)
Same to you! Jacky720 (talk) 15:52, 10 November 2016 (UTC)
(That's right, go HTML!)
- What kind of stuff do you like to program? Are you a game designer? Or a web coder kind of person? --JayRulesXKCD (talk) 17:12, 10 November 2016 (UTC)
- It isn't a job or anything, just a hobby of messing with webpages. Also, if you don't own a domain, and you tell everyone, you can operate a totally free subdomain through $0.00 webhost. Although you might want to backup your site. If you don't visit it enough, it shuts down and you need to re-register. Just some tips. (P.S. My web portal has seen better days. (P.P.S. 859: ( Jacky720 (talk) 19:49, 10 November 2016 (UTC)
- Wait, I just looked at your page and you publish games? Like I said above... But nice. I don't do that kind of thing, but I have made a couple of 9001% informal games, like on Scratch and stuff.
- What a coincidence! I use Scratch too! However, I haven't really used it in a while, as I'm sticking to normal game development, but I do still go on there from time to time to see the crazy stuff that people come up with. I was going to make a game on there called "Darkness", but development proved to be too difficult and I was only able to finish the first level and a teaser for the game. I did eventually re-vitalize the game, but with a new name and new story, and it eventually became 'This Isn't Home' , and then I ran into problems with the development with that, and I had to take it down from GameJolt yesterday. Life of a game designer... your work is never finished. I'm going to have to fix that one now. :P --JayRulesXKCD (talk) 12:27, 11 November 2016 (UTC)
- I never uploaded 'Darkness', but I did upload a 'teaser' for it and my account is : https://scratch.mit.edu/users/JayRulesScratch/ --JayRulesXKCD (talk) 12:17, 14 November 2016 (UTC)
Official Transcript
Here is the code: (with links to where I got it)
<!DOCTYPE html>
<html>
<head>
<script>
[https://www.html5rocks.com/en/tutorials/cors/ function createCORSRequest(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
// Check if the XMLHttpRequest object has a "withCredentials" property.
// "withCredentials" only exists on XMLHTTPRequest2 objects.
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
// Otherwise, check if XDomainRequest.
// XDomainRequest only exists in IE, and is IE's way of making CORS requests.
xhr = new XDomainRequest();
xhr.open(method, 'https://xkcd.com/info.0.json');
} else {
// Otherwise, CORS is not supported by the browser.
xhr = null;
}
return xhr;
}
var xhr = createCORSRequest('GET', "https://xkcd.com/info.0.json");
if (!xhr) {
alert('CORS not supported');
} else {
alert('This site uses CORS.');
} ]
[http://stackoverflow.com/questions/19706046/how-to-read-an-external-local-json-file-in-javascript function readTextFile(file, callback) {
var rawFile = new XMLHttpRequest();
alert("raw file");
rawFile.overrideMimeType("application/json");
alert("json");
rawFile.open("GET", file, true);
alert(rawFile.responseText);
alert(rawFile.readyState);
alert(rawFile.status);
rawFile.onreadystatechange = function() {
if (rawFile.readyState === 4 && rawFile.status == "200") {
callback(rawFile.responseText);
alert("done?");
}
}
} ]
//My code
function getScript() {
if (parseInt(document.getElementById("ComicNumber").value)) {
var comic = new Number(
document.getElementById("ComicNumber").value);
var link = "https://xkcd.com/" + comic + "/info.0.json";
try {
readTextFile(link, function(text) {
var output = JSON.parse(text);
alert(output);
document.getElementById("output").innerHTML =
output.transcript;
});
} catch(Err) {alert("Oops! Something went wrong.");}
} else {
alert("This is not an integer!");
}
alert("The function completed.")
}
</script>
</head>
<body>
<input type="text" id="ComicNumber">
<input type="button" onclick="getScript();" value="Get Transcript">
</body> </html>
