Results 1 to 5 of 5

Thread: Content Type image/jpeg within Ajax XMLHttpRequest

  1. #1
    Join Date
    Feb 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Content Type image/jpeg within Ajax XMLHttpRequest

    Hi,

    I understand easily how to load and displaying external html contents in a container using Ajax but i can't do it with a jpeg directly, like many others. I also know that Ajax is not needed for this simple task but in my case, i have a full html page with dynamic contents plus a couple of live jpeg still images that when i click on one of them, it need to refresh only one or all jpeg images at the same time without reloading the full page. Can't use iframe or things like that, Ajax is the way to do it correctly.

    This demo here at Dynamic Drive loads a html page :
    http://www.dynamicdrive.com/dynamici...jaxcontent.htm
    I know about external url, im using local url like 127.0.0.1 for the images.

    Can we set the Content Type to image/jpeg? if yes, how ?

    Thanks.
    -------------------
    http://blog.dsa.net/
    Last edited by x-mob; 02-10-2006 at 05:10 AM.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    While you can get an image/jpeg filetype, there's not a lot HTML and Javascript will allow you to do with it after you've done so. Use image.src to specify a new source file for the image, and you'll achieve the effect desired.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Feb 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    While you can get an image/jpeg filetype, there's not a lot HTML and Javascript will allow you to do with it after you've done so. Use image.src to specify a new source file for the image, and you'll achieve the effect desired.
    Well... you must take a look on what i working on before. It is an interface to control a PTZ camera, a small floating palette has the controls on it, you choose controls and then click on the image and the camera will move/zoom to the new location base on where you click, you know like old Web maps but this will change with the Ajax thing :-).

    I don't think image.src work, it have to do a GET HTTP, i tried before without success...

    http://206.162.130.3/e/drag.html?p=mountain_2&width=640

    Thanks.

    ------------------
    http://blog.dsa.net

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I don't think image.src work, it have to do a GET HTTP, i tried before without success...
    Changing the source of the image should cause the browser to perform an HTTP GET.
    To be honest with you, I'd recommend using a Java applet for something like this. It is possible with DHTML, but I'm thinking it might be easier in Java.
    11:04:01: there's a fly on your camera.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Feb 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    Changing the source of the image should cause the browser to perform an HTTP GET.
    To be honest with you, I'd recommend using a Java applet for something like this. It is possible with DHTML, but I'm thinking it might be easier in Java.
    11:04:01: there's a fly on your camera.
    Oh! no Java, i found a way to do it with Ajax, i will update the sample later.
    Thank you.

    -------------------
    http://blog.dsa.net/

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •