Results 1 to 2 of 2
  1. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #1  
    Can I register a listener, so that when an image loads (or doesn't after some amount of time) a function can be called that posts An error message?

    The way it works right now

    I have

    Code:
    <div id="chart"></div>
    In my javascript I use

    Code:
    $('chart').innerHTML= "<img src="url" </img>
    This works well, but I need to let the user know while their image is loading (such as with a spinner) or if the image is not reachable, some sort of error image.

    Any suggestions?
    My Programs: TipIt(TipCalc), FillUps
  2. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #2  
    Let me try again. I think I could use the Webview Widget, but so far, it hasn't worked well.

    Basically, the google chart APIs return a PNG image. Such as this:

    Example Chart

    Now, I want to take this and use the WebID widget instead, and I try something like:

    Code:
    this.controller.setupWidget("chart",
            {
                url:    imageURL,
                
               
                },
           {});
    where imageurl is the link above.

    The image is blurry and huge. Even if I use virtualpagewidth and height, it doesn't resize correct. Basically, I don't really want WebID to load a whole webpage, i just want to grab the PNG...WebID allows me to tell if the image load fails.. Help someone. Please
    My Programs: TipIt(TipCalc), FillUps

Posting Permissions