PDA

View Full Version : سوال: window.Navigate در javaScript با بروزرهای فایر فاکس اجرا نمی شه



yasmohamadi
چهارشنبه 21 مرداد 1394, 10:04 صبح
چرا window.Navigate در javaScript با بروزرهای فایر فاکس اجرا نمی شه اما دربروزر اینترنت اکسپلورر اجرا می شه
جایگزینش این برنامه برای اجرا در فایر فاکس چیه ؟
ممنون می شم جواب بدید.

<input type="submit" name="Button" value="New Student" onclick="window.navigate('newstudent.php');"

bersam
چهارشنبه 21 مرداد 1394, 20:34 عصر
داداش حد اقل یه سرچ بکن
http://stackoverflow.com/questions/1112093/button-javascript-works-on-ie-but-not-firefox-window-navigate


<input type="button" value="Back" onclick="window.location.href='http://www.google.com';">

yasmohamadi
چهارشنبه 21 مرداد 1394, 22:43 عصر
دوست عزیز این کد رو امتحان کردم اما جواب نمی ده و همچنان باتن در بروزر اکسپلورر کار می کنه در فایر فاکس و کروم هیچ تغییری نمی کنه



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<p>
<?php
$filename="db.txt";
$content = file_get_contents($filename);
$students = explode("#",$content);
$students_count = count($students);

?>
</p>
<input type="submit" name="Button" value="New Student" onclick="window.navigate('newstudent.php');"/>

<p><p>
<table width="300" border="1" cellpadding="1" style="border:solid">
<tr>
<td>ID</td>
<td>FirstName</td>
<td>LastName</td>
</tr>
<?php
for($i =0;$i<$students_count;$i++)
{
$info = explode("|",$students[$i]);
?>
<tr>
<td><?php print($info[0]);?></td>
<td><?php print($info[1]);?></td>
<td><?php print($info[2]);?></td>
</tr>
<?php
}
?>
</table>
<p>&nbsp;</p>
</body>
</html>


این هم همه ی صفحه با اف 12 هم نگاه کردم اصلا کد رو نشون نمی ده البته به زبان phpاست فقط اون قسمت اشکال دار مربوط به جاوا اسکریپت

SCoder
شنبه 24 مرداد 1394, 21:44 عصر
دوست عزیز من اینو تو firefox امتحان کردم جواب میده ....








<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Default</title>
<meta http-equiv="content-type" content="text/xml;charset=utf-8"




/>
<meta name="keywords" content="" />
<meta name="language" content="Farsi" />
<link rel="icon" href="" type="image/jpeg" />
<link rel="shortcu icon" href="" type="image/jpeg" />
<link rel="stylesheet" type="text/css" href="" />
<script type="text/javascript" src="/js/jquery-




1.11.1.min.js"></script>
<style type="text/css"></style>
<script type="text/javascript">
//<=!=[=C=D=A=T=A=[//this line if for xhtml validation

//]=]=>
</script>
</head>
<body>
<input type = 'submit' name = 'Button' value ='click me'
onclick ='javascript:location.href = "sample.php";' />
<!-- you can put every path in the double quotes -->
</body>
</html>

yasmohamadi
یک شنبه 25 مرداد 1394, 15:52 عصر
چرا window.Navigate در javaScript با بروزرهای فایر فاکس اجرا نمی شه اما دربروزر اینترنت اکسپلورر اجرا می شه
جایگزینش این برنامه برای اجرا در فایر فاکس چیه ؟
ممنون می شم جواب بدید.
جوابش رو پیدا کردم از این قطعه کد استفاده کنید به جای قبلی جواب می ده

onclick="window.location.assign('./newstudent.php')