It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

It works with JQuery, but not AJS Edited

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?

1 answer

1 accepted

0 votes
Answer accepted

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

5,966 views 4 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you