JavaScript - A Mystery For Me...
hi all
i am a beginner in java script. sorry due to this question well i am studying jsmap.js javascript from koders web site and i can nof find out what is going on in the jsmap.ja there is the source code like this: var = new jsmap(...) first question can java script instantiate an object? some days later i found that opengts opensource project is using jsmap.js. i also foind that inside that project there is some java files one of them defines the class jsmap second question can javascript instqtiate java objects? if not which technollgy is beeing used in the opengts project that allows javascript to instatiate java classes? thanks a lot alex tilt Similar TutorialsI have a situation where there is a string: m0|18:+:m1|(-3) which is a tracking method for preserving memory references in the following string: 18+(-3) In the user interface of the project I am working on; the user changes the string to: (18+(-3))*8 The object is to revise the memory tracking string to repersent the changes. should be: (m0|18+m1|(-3))*8 Code: //matches = this.getMemVals() // getMemVals() searches the string 'm0|18:+:m1|(-3)' // with regex pattern to find instances of m#|# var matches = new Array() matches[0] = 'm0|18'; matches[1] = 'm1|(-3)'; var currentStateSaved = '(18+(-3))*8'; var glbs = ''; for(i = 0; i < matches.length; i++) { var matRegex = new RegExp(matches[i].substring(matches[i].indexOf('|')+1), 'g'); alert('matReg: '+matRegex); glbs = currentStateSaved.replace(matRegex, matches[i]); } alert('GLBS: '+glbs) // <<< test code The '18' part of m0|18 is not be found in the revised literal string Why? (Has '18' been coverted to a number datatype?) This is the type of problem that drives me up a wall and cost far to much time trying to flush it out Thanks of suggestions, advice JK |