title: When injecting html into the DOM, why are js files not obtained?
body: <p>I am initiating an ajax post request from the browser for a login process I am developing. I do some logic to verify the user’s credentials in the backend (asp.net core) and return a view, which is the app "after logon" homepage. I inject this into the DOM. This view I am returning has a script tag that points to an external js file as well as a link tag for css.</p>
  
  <p>My understanding is that the .cshtml file gets rendered and returned to the browser as raw html. The browser then parses this and looks for any link or script tags that have routes to static files and sends get requests for those resources once it is injected into the DOM. </p>
  
  <p>When looking at the networking log in firefox, the login post request is successful, returning the "after logon" page, then a get request for the css is sent and is successful...then nothing... I have my script tag properly named and there are no errors to be found. It should be sending a request for the Js linked in the html. </p>
  
  <p>Because of this problem, I have created a clone application, but instead of implementing this request cycle the SPA way, I implemented it with an MPA architecture in mind. Using an html form to perform the post request. This was indeed successful, and the css and js external files are received.</p>
  
  <p>My ultimate confusion here is why the browser would initiate the request for the css file and not the js file. Is there some black magic that’s being done client side or server side that is making this happen? It obviously has something to do with an Ajax request being utilized, or even with the fact that I am injecting raw html into the DOM. </p>
  
  <p>I understand there may be some backlash on using a login page that is fully integrated with SPA architecture, so
  <a href="https://www.reddit.com/r/webdev/comments/9bux27/what_are_the_security_drawbacks_of_integrating_a/?st=JME8QVPI&amp;sh=e6eb1a2a" rel="nofollow noreferrer">here is why I think it’s perfectly fine.</a></p>
  
  <p>Anyways, Thanks for anyone who can provide some insight. Apologies for any ignorance I carry along with this question. Just trying to learn. </p>