Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Using Rhino and E4X to generate HTML?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
chris.double@gmail.com  
View profile  
 More options Jun 5 2006, 7:18 am
Newsgroups: mozilla.dev.tech.js-engine
From: "chris.dou...@gmail.com" <chris.dou...@gmail.com>
Date: 5 Jun 2006 04:18:49 -0700
Local: Mon, Jun 5 2006 7:18 am
Subject: Using Rhino and E4X to generate HTML?
I thought E4X might be useful to generate HTML or XHTML pages but I've
struck a small problem involving the <SCRIPT> tag and was wondering if
anyone could offer suggestions or a workaround.

Most browsers seem to want the SCRIPT tag to have an explicit closing
tag:

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

E4X will generate this as <script type="text/javascript"
src="somefile.js"/> which gets ignored by some browsers.

Is it possible to force the generation of the closing tag? Or get E4X
to print it's output in compatible HTML instead of XML?

Chris.
--
http://www.bluishcoder.co.nz


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Honnen  
View profile  
 More options Jun 5 2006, 7:44 am
Newsgroups: mozilla.dev.tech.js-engine
From: Martin Honnen <mahotr...@yahoo.de>
Date: Mon, 05 Jun 2006 13:44:34 +0200
Local: Mon, Jun 5 2006 7:44 am
Subject: Re: Using Rhino and E4X to generate HTML?

chris.dou...@gmail.com wrote:
> I thought E4X might be useful to generate HTML or XHTML pages but I've
> struck a small problem involving the <SCRIPT> tag and was wondering if
> anyone could offer suggestions or a workaround.

> Most browsers seem to want the SCRIPT tag to have an explicit closing
> tag:

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

> E4X will generate this as <script type="text/javascript"
> src="somefile.js"/> which gets ignored by some browsers.

Don't generate XHTML and send it to browsers that do not understand
XHTML. If you send XHTML written according to XML rules to browsers like
IE which only understand HTML parsed as text/html then you are in
trouble. That is why the XHTML 1.0 specification does not only specify
the XHTML rules but also has an appendix on how to author XHTML in a way
to be backwards compatibe with text/html user agents. I don't think E4X
has any mode to support that appendix so it is not suitable to generate
HTML.

--

        Martin Honnen
        http://JavaScript.FAQTs.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
biju  
View profile  
 More options Jun 6 2006, 12:34 am
Newsgroups: mozilla.dev.tech.js-engine
From: "biju" <bijumaill...@yahoo.com>
Date: 5 Jun 2006 21:34:20 -0700
Local: Tues, Jun 6 2006 12:34 am
Subject: Re: Using Rhino and E4X to generate HTML?
try following code (a js comment  between script tag)

mypage = <html>
<head>
<title>HTML using E4X</title>
<script type="text/javascript" src="somefile.js">/* */</script>
</head>
<body>HTML using E4X with a script tag
</body>
</html>

or till https://bugzilla.mozilla.org/show_bug.cgi?id=337018
fixed you can use, (a space between script tag)

mypage = <html>
<head>
<title>HTML using E4X</title>
<script type="text/javascript" src="somefile.js"> </script>
</head>
<body>HTML using E4X with a script tag
</body>
</html>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »