如何在我的网站中启用javascript?

如何在我的网站中启用javascript?,javascript,html,Javascript,Html,我正在做一个项目,远程显示P10模块上的数据。我为它创建了网站,但每当我想从我网站上的特定网页检索数据时,我都会遇到下面提到的错误 尝试从网页检索数据时出现的错误 该网页的URL为 函数toNumbers(d){var e=[];d.replace(/(..)/g,函数(d){e.push(parseInt(d,16));将e}函数返回hex(){for(var d=[],d=1==参数。长度和参数[0]。构造函数==数组?参数[0]:参数,e=“”,f=0;fd[f]?“0:”)+d[f]。

我正在做一个项目,远程显示P10模块上的数据。我为它创建了网站,但每当我想从我网站上的特定网页检索数据时,我都会遇到下面提到的错误

尝试从网页检索数据时出现的错误 该网页的URL为


函数toNumbers(d){var e=[];d.replace(/(..)/g,函数(d){e.push(parseInt(d,16));将e}函数返回hex(){for(var d=[],d=1==参数。长度和参数[0]。构造函数==数组?参数[0]:参数,e=“”,f=0;fd[f]?“0:”)+d[f]。toString(16);返回numbere.toLowerCase()}9avar=toNumbers(“F655BA9D0112968DB5900B4B”)=D798B4B(“98344C2EE86C3994890592585B49F80”),c=t数字(“b2a5a77ff21b1f1b4e9b8d9099c2f834”);document.cookie=“u test=“+toHex(slowAES.decrypt(c,2,a,b))+”;expires=Thu,37年12月31日23:55:55 GMT;路径=/“位置。href=”http://haider.paks.pk/test1/newfile.txt?i=1";
此网站需要Javascript才能工作,请在浏览器中启用Javascript或使用支持Javascript的浏览器
我如何才能解决这个问题?如何在编码中启用javascript?我将在哪里实现它

网页的代码为:

索引页(主页)

   <?php
    //include auth.php file on all secure pages
    include("auth.php");
    ?>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Welcome Home</title>
    <link rel="stylesheet" href="css/style.css" />
    </head>
    <body>
    <div class="form">

    <p>Welcome <?php echo $_SESSION['username']; ?>!</p>

    <form action="get_msg.php" method="post">
    <p>Select Department </p>
    <br>
    <select name="dept">
      <option value="cs">CS</option>
      <option value="ee">EE</option>
      <option value="btn">BTN</option>
    </select>
    <p>Enter your message:<br />
    <textarea name="sms" rows="10" cols="40"></textarea></p>

    <p><input type="submit" value="Send it!" onclick="show()"></p>


    </form>
    <script>
    function show() {
        alert("Message send successfully");
    }
    </script>
         <input type="button" name="b1" value="Show History"onclick="location.href='history.php'">


    <p>This is secure area.</p>


    <p><a href="dashboard.php">Dashboard</a></p>

    <a href="logout.php">Logout</a>

    </div>
    </body>
    </html>
<html>
<body>
    <?php

 require_once('db_con.php');
    ?>


<?php

//echo $_POST["sms"];
 //$sms = $_POST["sms"];
session_start();

$_SESSION["favcolor"] = $sms;
//echo $_SESSION["favcolor"];

    //echo $_POST["sms"];
    $sms = $_POST["sms"];
    $dept=$_POST["dept"];
echo $dept;
if($dept=="cs"){
    $sql_query = "INSERT INTO cs VALUES('','$sms')";
if( $sql_query){
header("location:index2.php?deptt=$dept");
}
}
if($dept=="ee"){
    $sql_query = "INSERT INTO ee VALUES('','$sms')";
if( $sql_query){
header("location:index2.php?deptt=$dept");
}
}
if($dept=="btn"){
    $sql_query = "INSERT INTO btn VALUES('','$sms')";
if( $sql_query){
header("location:index2.php?deptt=$dept");
}
}


if(mysqli_query($con,$sql_query))
{ 
}
else
{
echo " Data insertion error.. ".mysqli_error($con);
}

 $sql = "SELECT * FROM message";
$iid=last_insert_id($sql);
echo "here";
echo $iid;

 ?>


</body>
</html>

欢迎回家
欢迎光临

选择部门


反恐精英 EE BTN 输入您的消息:

函数show(){ 警报(“消息发送成功”); } 这是安全区

获取消息页面(从服务器检索已发送消息的页面

   <?php
    //include auth.php file on all secure pages
    include("auth.php");
    ?>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Welcome Home</title>
    <link rel="stylesheet" href="css/style.css" />
    </head>
    <body>
    <div class="form">

    <p>Welcome <?php echo $_SESSION['username']; ?>!</p>

    <form action="get_msg.php" method="post">
    <p>Select Department </p>
    <br>
    <select name="dept">
      <option value="cs">CS</option>
      <option value="ee">EE</option>
      <option value="btn">BTN</option>
    </select>
    <p>Enter your message:<br />
    <textarea name="sms" rows="10" cols="40"></textarea></p>

    <p><input type="submit" value="Send it!" onclick="show()"></p>


    </form>
    <script>
    function show() {
        alert("Message send successfully");
    }
    </script>
         <input type="button" name="b1" value="Show History"onclick="location.href='history.php'">


    <p>This is secure area.</p>


    <p><a href="dashboard.php">Dashboard</a></p>

    <a href="logout.php">Logout</a>

    </div>
    </body>
    </html>
<html>
<body>
    <?php

 require_once('db_con.php');
    ?>


<?php

//echo $_POST["sms"];
 //$sms = $_POST["sms"];
session_start();

$_SESSION["favcolor"] = $sms;
//echo $_SESSION["favcolor"];

    //echo $_POST["sms"];
    $sms = $_POST["sms"];
    $dept=$_POST["dept"];
echo $dept;
if($dept=="cs"){
    $sql_query = "INSERT INTO cs VALUES('','$sms')";
if( $sql_query){
header("location:index2.php?deptt=$dept");
}
}
if($dept=="ee"){
    $sql_query = "INSERT INTO ee VALUES('','$sms')";
if( $sql_query){
header("location:index2.php?deptt=$dept");
}
}
if($dept=="btn"){
    $sql_query = "INSERT INTO btn VALUES('','$sms')";
if( $sql_query){
header("location:index2.php?deptt=$dept");
}
}


if(mysqli_query($con,$sql_query))
{ 
}
else
{
echo " Data insertion error.. ".mysqli_error($con);
}

 $sql = "SELECT * FROM message";
$iid=last_insert_id($sql);
echo "here";
echo $iid;

 ?>


</body>
</html>


我已经解决了这个问题。代码没有问题。唯一导致这个问题的原因是我使用了免费域作为我的网站。当我在付费托管服务上上传相同的文件时,问题得到了解决,我的arduino能够从web服务器检索数据。

请提供一个答案,但这并不意味着没有hat JS将被禁用。这意味着页面已被破坏。您是否尝试将文件重命名为
newfile.html
而不是
newfile.txt
?浏览器将仅将特定类型的文件解析并呈现为网页(实际上由
内容类型
标题驱动,但web服务器通常会根据文件的扩展名进行设置)@JonathanLonowski是的,我先用带标签的.html,然后用带数据的.html(无标签),然后用.txt,但每次我都会出现这个错误。我希望我的网页像这个网页@jj一样,如果页面被破坏了,我该如何解决这个问题?有什么解决办法吗?