Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×The following code writes 'undefined' to the console log.
AJS.toInit(function(){
console.log(AJS.$("#spacesLink").prop("href"));
});
The same code in straight JQuery works as expected (note: The anchor element is copied directly from a Confluence page, I just put it in it's own HTML for simplicity)
<head>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<a id="spacesLink" href="/plugins/AttachmentReport/spaces.action?src=spacemenu">Download Attachment Report</a>
<script>
console.log($("#spacesLink").prop("href"));
</script>
</body>
This anchor is in a "drop down" menu (web-item). If that is the issue, how do I work around it?
I have decided to change my design. Instead of trying to use a javascript popup I am just going to create a web page with input fields and a submit button.
But if anyone wants to comment on the original issue (using javascript to modify the href of a drop down web-item), feel free.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.