Document directory
- Solve the problem that window. status is not displayed in IE7. When uploading an image, you cannot preview the JS window and close the window.
Solve the problem that window. status is not displayed in IE7. When uploading an image, you cannot preview the JS window and close the window.
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 was previously closed in IE6, 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"/>
<SCRIPT type = "text/JavaScript">
Function Preview (File ){
Document. getelementbyid ("imgpreview"). src = This. value;
}
</SCRIPT>
But in IE7, This is not valid, that day I tested this when I used greenbrowser (Green browser), found that can preview, but in the MS IE7 won't work, I was puzzled. I went to Baidu album and used this method to preview his uploaded photos. I used a green browser to view Baidu album and MSIE to view my program. Baidu album can be previewed during upload, 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.
In IE7, how does one implement preview? The answer is: Use a filter. See the following:
Select the photo to upload: <input type = "file"/> <br/>
<Div id = "imgpreview" style = "filter: progidximagetransform. Microsoft.
Alphaimageloader (sizingmethod = scale); width: 400px; Height: 200px; "> </div>
Function Preview (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.
Attachment: you cannot download or view attachments in your user group.
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.