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

Optimize images referenced from JS #572

@GoogleCodeExporter

Description

@GoogleCodeExporter
It would be good, once we have a real JS parser, to be able to optimize images 
loaded from JS.  Here's an example:


function fname(offset){
    if(offset!=0){
        timeout =1000;
        $('#thisid').css('width:830px;height:167px');
    }
    jQuery.get("/ajax/some.php", { o: offset, l: limit,p:sdd},function(data){
                                                                if(data==''){
                                                                    $(".editor").hide();
                                                                    return;
                                                                }
                                                                }

    update(offset);var sssleft = new Image();sssleft.src="http://cdn.doamin.com/img/name.png";
    function show(){
        $('.anyClass').remove();
        $('.prev').remove();
        $('.next').remove();
        $('#thisid').html(somehtml);
        jCaruselliteStart();
    };


In other words, look for the pattern:
   var X=new Image();
   X.src= STATIC_STRING;
the STATIC_STRING could be parsed as a URL and swapped for an 
optimized/cache-extended version, or possibly inlined with a data URL.

Original issue reported on code.google.com by jmara...@google.com on 15 Nov 2012 at 1:28

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