Permalink
Browse files

We have to get rid of any external scripts in an exercise's html *bef…

…ore* it gets shoved into a jQuery object, otherwise IE8 will attempt to fetch this script. Fix those crazy 404s! #FIXIT
  • Loading branch information...
1 parent 7d9abb0 commit 85690814604857099d18fb9a383194e563fb6fbd @kamens kamens committed Apr 10, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 khan-exercise.js
View
@@ -2537,6 +2537,12 @@ var Khan = (function() {
return;
}
+ // Get rid of any external scripts in data before we shove data
+ // into a jQuery object. IE8 will attempt to fetch these external
+ // scripts otherwise.
+ // See https://github.com/Khan/khan-exercises/issues/10957
+ data = data.replace( /<script\ssrc=([^<])*<\/script>/, "" );
+
newContents = $(data);
// Name of the top-most ancestor exercise

2 comments on commit 8569081

@spicyj
Member
spicyj commented on 8569081 Apr 10, 2012

lgtm except I would write \s+ or just ;\s seems a little weird.

@kamens
Contributor
kamens commented on 8569081 Apr 10, 2012
Please sign in to comment.