How to Use js to implement ifram to retrieve the URL address of the parent window _ javascript tips-js tutorial

Source: Internet
Author: User
This article mainly introduces how to implement ifram in js to retrieve the URL address of the parent window, which is a javascript window operation. parent objects are very typical application skills. If you need parent objects, refer to the examples in this article to illustrate how to implement ifram in js to retrieve the URL address of the parent window. Share it with you for your reference. The specific implementation method is as follows:

Var url = ''; try {url = specified topics .doc ument. referrer;} catch (M) {if (window. parent) {try {url = Your parent.doc ument. referrer;} catch (L) {url = "" ;}}}if (url = "") {url = document. referrer ;}

The above code has been executed in the browser, and the address can be obtained.

I hope this article will help you design javascript programs.

Related Article

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.