| |||||||
| المدوّنات | البحث | مشاركات اليوم | اجعل كافة المشاركات مقروءة |
|
| | LinkBack | أدوات الموضوع |
| |
| |||||
| المساعدة في كود جافا تعبت من البحث عنه حتى في المواقع الاجنبية اريد كود جافا يقوم بإغلاق صفحة انا احددها بعنوانها مثلا هذا الكود يقوم بإغلاق الصفحة الحالية window.close(); جربت على هذا الكود بإضافة اسم الصفحة ولم ينفع window.close('up.html'); | |||||
|

| |
| |||||
|
لما لم تأتي الى قسمي، لن اساعدك ![]() الصفحة التي ستغلقها يجب ان تكون قد فتحتها أصلا من موقعك، وعليك ان تعرف اسمها وليس رابطها حتى تغلقها بدلالة إسمها هات لي مثالك | |||||
|
<html>
<head>
<title>JavaScript Window Close Example </title>
</head>
<SCRIPT language="JavaScript1.2">
function popuponclick()
{
my_window = window.open("",
"mywindow","status=1,width=350,height=150");
my_window.document.write('<H1>The Popup Window</H1>');
}
function closepopup()
{
if(false == my_window.closed)
{
my_window.close ();
}
else
{
alert('Window already closed!');
}
}
</SCRIPT>
<body>
<P>
<A href="javascript: popuponclick()">Open Popup Window</A>
</P>
<P>
<A href="javascript: closepopup()">Close the Popup Window</A>
</P>
</body>
</html> | |
| |||||
|
السلام عليكم ورحمة الله وبركاته اخي الكريم يمكنك فعل ذلك ولكن بوضع reference لتلك الصفحة التي تريد اغلاقها على كل حال انا ارفقت لك كود يعمل نفس الطلب.. سكربت يفتح صفحة وسكربت اخر يغلقها كلها بتقنية الجافا سكربت كود: <html>
<head>
<title>JavaScript Window Close Example </title>
</head>
<SCRIPT language="JavaScript1.2">
function popuponclick()
{
my_window = window.open("",
"mywindow","status=1,width=350,height=150");
my_window.document.write('<H1>The Popup Window</H1>');
}
function closepopup()
{
if(false == my_window.closed)
{
my_window.close ();
}
else
{
alert('Window already closed!');
}
}
</SCRIPT>
<body>
<P>
<A href="javascript: popuponclick()">Open Popup Window</A>
</P>
<P>
<A href="javascript: closepopup()">Close the Popup Window</A>
</P>
</body>
</html> وجرب النتيجة اخوكم بيتنا
__________________ http://www.baitona.com msn(at)baitona.com بيتنا... نبدء من حيث وقف الاخرين.. ونتابع الطريق لا نعرف الكلل ولا الملل لا للهدم ونعم للتطوير ومتابعة المسير | |||||
|
<script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}
function CloseNewWin(){if(win!=null && win.open)win.close()}
window.onfocus=CloseNewWin;
// -->
</script>
<input class="button" onclick="NewWindow('up.htm','asaher','40','20','no','center');" type='submit' value=' تحديث '> | |
| |||||
|
اخي Zizwar اعذرني كتب الموضوع وانا مستعجل وفي المرة القادمة سوف اكتبه في قسمك والصفحة اصلاً موجودة هذا هو الكود كامل كود: <script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}
function CloseNewWin(){if(win!=null && win.open)win.close()}
window.onfocus=CloseNewWin;
// -->
</script>
<input class="button" onclick="NewWindow('up.htm','asaher','40','20','no','center');" type='submit' value=' تحديث '> شكرا لك اخي بيتنا والكود تمام نجح معي لكن الصفحة لا تظهر في منتصف الشاشة تحياتي لك | |||||
|
| |
| |||||
|
السلام عليكم صدقا لم انتبه لمشاركة استادنا الفاضل ززوار.. الاخ ززوار متخصص بالجافا سكربت وله اعمال كثيرة في هدا المجال وانا العبد الفقير.. بحثت لك على النت عن ما يلبي حاجتك ولكن الاخ ززوار هو من يملك الخبرة الافضل مني ولن يبخل عليك ان شاء الله اخوكم بيتنا :::::: اخي ززوار.. وينك عن المسنجر؟ عسى اخبارك كلها طيبة.. اللهم امين
__________________ http://www.baitona.com msn(at)baitona.com بيتنا... نبدء من حيث وقف الاخرين.. ونتابع الطريق لا نعرف الكلل ولا الملل لا للهدم ونعم للتطوير ومتابعة المسير | |||||
|

<script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',l ocation=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}
function CloseNewWin(){if(win!=null && win.open)win.close()}
//window.onfocus=CloseNewWin;
// -->
</script>
<input class="button" onclick="NewWindow('http://www.wino.ws','asaher','40','20','no','center');" type='submit' value=' تحديث '><br>
<input class="button" onclick="CloseNewWin();" type='submit' value=' إغلاق '>
| |
| |||||
|
أهلا أخ بيتنا والله زمان، كلنا فقراء الى الله لا أدخل الى المسنجر الا قليلا، والحمد لله اننا رأيناك لى خير يا أخي في هذا الموضوع لم أعطي أخينا سيف جرافيك الا الكلام أما أنت فكان ردك بكود على أي أخي سيف كود الجواب في نفس كودك، لا حظ هذا الكود الذي سأدرج وقارن ماذا غيرت بالتحديد وستعرف ان الحل كان في نفس كودك ![]() كود PHP: | |||||
|
| |
| |||||
|
ما شاء الله عليك اخي زيزور بارك الله فيك شباب الي يكتب جافا على طول يلاقي زيزوار عنده ههههه بيشم ريحة الجافا من بعيد | |||||
|
![]() |
| أدوات الموضوع | |
| |