Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Prettify slows down the page #206

@GoogleCodeExporter

Description

@GoogleCodeExporter
I've a div in which I dynamically load a piece of code from the result of an 
AJAX request. Then I want to format it using prettify. It works but it's damn 
slow. The code I use is the following:

var jqxhr = $.get(fileName)
  .success(function(data) {
    $('#myDiv').html(data);
    prettyPrint();
    $('#myDiv').fadeIn();
})

In short I do the GET request, I put the result of the request in #myDiv I 
format it and I fadeIn the div. It takes a while but loads. But when I fade out 
the div then the page remains unresponsive for a couple of seconds. I removed 
the prettyPrint() and the page behaves just perfectly. Any hint?

Stackoverflow question 
http://stackoverflow.com/questions/10155017/syntax-highlighting-of-dynamically-g
enerated-snippet-in-web-page-using-prettify


Original issue reported on code.google.com by R.Minelli88 on 14 Apr 2012 at 3:58

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions