Example html code (Looks weird but my intention is to show that the outer components can be anything)
<div>
<div/a/p/.. myAttribute="123">
<p>
<a>
<script type="text/javascript">
jQuery.ajax({url: "local.host?attribute= "});
</script>
</a>
</p>
</div/a/p/..>
</div>
What I want is that, from the inner script, before the ajax call is fired, I want to travel to outer parent components, till I can reach the component that has myAttribute. Then I will take the value of myAttribute and fill it into my url as "local.host?attribute= 123"
I found the closest of JQuery, but it requires to know the component type in advanced.
Any help is appreciated. Thank you very much.