I am embedding a SVG drawing into a HTML page. There are several javascript function within the SVG that I need to run. There are several variables that the SWG functions need to access also which are external to the embeded SVG (i.e. in a javascript section within the HTML). How do I "get at" the functions in the SVG from the javascript within the HTML and how do I access the variable (they were set up as global) from the javascript within the SVG?
The javascript variables are here in the HTML.
The HTML side call to the SVG javascript function.
The SVG side javascript function I need to call.
This function is just a test to try to gain access to it from the HTML. When that is solved this function will need access to the array variable, shown above.
Can anybody help?
The javascript variables are here in the HTML.
Code:
<script type='text/javascript'>
var js_u_num = new Array($js_u_num);
var js_u_stat = new Array($js_u_stat);
var js_u_size = new Array($js_u_size);
var js_u_desc = new Array($js_u_desc);
</script>
The HTML side call to the SVG javascript function.
Code:
<body onLoad='setcolors()'>
The SVG side javascript function I need to call.
Code:
function setcolors() {
for(Idx = 0; Idx <= $Idx; Idx++) {
document.getElementById('2A').setAttributeNS(null,'fill','rgb(152,206,250)');
}
}
Can anybody help?