0

I have used below code to append link tag in head section. It is having below behavior 1. I am able to see the attached link tag in firebug but not in page souce 2. my head section belongs to a different jsp file

Can i get some tips on this? Below is the script I have used in body section

<script type="text/javascript">
    var appendHTML= "<link rel='next' href='http://test.com'/>";
    $('head').append(appendHTML);
</script>

Thanks, Abhishek

Alex McMillan
  • 17,096
  • 12
  • 55
  • 88
  • The code seems correct, what should this achieve? – Aramil Rey Jun 05 '15 at 07:03
  • Are you trying to add external resource to the page so that you can consume it? like css styles? – Sherin Mathew Jun 05 '15 at 07:15
  • 1. Perfectly normal, you're adding this tag through javascript, it won't appear in the source as it is not actually in the source, although it ends up in the DOM after having ran that script. 2. So what ? – Laurent S. Jun 15 '15 at 07:39

1 Answers1

0

You are not alone witch such kind of task on SO. Try to find around and you will see same themes - How to load up CSS files using Javascript?

Community
  • 1
  • 1
RredCat
  • 5,259
  • 5
  • 60
  • 100