Want to install 'src' from a script on my IP-Won't download in Safari or Chrome. Relative Asp.netmvc Link

I have a script that links to the server I'm hosting (IP may change), as a rule, I would simply use for links:

 var url ='http://' + window.location.hostname + 'end of url';

But in this case it is not so simple.

I tried: (1)

$('#scriptid').attr('src', url);

as well as: (2)

var script = document.createElement( 'script' );
script.type = 'text/javascript';
script.src = url;
$("#insert").append( script );

Now register (2) loads the script running the script. But when at the end of my script it falls into the "data record", it decides to replace the entire page with only data.

Any idea on how I can do this?


Note: I use simple html, not ASP. With an ASP server, this is exactly how it should be.

now this

<script src="myscript.js"></script>

WITH#

router.AddAsyncRoute("myscript.js"......

IE FF. Chrome Safari. document.write script .

, Chrome Safari ?

, Crhome Safari script, document.write DOM, .

, ? , appenChild , script . , , ...


, . - document.write. , , , , Skype 80, Safari Chrome, FF IE skype. skype 80

<script src="myscript.js"></script>

&

router.AddAsyncRoute("myscript.js"......

^^

, - , ( ), 'src' script ?

+3
1

( , IP). script, . - .. , script my_script.js, src="http://...my_script.js" use src="my_script.js".

+2

Source: https://habr.com/ru/post/1745743/


All Articles