I'm wanting to use VaeML in a javascript file. I'm proficient with HTML & CSS but js is not my cup of tea.
I'm wanting to replace '20415 Highland Lake Dr Lago Vista Tx 78645 with a VaeML reference such as . I can't figure out how to do this any help would be greatly appreciated.
jQuery('#map').gMap({
markers: [{
address: '20415 Highland Lake Dr Lago Vista TX 78645',
html: '_address',
popup: false
}],
//controls: false,
//scrollwheel: false,
zoom: 16
});
You can't put VaeML in a javascript file. You can just move that code into your main HTML file and do something like this:<script type='text/javascript'>
jQuery(function() {
jQuery('#map').gMap({
markers: [{
address: '<v=address>',
html: '_address',
popup: false
}],
//controls: false,
//scrollwheel: false,
zoom: 16
});
});
</script>
Or, if you don't want to do that, you could put that text in a DOM element, such as a <div> and then reference it using jQuery from your .js file.
In your HTML:<div id="address"><v=address></div>
In your .js:jQuery('#map').gMap({
markers: [{
address: $("#address").html(),
html: '_address',
popup: false
}],
//controls: false,
//scrollwheel: false,
zoom: 16
});
Awesome Thanks! Couldn't get the dom to work but the other works fine.
It looks like you're new here. If you want to get involved, click one of these buttons!