Skip to main content

Search and Top Navigation

#5396 closed bug (fixed)

Opened March 21, 2010 07:18PM UTC

Closed March 24, 2010 04:08PM UTC

Last modified April 21, 2010 01:19PM UTC

Docs: Broken Examples

Reported by: jzaefferer Owned by:
Priority: blocker Milestone: 1.8.1
Component: [meta] Version: 1.8
Keywords: Cc:
Blocked by: Blocking:

See eg.

The two examples there are both broken. Firebug has this:

missing ) after argument list
[Break on this error] }catch(e){}});

This script that rewrites the embedded script for the iframe source seems to have a bug:

source = source
80 // IE needs to wait for the script to load (?)
81 .replace("$(document).ready(function(){", "window.onload = (function(){try{")
82 .replace(/}\\);\\s*<\\/sc/, "}catch(e){}});</sc")
83 //.replace("", "")
84 .replace("</head>", "<style>html,body{border:0; margin:0; padding:0;}</style></head>");

It inserts the catch-line, but not the try.

Attachments (0)
Change History (4)

Changed March 23, 2010 04:51PM UTC by kswedberg comment:1

I had the same problem on I got things working by replacing those regex replaces with this:

  source = source
        .replace(/<script>([^<])/g,"<script>window.onload = (function(){\\ntry{$1")
        .replace(/([^>])<\\/sc/g,  '$1\\n}catch(e){}});</sc');

  source = source
        .replace("</head>", "<style>html,body{border:0; margin:0; padding:0;}</style></head>");

I think removing the comments helped.

Changed March 23, 2010 04:55PM UTC by kswedberg comment:2

Replying to [comment:1 kswedberg]:

Oh, one other thing: I removed the document ready block because I put the script near the closing body tag.

Here is the URL to the script on

Changed March 24, 2010 04:08PM UTC by jzaefferer comment:3

resolution: → fixed
status: newclosed

John fixed the script on mediawiki.

Changed April 21, 2010 01:19PM UTC by rdworth comment:4