Javascript external script loading strangeness

后端 未结 4 948
灰色年华
灰色年华 2021-01-16 20:07

I\'m maintaining a legacy javascript application which has its components split into 4 JS files.

They are \"Default.aspx\", \"set1.aspx\", \"set2.aspx\" and \"set3.a

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-16 20:39

    If you could use JQuery you could use the following:

    $.getScript("set1.aspx?v=1234");
    

    This loads the script into the global javascript context. Make sure you set contenttype of the response to "text/javascript".

    Hope this helps...

提交回复
热议问题