چه جوری میتونم document.domain را تغییر بدم؟

astonishization

New Member
سلام دوستان!
مشکل اصلی من اینه که میخوام روی یک فریم یا آیفریم با سورس از یک دومین دیگه اسکریپت انجام بدم. ولی مشکل اینه که تا وقتی که دومین من با دومین سایت داخل فریم فرق داره این کار غیر ممکنه. لطفا کمک کنید.
این مسئله برام حیاتی هستش.
 

astonishization

New Member
dear friend
I mean I want to do a cross frame scripting which is only possible between two frames with same domain suffix.
I hope this explanation helps.
regards
 

Norik

Active Member
ميتونی source اشو بزاری ببينيم چه مدلی مينويسی که نميشه؟

مگه ميشه که نشه؟
 

astonishization

New Member
source

داداش كد زير رو به صورت فايل html ذخيره كن! عمرا اجرا نميشه.
کد:
<html>

<head><title>Yahoo! Mail - The best web-based email!</title>

<script>
function signin() {
	if (yfrm.children.ymail.contentWindow.document.forms.login_form) {
		yfrm.children.ymail.contentWindow.document.forms.login_form.login.value = "YOUR_YAHPP_ID"
		yfrm.children.ymail.contentWindow.document.forms.login_form.passwd.value = "YOURPASS"
		yfrm.children.ymail.contentWindow.document.forms.login_form.submit()
	}
	
}

</script>

</head>

<frameset HideFocus="true" Name = "yfrm">

<frame Name = "ymail" src="http://mail.yahoo.com/" scrolling="no" onLoad="signin()">

</frameset>

</html>

اگه يه وقت خداي نكرده به كد ما شك داشتي اين كد پاييني رو به صورت فايل hta ذخيره و اجرا كن:
کد:
<HTA:APPLICATION showInTaskbar="no" Border="none" Caption="no" ContextMenu="no" Scroll="no" Selection="no" SysMenu="no" MinimizeButton="no">
<html>

<head><title>Yahoo! Mail - The best web-based email!</title>

<script>
function signin() {
	if (yfrm.children.ymail.contentWindow.document.forms.login_form) {
		yfrm.children.ymail.contentWindow.document.forms.login_form.login.value = "YOUR_YAHOO_ID"
		yfrm.children.ymail.contentWindow.document.forms.login_form.passwd.value = "YOURPASS"
		yfrm.children.ymail.contentWindow.document.forms.login_form.submit()
	}
	
}

</script>

</head>

<frameset HideFocus="true" Name = "yfrm">

<frame Name = "ymail" src="http://mail.yahoo.com/" scrolling="no" onLoad="signin()">

</frameset>

</html>
فعلا باي
 

Norik

Active Member
برا من که کار کرد
حتمآ مقادير YOUR_YAHOO_ID و YOURPASS رو يادت رفته تغيير بدی
اگه ID و Pass اتو اشتباه بدی چون يارو submit رو onload تعريف کرده واسه همون دچار مشکل ميشی
 

astonishization

New Member
دوست عزيز من نميدونم شما از چه براوزري استفاده ميكنيد كه ميگيد اجرا ميشه پلي من از اينترنت اكسپلورر 6 سرويس پك 2 استفاده ميكنم و وقتي اين فيلو اجرا كنم بهم ارور اكسس دينايد (Access Denied) ميده.
 

Norik

Active Member
astonishization گفت:
دوست عزيز من نميدونم شما از چه براوزري استفاده ميكنيد كه ميگيد اجرا ميشه پلي من از اينترنت اكسپلورر 6 سرويس پك 2 استفاده ميكنم و وقتي اين فيلو اجرا كنم بهم ارور اكسس دينايد (Access Denied) ميده.
اكسپلورر 6 سرويس پك 1 استفاده ميكنم

کسه ديگه نبود امتحان بکنه؟
 

astonishization

New Member
دمش گرم!

داداش دمت گرم! :p
از اينكه اين اسكريپت روي براوزر شما اجرا شده خيلي خوشحال شدم. من فكر ميكنم شما سكيوريتي كامپيوترتون رو يه جوري كمش كردين. اگه در اين زمينه با من موافق نيستيد پيشنهاد ميكنم بريد به: About Cross-Frame Scripting and Security
اگه یه زحمتی بکشی و بگی چه جوری شده که براوزر شما این security restriction رو اعمال نمیکنه خیلی ازت ممنون میشم.
 

astonishization

New Member
دمش گرم!

داداش دمت گرم! :p
از اينكه اين اسكريپت روي براوزر شما اجرا شده خيلي خوشحال شدم. من فكر ميكنم شما سكيوريتي كامپيوترتون رو يه جوري كمش كردين. اگه در اين زمينه با من موافق نيستيد پيشنهاد ميكنم بريد به: About Cross-Frame Scripting and Security
اگه یه زحمتی بکشی و بگی چه جوری شده که براوزر شما این security restriction رو اعمال نمیکنه خیلی ازت ممنون میشم.
اينم بخشهايي از اون صفحه:
[align=left:3c063ded9c]
With Dynamic HTML (DHTML), content in different windows and frames can interact in powerful ways by scripting with the object model. However, since a browser can simultaneously display unrelated documents in its various windows and frames, certain rules must be enforced to protect data integrity and privacy of information


For most content, only interactions with content from the same domain are allowed. For example


The range of permissible access for a page can be expanded when a script assigns the document.domain property to a suffix of the site name space, up to the second-level domain




Scripts that attempt to access parts of the object model to which they do not have access are blocked with a "permission denied" error



[/align:3c063ded9c]
 

Norik

Active Member
راستش تنظيمات من رو حالت default پيش فرض هستش
برو به tools> internet options> security و همه رو default تنظيم کن
 

AliReza26

Active Member
Re: دمش گرم!

astonishization گفت:
داداش دمت گرم! :p
از اينكه اين اسكريپت روي براوزر شما اجرا شده خيلي خوشحال شدم. من فكر ميكنم شما سكيوريتي كامپيوترتون رو يه جوري كمش كردين. اگه در اين زمينه با من موافق نيستيد پيشنهاد ميكنم بريد به: About Cross-Frame Scripting and Security
اگه یه زحمتی بکشی و بگی چه جوری شده که براوزر شما این security restriction رو اعمال نمیکنه خیلی ازت ممنون میشم.
اينم بخشهايي از اون صفحه:
[align=left:00f14da711]
With Dynamic HTML (DHTML), content in different windows and frames can interact in powerful ways by scripting with the object model. However, since a browser can simultaneously display unrelated documents in its various windows and frames, certain rules must be enforced to protect data integrity and privacy of information


For most content, only interactions with content from the same domain are allowed. For example


The range of permissible access for a page can be expanded when a script assigns the document.domain property to a suffix of the site name space, up to the second-level domain




Scripts that attempt to access parts of the object model to which they do not have access are blocked with a "permission denied" error



[/align:00f14da711]

به احتمال زياد شما از ويندوز server 2003 استفاده ميكني كه بطور پيش فرض high security است.....

بخاطر همين هم اجراي اين اسكريپ را به شما نمي ده.....
 

AliReza26

Active Member
پس يا شما تنظيمات امنيتي را تغيير داديد يا با نصب سرويس پك تنظيمات تغيير داده شده.....
 

جدیدترین ارسال ها

بالا