Solved

How to display a jpg in a popup browser window

Posted on 2011-09-22
8
136 Views
Last Modified: 2012-05-12
Hej,

I have a jpg the is lying on my IIS server and i just want to open a new window and display it with some javascript.

I have the open.window coded ok.. but do i have to do something else (such as the content type) because all i get is a small red cross...
0
Comment
Question by:soozh
  • 4
  • 3
8 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 36582824
The new window needs to be web page of it's own.  I guess you could 'pop-up' just the image.  Maybe the path is wrong?  Show me the 'open.window' code.
0
 

Author Comment

by:soozh
ID: 36582957
I dont think there is anything wrong with the open window code.  When i enable directory browsing on my web server and browse/click on the image i still get the small red cross icon.  
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 36583168
Ok, the post the image if you can.  JPGs come in more than one 'flavor'.  If you can open it in an image viewer or editor, try saving it under a slightly different name and see if you can view that in IE.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36584099
a red cross? the path of your jpeg is not the right

test page : http://jsfiddle.net/LtdcE/
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:soozh
ID: 36585282
I can view the image in the standard Windows Image/Fax viewer... but not in IE.
NPAT.DEMO.Katarakt-84.2903.4.205.jpg
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 36585340
The problem is that it is in CMYK mode, not RGB, and IE, at least up to IE8, does not display JPEGs in CMYK encoding.  If you open it in an image program and resave it as an RGB JPG, you'll be able to view it.
0
 

Author Comment

by:soozh
ID: 36585389
Thanks Dave.  How did you discover the coding?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 36585436
In Irfanview http://www.irfanview.com/ , you can press 'I' for information and it tells you that it's a JPEG and CMYK.  Photoshop and other image programs will tell that also.  CMYK color encoding is used for printing while RGB is used for monitors.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now