Skip to content

Commit 209b79d

Browse files
author
Philip Guo
committed
changed to use jQuery .empty() rather than .html('')
1 parent 4f46c3c commit 209b79d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

edu-python.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ function renderDataStructures(curEntry, vizDiv) {
273273
// This version was originally created in January 2010
274274
function renderDataStructuresVersion1(curEntry, vizDiv) {
275275
// render data structures:
276-
$(vizDiv).html(''); // CLEAR IT!
277276

277+
$(vizDiv).empty(); // jQuery empty() is better than .html('')
278278

279279
// render locals on stack:
280280
if (curEntry.stack_locals != undefined) {
@@ -415,7 +415,8 @@ function renderDataStructuresVersion2(curEntry, vizDiv) {
415415
jsPlumb.reset();
416416

417417

418-
$(vizDiv).html(''); // CLEAR IT!
418+
$(vizDiv).empty(); // jQuery empty() is better than .html('')
419+
419420

420421
// create a tabular layout for stack and heap side-by-side
421422
// TODO: figure out how to do this using CSS in a robust way!
@@ -1080,7 +1081,7 @@ String.prototype.rtrim = function() {
10801081

10811082
function renderPyCodeOutput(codeStr) {
10821083
var tbl = $("#pyCodeOutput");
1083-
tbl.html('');
1084+
tbl.empty(); // jQuery empty() is better than .html('')
10841085
var lines = codeStr.rtrim().split('\n');
10851086

10861087
$.each(lines, function(i, cod) {

0 commit comments

Comments
 (0)