Trying to get ajax to set a value in the content properties of a confluence page. This is running in Confluence on our local system ver7.13 - it is _not_ running in Cloud.
See below for a snippet of the code, first off is the code that I'm using to validate the properties in the page, literally dumping the keys and values onto the page.
Second is the javascript/ajax for a button press which should be submitting the value to be checked, or blank depending on the previous state. This is the section of the code that I just cannot get to work!
## @noparams
#foreach ( $item in $content.getProperties().asList() )
Name/Value $item.getName() : $item.getStringValue() , <br>
#end
#set($D='$')
...
..
.
<script type="text/javascript">
AJS.toInit(function(){
AJS.$('#$uiComponent').click(function(){
AJS.${D}.ajax({
type: 'GET',
data: {
submit: 'true',
checkbox: AJS.$(this).attr('id'),
value: AJS.$(this).is(':checked') ? 'checked' : ''
},
url: "$content.getUrlPath()",
success: function(data) {
console.log(data);
},
error: function() {
console.log(data);
}
});
});
});
</script>