Skip to content

Commit

Permalink
More DOM methods rather than jQuery.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Plotkin authored and Andrew Plotkin committed Dec 9, 2024
1 parent 187eee5 commit 5378ee2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/quixe/gi_load.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,17 +347,14 @@ function load_run(optobj, image, imageoptions) {
window.processBase64Zcode = function(val) {
start_game(decode_base64(val));
};
var headls = $('head');
var headls = document.getElementsByTagName('head');
if (!headls.length) {
all_options.io.fatal_error("This page has no <head> element!");
return;
}
var script = $('<script>',
{ src:gameurl, 'type':"text/javascript" });
/* jQuery is now sensitive about this, and will not allow it as
a Chrome work-around. We use a raw DOM method instead. */
// headls.append(script);
headls.get(0).appendChild(script.get(0));
headls[0].appendChild(script.get(0));
return;
}

Expand Down Expand Up @@ -428,14 +425,14 @@ function load_run(optobj, image, imageoptions) {
window.processBase64Zcode = function(val) {
start_game(decode_base64(val));
};
var headls = $('head');
var headls = document.getElementsByTagName('head');
if (!headls.length) {
all_options.io.fatal_error("This page has no <head> element!");
return;
}
var script = $('<script>',
{ src:fullurl, 'type':"text/javascript" });
headls.append(script);
headls[0].appendChild(script.get(0));
return;
}

Expand Down

0 comments on commit 5378ee2

Please sign in to comment.