简体   繁体   中英

Is it possible to load javascript file with http://localhost as the source?

Is it possible to load a JavaScript file with http://localhost as the source?

ex:

<script type="text/javascript" src="http://localhost:8081/signalr/hubs" language="javascript"></script>

I am using a script like this in my asp.net web application. It is working properly when running locally on my computer.

Once I put the web application onto a live server and I access the page that has the above script, the GET for that script returns status "aborted". Is it possible to use this reference when accessing the website externally?

Note*: http://localhost:8081/signalr/hubs has a javascript script called Hubs.js. Navigating to it from a browser on the server displays the script.

localhost means the current computer.
It only means your server if the browser is on the same computer as the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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