I have httpmodule in DotNetNuke. How to add a javascript file to this httpmodule?
I tried this, but it didn't work:
string text = "<script type=\"text/javascript\">";
text = ((text + "$(document).ready(function () { alert('worked');" + "if ($('div').hasClass('classa')) {") + string.Format("$(\"#Body\").append(\"<script src='{0}' type='text/javascript'><\\/script>\");", "~/Resources/Rasta/JS/" + "myjs.js") + "}") + "});" + "</script>";
page.RegisterClientScriptBlock("mykey" + Guid.NewGuid().ToString(), text);
and use this code( that worked in another module) but it didn't work too:
ClientResourceManager.RegisterScript(page, page.ResolveUrl("~/Resources/myjss/JS/myjs.js"));
Try this code in your IHttpModule
thanks to Morteza