On 18/01/07, Dan Atkinson <[EMAIL PROTECTED]> wrote: > > Can't you just force the mime type in the ASP.NET page so that, even though > it renders the page as HTML, the image is shown as normal? >
It's not an error with my server-side code as if I disable JavaScript and click the link, the image is shown. I am already setting the content type as well. The image is loaded from a database field and streamed to the user. There is a check in Thickbox that decides if the link is to an image by checking if the url contains a know extension var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g; var urlType = baseURL.toLowerCase().match(urlString); if(urlType == '.jpg'.... As baseURL never matches the expression, the else statement is fired which renders whatever is in the remote page. What it renders is the same as what would happen if you opened the image in notepad. > Sam Collett wrote: > > > > I have a suggestion for Thickbox (if there is to be another version) > > in regards to showing images. > > > > I stream images to the user via an ASP.NET page. As a result, the URL > > does not end with one of the common image extensions. So it ends up > > not being displayed (or showing the ASCII representation of the image) > > and slowing the page down. > > > > As a workaround, I changed the urlType checking to use 'url' instead > > of 'baseURL': > > > > In TB_show, look for the line starting with 'var urlType' and replace > > with: > > > > var urlType = url.toLowerCase().match(urlString); > > > > The link to you generated image would be changed to something like: > > > > path/to/image.aspx?imageId=1&ext=.jpg > > > > > > This is not the best way to do it, and may break other thickbox links. > > To prevent the need for this, perhaps the class name could be used to > > decide if the link is to an image? > > > > i.e. > > path/to/image.aspx?imageId=1 Image Link > > > > It may even result in less code (in the JavaScript file - the pages > > with images would need the class altering). > > > > _______________________________________________ > > jQuery mailing list > > [email protected] > > http://jquery.com/discuss/ > > > > > > -- > View this message in context: > http://www.nabble.com/Thickbox-Suggestion-tf3033779.html#a8430676 > Sent from the JQuery mailing list archive at Nabble.com. > > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
