When the window is closed in IE7, you cannot preview the uploaded image. The window. Status is invalid. How can this problem be solved?

Source: Internet
Author: User

I encountered several problems in IE7, But I encountered normal problems in IE6. There are three problems:

1. The error is prompted when JS closes the window.
2. You cannot preview the uploaded image.
3. Invalid Window. Status.

For the first one, the window closed in IE6 is like this, window. opener = NULL; window. close (); In IE7, this will not work, and a prompt will still pop up, you must add a sentence in the middle, window. open ("", "_ Self"); just like the following form.
Window. Opener = NULL;
Window. Open ("", "_ Self ");   // This is required in IE7
Window. Close ();

Ii. Preview The uploaded Image

In IE6, this is very convenient.

<Input type = "file" onchange = "Preview (this)"/>
<SCRIPT type = "text/JavaScript">
Function Preview (File ){
Document. getelementbyid ("imgpreview"). src = This. value;
}
</SCRIPT>

but in IE7, This is not valid. I used greenbrowser (Green browser) when I tested it that day, and found that the preview can also be done, but it won't work in the MS IE7, I was wondering. I went to Baidu album and used this method to preview the uploaded photos. I used a green browser to watch Baidu album, use MSIE to view my Program . Baidu album can be previewed during upload, but my program cannot. as a result, I had been wondering if the program was wrong. I checked a lot of information online. I did not solve the problem. Later I used Ms IE to enter Baidu album, and I found that Baidu album cannot be previewed. it turned out to be a disaster caused by the Green browser. This is an IE kernel browser. Remember to use Microsoft's IE7 to test the program, other IE kernels may be used in browsers.
How can I Preview It In IE7? The answer is: Use a filter. See the following:

Select the photo to upload: <Input Type= "File"Onchange= "Preview (this);"/> <BR/>
<Div ID= "Imgpreview"Style= "Filter: progid: DXImageTransform. Microsoft.
Alphaimageloader (sizingmethod = scale); width: 400px; Height: 200px; "> </Div>
FunctionPreview (imgfile)
{
Document. getelementbyid ("Imgpreview"). Filters.
Item ("DXImageTransform. Microsoft. alphaimageloader"). Src = imgfile. value;
}

Let me turn the alphaimageloader filter back.

Syntax:
Filter: progid: DXImageTransform. Microsoft. alphaimageloader (Enabled = benabled, sizingmethod = ssize, src = Surl)
Attribute:
Enabled: Optional. Boolean ). Set or retrieve whether the filter is activated. True | false
True: default value. Filter activation.
False: the filter is disabled.

Sizingmethod: Optional. String ). Sets or retrieves the display mode of the image of the object to which the filter applies within the boundary of the object container. Crop: Cut the image to fit the object size.
Image: default value. Increase or decrease the size boundary of an object to fit the image size.
Scale: scale the image to adapt to the size boundary of the object. PS: If the padding and margin sizes are not suitable, the background image will be enlarged. This scaling is quite useful, which is equivalent to the background-repeat.

SRC: required. String ). Specify the background image using an absolute or relative URL. If this parameter is ignored, the filter will not work.

Note:
Within the boundary of an object container, an image is displayed between the background and content of the object, and you can cut and resize the image. If the file is loaded in PNG (Portable Network Graphics) format, the transparency between 0% and 100% is also provided.
The transparency of images in PNG (Portable Network Graphics) format does not affect your choice of text. That is to say, you can choose to display the content after the completely transparent area of images in PNG (Portable Network Graphics) format.

Iii. Problem of not displaying window. Status

In IE6, use window. Status = "Welcome to my blog !!! ", You can display such a line in the status bar, but in IE7,
It is normal during local testing and can be displayed, but it is not displayed after the uploaded server goes up, and there is no program running error. At first I suspect it is a security setting problem on the server, and then I found out, in the security settings of IE7, scripts are not allowed to update the status bar by default. It's a pity that another usable area is missing.
If it is your computer, you can change the settings so that IE7 can be displayed.
The method is: Tools -- Internet Options -- Security -- click "Custom Level" After selecting the internet -- "allow the status bar to be updated by script", and enable the default feature.
I cut a picture specially.

Although the above three are minor issues, if you do not understand the cause of the browser, many friends may spend a lot of time debugging the program, but the program is no problem.
So I wrote them here, hoping to help you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.