Results 1 to 7 of 7

Thread: Getting Result From JavaScript

  1. #1

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Getting Result From JavaScript

    I want to be able to get specific website thumbnails and display them in an ImageBox. The easiest I've found is using a web service. Unforntuantely, most of these services don't allow me to just attach a URL. If I could, then I would just assign the URL of the ImageBox as the URL.

    Instead, they force me to use JavaScript like this:

    Javascript Code:
    1. <script type="text/javascript" src="http://webshot.in/thumbshot/getshot.php?url=http://www.shrunktheweb.com"></script>

    I can do that, but how I would I get the results and assign it to the ImageBox's property?
    Last edited by weirddemon; Feb 8th, 2012 at 04:20 PM.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Getting Result From JavaScript

    Would ASHX be interest you?It is also async.Have a look.
    http://www.vbforums.com/showthread.php?t=623270
    Post #8 of Gary.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Getting Result From JavaScript

    Man, I remember that thread That was a while ago

    Things haven't really changed in this regard though, so the use of the ASHX is still valid. In the code behind for the Handler, you can make the request to the Web Service, get the image, and then render it to the page.

    Job done

    Gary

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Getting Result From JavaScript

    May i add that is really slow regarding image from sql to page.
    Gary that was the worst days as an asp.net beginner especially non css learner.Now it's easier since i have some understanding in CSS.Still no understanding whatsoever why Microsoft punished us by putting out iexplorer7 that i was working with those days.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Getting Result From JavaScript

    Quote Originally Posted by sapator View Post
    May i add that is really slow regarding image from sql to page.
    Really? That has not been my experience. How large are the images? It might be better to hold only the "address" of the image in the database, and store the image on the file system. The same ASHX can be used in this case. You might also want to think about caching the images to save the round trip.

  6. #6
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Getting Result From JavaScript

    I was referring on holding the image to the database that renders it back reaaaally slow.The file system option is fast.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  7. #7
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Getting Result From JavaScript

    Quote Originally Posted by sapator View Post
    I was referring on holding the image to the database that renders it back reaaaally slow.The file system option is fast.
    Agreed. This is where caching really comes into play, and can be very useful.

    Gary

Posting Permissions

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



Click Here to Expand Forum to Full Width