Add a script tag to HTML with JSoup preserve path tags

Posted by Bhuvnesh Pratap on Stack Overflow See other posts from Stack Overflow or by Bhuvnesh Pratap
Published on 2012-11-28T05:01:41Z Indexed on 2012/11/28 5:04 UTC
Read the original article Hit count: 252

Filed under:
|
|
|

I am adding a new script tag to my DOM with JSoup like this :

rootElement.after("<script src='<?=base_url()?>js/read.js'></script>")

but what I end up getting is this :

<script src="&lt;?=base_url()?&gt;js/read.js"></script>

I intend to preserve this

"<?=base_url()?>" and achieve something like:
<script src="<?=base_url()>js/read.js"></script>    

string here , How could I do this ?

© Stack Overflow or respective owner

Related posts about html

Related posts about Web