Javascript语句不工作…获取'加载资源'错误
javascript statements not working... and getting 'failed to load resource' error
<?
echo '<html>
<script language=javascript>
function validate()
{
alert("validate");
document.form1.action="validate.php";
document.form1.submit();
return false;
}
function del()
{
alert("delete");
document.form1.action="delete.php";
document.form1.submit();
return false;
}
</script>
<style>
.id
{
background-image:url("http://localhost/troubleshoot/imges/bg1.jpg");
background-position:center;
background-repeat:no-repeat;
background-size:2000px 2000px;
border-radius:5px;
}
table
{
border-radius:5px;
}
.id1
{
border-radius:5px;
background-color:DDDDDD;
}
id3
{
padding-top:5em;
padding-bottom:5em;
height:40px;
}
.id2
{
text-shadow:0px 0px 5px black;
color:#FFFFDD;
font-size:20;
font-style:bold;
}
</style>
<body>
<table width=70% align=center>
<td><img src="http://localhost/troubleshoot/imges/banner.jpg" height=150 width=100% style="border-radius:5px">
</table>
<table width=70% bgcolor=#3E638C align="center" border=0 style="border-radius:5px;" cellspacing=20>
<tr><td align="center"><a href="home.html"><font color=white>Home</a></td>
<td align="center"><a href="about.html"><font color=white>About Us</a></td>
<td align="center"><a href="articles.html"><font color=white>Articles</a></td>
<td align="center"><a href="work.html"><font color=white>Work</a></td>
<td align="center"><a href="contact.html"><font color=white>Contact Us</a></td>
</tr></table>';
$c=mysql_connect("localhost","root","");
mysql_select_db("troubleshoot",$c);
$q=mysql_query("select * from clientbugandsol");
$count=mysql_num_rows($q);
echo "<table width=70% align=center border=1 style='border-radius:5px;'>
<tr><td width=100% align=center> <font face=algerian color='#A52A2A'>There are $count bugs received</tr>
<tr><td>";
$i=1;$j=0;
while($s=mysql_fetch_row($q))
{
echo "<form name=form1 method=post>
<table width=90% bgcolor='#6CDAF5' align=center>
<tr><th align=left> Bug $i: </tr>
<tr><td>Username: <td> <input type=text value='$s[0]' name=username> </td></tr>
<tr><td>User email-id: <td><input type=text value='$s[1]' name=email> </td></tr>
<tr><td>User Contact-no :<td><input type=text value='$s[2]' name=contactno> </td></tr>
<tr><td>Bug: <td><textarea rows=5 cols=40 name=bug>$s[3]</textarea></td></tr>
<tr><td>Bug-Reason: <td><textarea rows=5 cols=40 name=text1>$s[4]</textarea></td></tr>
<tr><td>Bug-Solution:<td><textarea rows=5 cols=40 name=text2>$s[5]</textarea></td></tr>
<tr><td>Updated-date:<td><input type=text value='$s[6]' name=date></td></tr>
<tr><td width=100% align=right colspan=2><input type=submit value='add this bug with main bugs' OnClick='validate()'>
<input type=submit name=delete value='delete this bug' OnClick='del()'></tr>
</table><br></form>";
}
echo '
</body>
</html>';
?>
<html>
</html>
加载资源失败。当执行此代码时,在javascript document.form1中。行动行不通....所以它不会重定向到另一个页面。我要澄清的是…
除了html结构的所有问题之外,我怀疑您遇到的根本问题是浏览器找不到delete.php文件,我假设该文件位于此代码来自的文件所在的同一目录中。虽然在服务器上,这种形式的路径相对寻址可以工作,但一般来说,出于安全考虑,浏览器会阻止从主机文件系统加载文件。
改变你的动作,通过你的本地web服务器(即http://localhost/troubleshoot/delete.php
)访问delete.php,你应该能够加载文件。
相关文章:
- 用于查询错误转换的角度资源返回列表
- "资源不足错误“;当从Chrome控制台重复发出ajax请求时
- 无法加载Angular js中的资源错误
- 否'访问控制允许来源'当跨域设置为true时,请求的资源错误中存在标头
- angular未能加载检查器中的资源错误
- Azure Blob 存储 请求的资源错误中不存在访问控制允许源标头
- 如何在 MSSQL 中调试资源 #6 错误
- 捕获由
中的 HTML 标记导致的“无法加载资源”错误 - 跨源资源错误:请求的资源上不存在“访问控制允许源”标头
- HTML5 视频 - 开始播放后无法加载资源错误
- 如何通过 JavaScript 列出 404 资源错误
- Kibana:无法加载资源 |错误
- 重构angular ng资源错误处理
- Angularjs资源错误:a.push不是一个函数
- Javascript语句不工作…获取'加载资源'错误
- 不允许加载本地资源错误
- 使用css2stylus后,手写笔文件无法加载资源错误
- 在资源错误回调的范围内访问表单
- 无法加载javascript中ajax调用的资源错误
- 加载外部脚本时无法加载资源错误