Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#5396 closed bug (fixed)

Docs: Broken Examples

Reported by: Jörn Zaefferer 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.

Change History (4)

comment:1 Changed 13 years ago by kswedberg

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.

comment:2 in reply to:  1 Changed 13 years ago by kswedberg

Replying to 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

comment:3 Changed 13 years ago by Jörn Zaefferer

Resolution: fixed
Status: newclosed

John fixed the script on mediawiki.

comment:4 Changed 13 years ago by rdworth

Note: See TracTickets for help on using tickets.