Am new to jQuery and javaScript.
How can I (1) extract a data item and (2) concatenate it to a string below.
This working sample below works and demonstrates how "alexLink" contains the data I want.
window.open(data.node.data.alexLink, "_blank");
I want to take alexLink contents and concatenate them into the following javaScript (call to python) statement. You don't have to know how this link works as I just want the syntax for concatenating the content, which is a URL.
ajax("{{=URL('default', INSUERT_CONTENTS_HERE)}}", [], ':eval');
when I try to view the contents alert(data.node.data.alexLink) I see nothing.
To clarify the problem, I don't want
var = string1.concat(string2)
Instead want the line to read:
"text".concat(string1) + .concat(additional_text)
is that possible in javaScript (not using the "var =")?
thanks,
Alex Glaros
<script type="text/javascript">
$("#alexTree").fancytree({
checkbox: true,
selectMode: 3,
source: {url: tree_url},
dataType: "json",
postProcess: function(event, data){
data.result = convertData(data.response);
},
select: function(event, data) {
ajax("{{=URL('default', 'navigate_to_txonomy_column', vars=dict(specificTaxonomyColumnID=specificTaxonomyColumnID))}}", [], ':eval');
}
});
});
</script>
{{## ajax line above used to be: window.open(data.node.data.alexLink, "_blank");}}
What I have tried:
I've tried using the alert box to show the data but it came up blank.