Fix prepro.js for Opera by avoiding 'self' as variable name.

This commit is contained in:
Jürg Lehni 2011-11-18 20:08:17 +01:00
parent 5f0da04daf
commit 4106cc3621

View file

@ -21,8 +21,8 @@ if (!window.include) {
// scripts from loading straight away.
var scripts = document.getElementsByTagName('script');
var script = scripts[scripts.length - 1];
var self = script.getAttribute('src');
var root = self.match(/^(.*\/)/)[1];
var src = script.getAttribute('src');
var root = src.match(/^(.*\/)/)[1];
window.include = function(url) {
url = root + url;
@ -31,7 +31,7 @@ if (!window.include) {
// executing straight away, and delaying it until right before the
// script at 'url' is loaded.
document.write([
'<script type="text/javascript" src="', self, '"></script>',
'<script type="text/javascript" src="', src, '"></script>',
// Set newRoot, so include() from 'url' load from the right place
'<script type="text/javascript">root = "', newRoot, '";</script>',
// Load the actual script