1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    56
    Vote Rating
    0
    dimitrij.zub is on a distinguished road

      0  

    Default Ajax image reloading

    Ajax image reloading


    Hi. I just wanted to ask, if there is any way to reload or change an image in Ext with AJAX?

    Any idea how this has to be done?

    Thanks

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,505
    Vote Rating
    53
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    This is a pure HTML/DOM issue. Nothing to do with whether or not you use Ext in your page.

  3. #3
    Ext User
    Join Date
    Jun 2008
    Posts
    56
    Vote Rating
    0
    dimitrij.zub is on a distinguished road

      0  

    Default


    Im just wondering if there is a way in EXT JS to do it in BG as its done e.g. with DOJO lightbox.

    My prob is that changing the src of an image doesnt work if the url is the same but content changed. I need to reload the content in the BG somehow and THEN replace the div.

    I hope u understand the problem IE and FFox make me do ugly stuff to reload the image by changing the src attribute

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,505
    Vote Rating
    53
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I don't know what you mean. But to change an image, you just change its src attribute to point to the new address and it changes.

  5. #5
    Ext User
    Join Date
    Jun 2008
    Posts
    56
    Vote Rating
    0
    dimitrij.zub is on a distinguished road

      0  

    Default


    No it wont.

    Ok i have to explain it better:

    Lets imagine u have a user profile image located at: images/deliver?uid=auser

    This user (auser) uploads a new profile image. While he is on his own profile form i want to update the image that he has just uploaded without reloading the whole page.

    So with fileupload i do register the event, so that once the upload is finished i change the src attribute to:

    images/deliver?uid=auser

    BUT! hmm its the same Oo so no browser in the world is reloading jack ****..

    Then.. I add a Math.random() as token like:

    images/deliver?uid=auser&token=0.437563214

    That helps for firefox but as IE gets the content type of an image its completely ignoring the parameters (c'mon which image is accepting parameters Oo) and ignores also all the header attributes as private, generated and so on...

    So i need a reload a REAL reload of the image although its the same URL.

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,505
    Vote Rating
    53
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    remove the image and insert a new one then

  7. #7
    Ext User
    Join Date
    Jun 2008
    Posts
    56
    Vote Rating
    0
    dimitrij.zub is on a distinguished road

      0  

    Default


    Per design a rename is not possible.

    C'mon animal. Face the problem, dont change it :-P

  8. #8
    Ext User Starfall's Avatar
    Join Date
    Jan 2008
    Location
    Moscow, Russian Federation
    Posts
    158
    Vote Rating
    0
    Starfall is on a distinguished road

      0  

    Default


    Avoiding a problem is a way of solving it. I'm all with Animal.

  9. #9
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,505
    Vote Rating
    53
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I don't really understand why the posting. We're maintaining a W3 DOM in a browser. We're limited to what that can do, so that's what we do.

  10. #10
    Ext User
    Join Date
    Jun 2008
    Posts
    56
    Vote Rating
    0
    dimitrij.zub is on a distinguished road

      0  

    Default


    Ok. Maybe to help me in the solution: How to background get some content other then text with Ajax?