Not sure if this is possible or not, but here is my scenario:
In about 10 of our aspx files, we have the same javaScript function, I want to remove it from all these pages and put it in the main javaScript file (main.js), which is global for all pages, so it’s easier to maintain, javaScript code on current pages, aspx looks something like this:
var regEx_gaid = <%= regEx["regEx_gaid"] %>;
var regEx_wCard = <%= regEx["regEx_wildCard"] %>;
var regEx_fCss = <%= regEx["regEx_flattenCss"] %>;
var regEx_iCss = <%= regEx["regEx_inlineCss"] %>;
...
function doSomething() {
}
Not sure how to get server-side values for these variables in main.js.
It may also be relevant:
"regEx" inside <%= regEx["regEx_gaid"] %>is a collection of dictionaries on the server side, and "regEx_gain" is the key to access the value of the regEx dictionary.
Thank.
source
share