I have a set of links on my page and some of them start with /mypath, like this
I need to add a querystring to the links that start this way, so the result is something like
<a href="/mypath/other/stuff?parent=1234"> with the '1234' being the node id of the node we're currently viewing.
I've sucessfully passed the nid into my js file using drupal settings. The only part of this I can't get to work is putting the original link in where you see the second
My code is as follows:
$('a[href^="/mypath/"]').attr('href', attr('href') + '?parent=' + Drupal.settings.nodeinfo.nid);
Instead of that second attr('href') I've tried a number of things and can't figure out what it should be.