I am using requireJS for my hybrid app . Now I need to change the script tag located into my layout page with conditions on url . The script tag looks something like this
<script data-main="@Url.Content("~/Scripts/main")" src="@Url.Content("~/Scripts/Libs/Requirejs/require.min.js")" type="text/javascript"></script>
Now when the page loads the /Home/Login the script tag above should be changed to
<script data-main="@Url.Content("~/Scripts/login")" src="@Url.Content("~/Scripts/Libs/Requirejs/require.min.js")" type="text/javascript"></script>
Again when I load the page /Mail/Index The script tag above should change to
<script data-main="@Url.Content("~/Scripts/mail")" src="@Url.Content("~/Scripts/Libs/Requirejs/require.min.js")" type="text/javascript"></script>
Now Note that All of the three pages uses the same **_Layout.cshtml** page . And the above script tag is located in **_Layout.cshtml** page only .Now how do I track this scripts to change the script tag on change of the Url routing as mentioned above ?