What is the difference between iframe and ajax




















Below we use a simple example to simulate the remote script call of IFrame. This example does not really call the server, but just to let everyone know how to use IFrame to realize remote script call. In this example, we have completely implemented remote script calls, which seems to be doing the same thing as ajax, but what is the difference between the two? First of all, what we want to say is what everyone generally knows is the biggest feature of ajax-asynchronous communication.

If the refresh alarm sound is set, the computer will make a "click" sound, which may feel annoying for the user. If the request is frequent, the user will feel annoyed. But in essence, if the size of the server's return value is the same, the difference in their speed is the same. From a functional point of view: 1 An iframe contains an entire web page. Usually, when we lay out a web page, we often use it. Once the user enters credentials into the legitimate site within the iframe, the malicious JavaScript steals the keystrokes.

Active 3 hr before. Viewed times. Learn more. What are the differences between using an iframe and ajax to include the contents of an external page? Ask Question. Asked 12 years, 11 months ago.

Active 4 years, 11 months ago. Viewed 6k times. Improve this question. Bobby Bobby 57 1 1 gold badge 2 2 silver badges 8 8 bronze badges.

Add a comment. Active Oldest Votes. Bear in mind they're two completely separate technologies. The security restrictions applying in this case is called "same origin policy". Improve this answer. So if you were deciding on what technology to use to show external pages would you use iframe then? As you can tell, I am not a developer, but I like to understand best practices so when I talk to my developers I have a bit of understanding.

Google Maps , for example, performs searches in an invisible IFRAME and then pulls results back into an element on the visible web page.

Another issue is that dynamic web page updates make it difficult for a user to bookmark a particular state of the application. Solutions to this problem exist, many of which use the URL fragment identifier the portion of a URL after the ' ' [7] [8] to keep track of, and allow users to return to, the application in a given state.

This is possible because many browsers allow JavaScript to update the fragment identifier of the URL dynamically, so that Ajax applications can maintain it as the user changes the application's state.

This solution also improves back-button support. It is, however, not a complete solution. Network latency — or the interval between user request and server response — needs to be considered carefully during Ajax development. Without clear feedback to the user [9] , smart preloading of data and proper handling of the XMLHttpRequest object, users might experience delay in the interface of the web application, something which users might not expect or understand.

Additionally, when an entire page is rendered there is a brief moment of re-adjustment for the eye when the content changes.

The lack of this re-adjustment with smaller portions of the screen changing makes the latency more apparent. In general the potential impact of latency has not been "solved" by any of the open source Ajax toolkits and frameworks available today, such as the effect of latency variance over time.

Websites that use Ajax to load data which should be indexed by search engines must be careful to provide equivalent data at a public, linked URL and in a format that the search engine can read, as search engines do not generally execute the JavaScript code required for Ajax functionality.



0コメント

  • 1000 / 1000