javascriptasp.netrunatserverrunat

Can it call the js file from another server in JavaScript option runat="server"?


Is it possible to use next exsample?

In A.asp of [A server], to use runat="server" src="[B server]/js/script.js"

I would like to use javascript imported from other server in asp code


Solution

  • runat="server" converts the asp part to standard HTML and then sends it across to the browser. So that is not something you can do. But if you want to use javascript from a different server, look into CORS