Skip to content

Commit 4c73aa8

Browse files
line 174
1 parent 89f361a commit 4c73aa8

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

3-frames-and-windows/01-popup-windows/article.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ newWindow.onload = function() {
134134
.را ببینید <info:cross-window-communication> این برای دلایل امنیتی غیرممکن است. برای جزئیات، بخش `gmail.com` از popup باشد و `site.com` در غیر این صورت، برای مثال اگر پنجره‌ی اصلی از
135135
```
136136

137-
## Accessing window from popup
137+
## دسترسی به پنجره از طریق popup
138138

139-
A popup may access the "opener" window as well using `window.opener` reference. It is `null` for all windows except popups.
139+
یک popup علاوه بر استفاده از ارجاع `window.opener` می‌تواند به "opener" هم دسترسی داشته باشد. این برای تمام پنجره‌ها به جز popupها null است.
140140

141-
If you run the code below, it replaces the opener (current) window content with "Test":
141+
اگر کد زیر را اجرا کنید، محتوای openr window (در حال حاضر) را با "Test" جایگزین می‌کند.
142142

143143
```js run
144144
let newWin = window.open("about:blank", "hello", "width=200,height=200");
@@ -148,19 +148,19 @@ newWin.document.write(
148148
);
149149
```
150150

151-
So the connection between the windows is bidirectional: the main window and the popup have a reference to each other.
151+
بنابراین، ارتباط میان پنجره‌ها دوطرفه است: پنجره‌ی اصلی و popup ارجاعی به یکدیگر دارند.
152152

153-
## Closing a popup
153+
## بستن یک popup
154154

155-
To close a window: `win.close()`.
155+
برای بستن یک پنجره: `win.close()`.
156156

157-
To check if a window is closed: `win.closed`.
157+
برای اینکه چک کنیم که یه پنجره بسته است یا نه: `win.closed`.
158158

159-
Technically, the `close()` method is available for any `window`, but `window.close()` is ignored by most browsers if `window` is not created with `window.open()`. So it'll only work on a popup.
159+
از نظر فنی، `close()` method برای هر `window` قابل دسترسی است اما اگر `window` با `window.open()` ایجاد شده باشد، `window.close()` توسط اکثر مرورگرها نادیده گرفته می‌شود. پس آن فقط روی یک popup کار خواهد کرد.
160160

161-
The `closed` property is `true` if the window is closed. That's useful to check if the popup (or the main window) is still open or not. A user can close it anytime, and our code should take that possibility into account.
161+
اگر پنجره بسته باشد، `closed` property برابر `true` می‌شود. این برای بررسی اینکه popup (یا پنجره‌ی اصلی) هنوز باز هستند یا نه مفید است. یک کاربر می‌تواند هر وقتی ببندد و کد ما باید امکان آن را در نظر بگیرد.
162162

163-
This code loads and then closes the window:
163+
این کد پنجره را load می‌کند و سپس می‌بندد.
164164

165165
```js run
166166
let newWindow = open('/', 'example', 'width=300,height=300');

0 commit comments

Comments
 (0)