replacing/enhancing head part of html

31 views
Skip to first unread message

Dávid Péter

unread,
Apr 1, 2013, 4:22:50 PM4/1/13
to jaxcen...@googlegroups.com
Hello

I would like to replace the content of the <head> with standard things. Scripts, css etc.
I would like to do it in generic way.


PageHeaderReplacer pageHeaderReplacer = new PageHeaderReplacer(); -> it reads a txt file from the server that stores the full head content.

HtmlElement head = new HtmlElement(this, SearchType.searchByTag, "head");
head.setInnerHTML(pageHeaderReplacer.getHeaderHTML());

It does not replace the content. When I debug it. The head varible shows valid values.

It does not update in the browsers.


Skeleton html head content:

<head>
    <script type="text/javascript" src="/jaxcent21.js"></script>
</head>

My desired version after the replace would be something like this.

<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="David Peter">

<!-- JAXCENT -->
<script type="text/javascript" src="/jaxcent21.js"></script>

<!-- JQUERY -->
<script type="text/javascript" src="/jquery-1.6.4.js"></script>

</head>     

Thank you,
David


Reply all
Reply to author
Forward
0 new messages