Include JS files in the xhtml file that was included with ui: include

I will explain my question using an example:

outerfile.xhtml:

<h:head>
    <h:outputScript library="js" name="jquery-1.6.2.js" />
    <h:outputScript library="js" name="outer.js" />
</h:head>

<h:body>
    <h:panelGroup id="inner_panel">
      <ui:include src="innerfile.xhtml" />
    </h:panelGroup>
</h:body>

innerfile.xhtml:

<ui:composition ... >
    <h:head>
        <h:outputScript library="js" name="jquery-1.6.2.js" />
        <h:outputScript library="js" name="inner.js" />
    </h:head>

    <h:body>
        <h:panelGroup>
          I Am Text in The Inner File!
        </h:panelGroup>
    </h:body>
</ui:composition>

My questions:

  • Is it possible to declare files jsin an internal file as I did?
  • Do I need (and should I) declare a generic ( jquery-1.6.2.js) in an internal file?
  • What happens if I remove rendering and re-rendering inner_panelusing AJAX? Will internal headers be reloaded?
+5
source share
2 answers

Is it possible to declare js files in an internal file as I did?

. <h:head> include. HTML. :

<html>
  <head>
    <script></script>
  </head>
  <body>
    <head>
      <script></script>
    </head>
    <body>
    </body>
  </body>
</html>

( , , w3-validate, )

innerfile.xhtml:

<ui:composition ... >
    <h:outputScript library="js" name="jquery-1.6.2.js" target="head" />
    <h:outputScript library="js" name="inner.js" target="head" />

    <h:panelGroup>
        I Am Text in The Inner File!
    </h:panelGroup>
</ui:composition>

HTML. , <h:outputScript target="head">, <head> , . HTML, one <h:head> <h:body>, .


( ) (jquery-1.6.2.js) ?

, <h:outputScript>. . , .


, inner_panel Ajax? ?

, target="head". , , . , , . Firebug .

+12

- target = "head" h: outputScript innerfile.xhtml:

<ui:composition ... >
    <h:outputScript library="js" target="head" name="jquery-1.6.2.js" />
    <h:outputScript library="js" target="head" name="inner.js" />
    <h:panelGroup>
       I Am Text in The Inner File!
    </h:panelGroup>
</ui:composition>

, . / , h: outputScript , . , , h: outputScript, javascript.

+1

All Articles