douchendan0040 2014-03-11 20:22
浏览 47
已采纳

PHP文件中的JavaScript不输出任何内容

I can't find the reason why the below code is not working. It seems like an ordinary "test" alert, but it does not work!

This is a .php file with the following code:

<?php 
require_once('../../usefull/functions');

if(!session->loggedIn)
{ redirect_to("../index.php"); }
?>
<link href="../ssheet.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../scripts/Image.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
    alert("hello");
});
</script><?php

<div id="imagelist"></div>

Thanks in advance!

ANSWER:

It appeared there was a bug in my SelectImage file. An element was called which does not exist on this particular PHP file.

  • 写回答

5条回答 默认 最新

  • duaedf6509 2014-03-11 20:24
    关注

    Your syntax is close, but no cigar. Literally just missing a ). RTM...

    $( document ).ready(function() {
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 深度学习残差模块模型
  • ¥20 两个不同Subnet的点对点连接
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计