0

I'm working with Google Closure. I'm trying to include some html files in another one. Just like A.html import B.html and C.html, but actually, I don't get how to do that.

Can anyone could give some orientation please?

Thx in advance.

Rhigo HR
  • 93
  • 1
  • 1
  • 8

2 Answers2

1

As far as I know you cant "include" html pages like that. The options you got is:

1: use ajax to fetch content

http://docs.closure-library.googlecode.com/git/closure_goog_net_xhrio.js.html

http://www.googleclosure.com/google-closure-ajax/

2: Google closure templates

https://developers.google.com/closure/templates/?csw=1

3: Use a serverside language like php to include your file.

http://www.php.net/manual/en/function.include-once.php

TWL
  • 216
  • 1
  • 4
0

I really don't understand.

1) Have you HTML in JS and u don't know how to join it?

  • try goog.dom.appendChild(parent, child)

2) You don't know how to get it into JS?

  • You have to send it from server, or If I were in your shoes... use soy templates
  • what i mean is that i need to import a html file into another, and i want to know if is there any function in Google Closure to achieve this :) – Rhigo HR Oct 03 '13 at 14:27