opendap/src/main/java/opendap/servlet/www/wwwOutPut.java
public static String nameForJsCode(String dodsName) {
        StringBuilder buf = new StringBuilder(dodsName);
        for(int i=0;i<buf.length();i++) {
            char c = buf.charAt(i);
            if(c == '-') buf.replace(i,i+1,"_");
            else if(legal_javascript_id_chars.indexOf(c) < 0) {
                String s = "_"+String.valueOf((int)c)+"_";
                buf.replace(i,i+1,s);
            }
        }
        return "dods_" + buf.toString();
    }
public static String nameForJsCode(String dodsName) {
        StringBuilder buf = new StringBuilder(dodsName);
        for(int i=0;i<buf.length();i++) {
            char c = buf.charAt(i);
            if(c == '-') buf.replace(i,i+1,"_");
            else if(legal_javascript_id_chars.indexOf(c) < 0) {
                String s = "_"+String.valueOf((int)c)+"_";
                buf.replace(i,i+1,s);
            }
        }
        return "dods_" + buf.toString();
    }
public static String nameForJsCode ( String dodsName ) { StringBuilder buf = new StringBuilder ( dodsName ) ; for ( int i = 0 ; i < buf . length ( ) ; i ++ ) { char c = buf . charAt ( i ) ; if ( c == ' ' ) buf . replace ( i , i + 1 , "_" ) ; else if ( legal_javascript_id_chars . indexOf ( c ) < 0 ) { String s = "_" + String . valueOf ( ( int ) c ) + "_" ; buf . replace ( i , i + 1 , s ) ; } } return "dods_" + buf . toString ( ) ; }
Changed 4/28/10 dmh: legal dods names are not same as legal javascript names, so translate.
Changed 4 / 28 / 10 dmh : legal dods names are not same as legal javascript names so translate .