简体   繁体   English

Beaglebone本地jQuery文件未加载

[英]Beaglebone Local jQuery Files not Loading

I'm working on a wireless robotics project utilizing node.js and jquery to create a webpage "controller". 我正在使用node.js和jquery来创建网页“ controller”的无线机器人项目。

Currently, my code is as below, however its functionality is limited to working with an internet connection due to the downloading of the scripts through the internet addresses. 目前,我的代码如下,但是由于通过Internet地址下载脚本,其功能仅限于使用Internet连接。 My goal is to allow this to function without internet connectivity 我的目标是允许此功能在没有互联网连接的情况下起作用

<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">


    <!-- jQuery and jQuery Mobile -->
    <link rel="stylesheet"       href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
    <script src="/socket.io/socket.io.js"></script>

In order to try to save these files to the beaglebone locally, I created 3 files: Source1.css Source2.js and Source3.js which are copied and pasted into their respective files from the HTML links in the code above and stored in the same directory as the html and javascript files used for the server. 为了尝试将这些文件保存到本地beaglebone,我创建了3个文件:Source1.css Source2.js和Source3.js,它们从上面的代码中的HTML链接复制并粘贴到各自的文件中并存储在同一文件中目录作为服务器使用的html和javascript文件。

I have edited the code to appear as below 我已编辑代码以显示如下

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">


<!-- jQuery and jQuery Mobile -->
<link rel="stylesheet" href="Source1.css" />
<script src="Source2.js"></script>
<script src="Source3.js"></script>
<script src="/socket.io/socket.io.js"></script>

However when I attempt to start the server using the node command, only the HTML appears to load in the webpage. 但是,当我尝试使用node命令启动服务器时,只有HTML似乎要加载到网页中。 I have attempted changing the charset and including the entire path to the jquery source files with no success. 我尝试更改字符集,并包括jquery源文件的整个路径,但均未成功。 Any help would be greatly appreciated! 任何帮助将不胜感激!

Disconnect from the Internet. 断开与Internet的连接。 Press Ctrl+Shift+I in the Chrome browser to load developer tools, change to the "Network" tab then press F5 to refresh the page. 在Chrome浏览器中按Ctrl + Shift + I加载开发人员工具,更改为“网络”标签,然后按F5刷新页面。 You will see the resources your page loaded (and some it attempted to load). 您将看到页面已加载的资源(以及一些试图加载的资源)。 Sort these results by the Initiator column. 通过“启动器”列对这些结果进行排序。 You will likely find Socket.IO initiated dependencies that failed to load. 您可能会发现Socket.IO启动的依赖项未能加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM