为本地开发环境编写脚本 'src' url 的正确方法是什么? [英] What is the right way to write my script 'src' url for a local development environment?

查看:119
本文介绍了为本地开发环境编写脚本 'src' url 的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在本地环境中工作,我不确定我是否正确编写了我的 src URl,因为我的功能无法正常工作.粗体脚本标签包含有问题的 src.

I'm working on a local environment and I'm not sure if I've written my src URl correctly because my functions aren't working. The bold script tag has the src in question.

<!DOCTYPE html>
<html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
    <script src="http://www.parsecdn.com/js/parse-1.2.2.min.js"></script>

    **<script src="/Users/myUserName/Desktop/myPage.js"></script>**

    </head>
    <body>
        <div id="mainDiv">
            <p><a href="#">anchor</a></p>
        </div>
    </body>
</html>

推荐答案

将调用js文件的src标签写为

Write the src tag for calling the js file as

<script type='text/javascript' src='../Users/myUserName/Desktop/myPage.js'></script>

这应该可行.

这篇关于为本地开发环境编写脚本 'src' url 的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆