Skip to content

Commit 89f361a

Browse files
line 135
1 parent fb6aab9 commit 89f361a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,25 +98,25 @@ open('/', 'test', params);
9898
- اگر هیچ `left/top`ای در params وجود ندارد، مرورگر تلاش می‌کند که پنجره‌ای جدید را نزدیک آخرین پنجره‌ی باز شده، باز کند.
9999
- اگر هیچ `width/height`ای وجود ندارد، پنجره‌ی جدید همان اندازه‌ی آخرین پنجره‌ی باز شده را خواهد داشت.
100100

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

103-
The `open` call returns a reference to the new window. It can be used to manipulate its properties, change location and even more.
103+
فراخوانی `open` ارجاعی به پنجره‌ی جدید را برمی‌گرداند. از آن می‌توان برای دستکاری کردن propertyها، تغییر دادن location و حتی بیشتر استفاده کرد.
104104

105-
In this example, we generate popup content from JavaScript:
105+
در این مثال، ما از JavaScript محتوای popup را تولید می‌کنیم.
106106

107107
```js
108108
let newWin = window.open("about:blank", "hello", "width=200,height=200");
109109

110110
newWin.document.write("Hello, world!");
111111
```
112112

113-
And here we modify the contents after loading:
113+
و اینجا بعد از load کردن، محتوا را دستکاری می‌کنیم.
114114

115115
```js run
116116
let newWindow = open('/', 'example', 'width=300,height=300')
117117
newWindow.focus();
118118

119-
alert(newWindow.location.href); // (*) about:blank, loading hasn't started yet
119+
alert(newWindow.location.href); // (*) about:blank, هنوز شروع نشده است loading
120120

121121
newWindow.onload = function() {
122122
let html = `<div style="font-size:30px">Welcome!</div>`;
@@ -126,12 +126,12 @@ newWindow.onload = function() {
126126
};
127127
```
128128

129-
Please note: immediately after `window.open`, the new window isn't loaded yet. That's demonstrated by `alert` in line `(*)`. So we wait for `onload` to modify it. We could also use `DOMContentLoaded` handler for `newWin.document`.
129+
لطفا توجه داشته باشید: بلافاصله بعد از `window.open` پنجره‌ی جدید هنوز load نشده است. آن، در خط `(*)` با `alert` نشان داده می‌شود. پس صبر می‌کنیم تا `onload` آن را اصلاح کند. همچنین برای `newWin.document` می‌توانیم از `DOMContentLoaded` handler استفاده کنیم.
130130

131-
```warn header="Same origin policy"
132-
Windows may freely access content of each other only if they come from the same origin (the same protocol://domain:port).
131+
```warn header="سیاست مبدا یکسان"
132+
.می‌توانند به صورت آزادانه به محتوای یکدیگر دسترسی داشته باشند (همان پروتکل://domain:port) پنجره‌ها فقط در صورتی که از یک مبدا باشند
133133
134-
Otherwise, e.g. if the main window is from `site.com`, and the popup from `gmail.com`, that's impossible for user safety reasons. For the details, see chapter <info:cross-window-communication>.
134+
.را ببینید <info:cross-window-communication> این برای دلایل امنیتی غیرممکن است. برای جزئیات، بخش `gmail.com` از popup باشد و `site.com` در غیر این صورت، برای مثال اگر پنجره‌ی اصلی از
135135
```
136136

137137
## Accessing window from popup

0 commit comments

Comments
 (0)