Using Javascript in Plugins

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 anos atrás
I am writing a plugin which will be a widget. It will have some Javascript in PublicInfo.cshtml page which will be shown the actual customers.  But I wonder where to put the Javascript files; in the plugin itself within a folder or in Nop.Web? If I put the JS in the plugin what should I do next?

Thanks,
11 anos atrás
Put it in a folder (content, scripts whatever) in the plugin and then use AppendScriptParts, like this:

@{
    Layout = "";
    Html.AppendCssFileParts( @Url.Content( "~/Plugins/Widgets.PluginName/Content/whatever.css" ) );
    Html.AppendScriptParts( @Url.Content( "~/Plugins/Widgets.PluginName/Content/whatever.js" ) ) ;
}
11 anos atrás
That was quick. Thanks for the answer.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.