Interesting issue about importing a client resource on html
Here is the html code.
<html>
<head>
<title></title>
<script type="text/javascript" src="1.js"></script>
<script type="text/javascript" src="2.js"></script>
</head>
<body>
</body>
</html>
You can create a simple web application in Visual Studio, and create new html page(we can call it "test.html"), add the above code to test.html, add two js file to your project, then set开发者_开发技巧 test.html as start page, run it. you will find out that 1.js has been requested twice as you can see in the picture(http://i.stack.imgur.com/K4i3H.png). I can't understand it. Anybody can tell me why?
Thanks a lot !
I found a comments on Httpwatch's official website. Hope this explain your question.
The (Aborted) value is more complex in its origin. It occurs when IE has started to process the request for a URL (e.g. to download an image), but then decides to cancel the operation. Here are some examples of when this can occur:
If you click on a link or bookmark while a page is downloading, or click on IE’s Stop button, you will see that IE cancels any requests which are still active and HttpWatch shows the (Aborted) result.
A CSS rollover image on a page will start a request when the mouse pointer is moved into its active area. If the mouse pointer quickly moves away again, IE may abort the request if it has not already completed.
Sometimes javascript is used to fire off requests for background tasks or to gather statistics on a page. Often this can lead to aborted results if the javascript does not wait for the response to be received from the server.
精彩评论