Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Queston on script tag

Reply
Thread Tools

Queston on script tag

 
 
Toby A Inkster
Guest
Posts: n/a
 
      02-11-2008
Torben Keil wrote:

> But I whish to embedd the produced HTML code of the perl script in the
> website.


The <script> element can *only* be used to include content in a supported
client-side scripting language (usually Javascript, though Internet
Explorer supports VBScript, and some experimental browsers and plugins
support other client-side scripting languages).

Other content (e.g. images, HTML, spreadsheets, Java applets, etc) cannot
be included with <script>. They should be included using <object> instead.
There are several other elements which are similar to <object> which may
be used in preference to <object> is certain circumstances:

* <img> is better supported for images
* <applet> has better backwards compatibility for Java applets
* Ditto <iframe> for text/html and text/plain

So your code should be along these lines:

<iframe type="text/html" charset="ISO-8859-1"
src="http://....../cgi-bin/code.pl"></iframe>

or:

<object type="text/html" charset="ISO-8859-1"
data="http://....../cgi-bin/code.pl"></object>

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 12 days, 18:08.]

Mince & Dumplings
http://tobyinkster.co.uk/blog/2008/0...nce-dumplings/
 
Reply With Quote
 
 
 
 
Torben Keil
Guest
Posts: n/a
 
      02-11-2008
Hi Toby,

thanks for your answer. I'll test the object tag.

Greetings,
Torben
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      02-12-2008
On 11 Feb, 07:54, Torben Keil <(E-Mail Removed)> wrote:

> But I whish to embedd the produced HTML code of the perl script in the website.


In that case, assemble _all_ the content server-side and serve it as
one single, simple HTML document.

You could assemble thing client-side, using either <iframe> or
<object>. <object> is probably preferable (if anyone has hard
evidence against its support, I'd love to know about it). However this
"asks more of the clients", so is always going to be more complicated
to make simple and reliable. Doing it purely server-side is nice and
simple from the client's viewpoint, thus safe & reliable.

PS - Web scripting has moved on a _lot_ from Perl and CGI. Lots of
better ways out there these days.
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      02-12-2008

"Torben Keil" <(E-Mail Removed)> wrote in message
news:47afff4e$0$2302$(E-Mail Removed)-online.net...
> Andy Dingley wrote:
>
>> [...]
>> "text/html" is a perfectly legitimate MIME content-type, as usually
>> served through a HTTP header. It means HTML though, not JavaScript, so
>> it's the wrong value in this case. The OP should use "text/javascript"
>> instead, because the content that his Perl script is producing is
>> intended to be JavaScript.

>
> My Perl-Script returns clean HTML code. That's why I decided to use
> "text/html" as MIME type. And using "application/JavaScript" is working
> when I'm linking to JavaScript code on the remote server.
>
> But I whish to embedd the produced HTML code of the perl script in the
> website.


I've been watching this thread for a while waiting for someone to tell you
what you are doing wrong

You seem to be wanting to include a fragment of HTML (be it generated by a
Perl script or whatever) using the script element, specifying in the src
attribute your fragment of HTML (be it generated by a Perl script or
whatever).

Well, this is not going to happen. The script element is for linking in
script, usually javascript. Not HTML fragments.

The browser, when it sees a script element gathers the content of that
element and hands it over to the scripting engine. It will not, ever,
"include" that content as an HTML fragment, no matter what mime type you
specify.

Just like the content of a style element is handed over to the CSS parser.

Andy has it right. This sort of including of HTML fragments is done server
side, possibly by using a Perl script to generate the entire page, including
bits and pieces as you see fit. This is not done client side.

You *could* in your script element specify a bunch of javascript that does
document.writes of some HTML but you really don't want to do that in this
century

--
Richard.


 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      02-12-2008
rf wrote:
> "Torben Keil" <(E-Mail Removed)> wrote in message
> news:47afff4e$0$2302$(E-Mail Removed)-online.net...
>> Andy Dingley wrote:
>>
>>> [...]
>>> "text/html" is a perfectly legitimate MIME content-type, as usually
>>> served through a HTTP header. It means HTML though, not JavaScript, so
>>> it's the wrong value in this case. The OP should use "text/javascript"
>>> instead, because the content that his Perl script is producing is
>>> intended to be JavaScript.

>> My Perl-Script returns clean HTML code. That's why I decided to use
>> "text/html" as MIME type. And using "application/JavaScript" is working
>> when I'm linking to JavaScript code on the remote server.
>>
>> But I whish to embedd the produced HTML code of the perl script in the
>> website.

>
> I've been watching this thread for a while waiting for someone to tell you
> what you are doing wrong
>
> You seem to be wanting to include a fragment of HTML (be it generated by a
> Perl script or whatever) using the script element, specifying in the src
> attribute your fragment of HTML (be it generated by a Perl script or
> whatever).
>
> Well, this is not going to happen. The script element is for linking in
> script, usually javascript. Not HTML fragments.


You waited too long. I explained this to him four days ago and then
again yesterday. Have you plonked me?
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      02-12-2008
In article <(E-Mail Removed)>,
Harlan Messinger <(E-Mail Removed)> wrote:

> rf wrote:


> > I've been watching this thread for a while waiting for someone to tell you
> > what you are doing wrong

>
> You waited too long. I explained this to him four days ago and then
> again yesterday. Have you plonked me?


I don't think so, those kf's I am not forced into, I sometimes
visit voluntarily (something I do a bit, a bit like a layman
prison visitor, to see that the inmates are not being ill treated
too badly) and you were not there last time I visited rf's. He
has some pretty rough characters in there and I was glad to get
out. (No, he does not ill treat them, he is strict but fair; that
is from my official diary and report in case you are curious).

Boy, I could tell you some stories about kfs!

--
dorayme
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      02-12-2008
dorayme wrote:
> In article <(E-Mail Removed)>,
> Harlan Messinger <(E-Mail Removed)> wrote:
>
>> rf wrote:

>
>>> I've been watching this thread for a while waiting for someone to tell you
>>> what you are doing wrong

>> You waited too long. I explained this to him four days ago and then
>> again yesterday. Have you plonked me?

>
> I don't think so, those kf's I am not forced into, I sometimes
> visit voluntarily (something I do a bit, a bit like a layman
> prison visitor, to see that the inmates are not being ill treated
> too badly) and you were not there last time I visited rf's. He
> has some pretty rough characters in there and I was glad to get
> out. (No, he does not ill treat them, he is strict but fair; that
> is from my official diary and report in case you are curious).
>
> Boy, I could tell you some stories about kfs!


Ha! Listen, Junior, I can tell *you* stories. Barely had I been on
Usenet, at least 12 years ago, when I found myself on the Vladimir Fomin
Blacklist of Net.Nazis and Sandlot Bullies. The worst kind of social
detritus was in there. It took me years afterwards to reacclimate myself
to life in the outside world.
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      02-12-2008
In article <(E-Mail Removed)>,
Harlan Messinger <(E-Mail Removed)> wrote:

> dorayme wrote:
> > In article <(E-Mail Removed)>,
> > Harlan Messinger <(E-Mail Removed)> wrote:
> >
> >> rf wrote:

> >
> >>> I've been watching this thread for a while waiting for someone to tell
> >>> you
> >>> what you are doing wrong
> >> You waited too long. I explained this to him four days ago and then
> >> again yesterday. Have you plonked me?

> >
> > I don't think so, those kf's I am not forced into, I sometimes
> > visit voluntarily (something I do a bit, a bit like a layman
> > prison visitor, to see that the inmates are not being ill treated
> > too badly) and you were not there last time I visited rf's. He
> > has some pretty rough characters in there and I was glad to get
> > out. (No, he does not ill treat them, he is strict but fair; that
> > is from my official diary and report in case you are curious).
> >
> > Boy, I could tell you some stories about kfs!

>
> Ha! Listen, Junior, I can tell *you* stories. Barely had I been on
> Usenet, at least 12 years ago, when I found myself on the Vladimir Fomin
> Blacklist of Net.Nazis and Sandlot Bullies. The worst kind of social
> detritus was in there. It took me years afterwards to reacclimate myself
> to life in the outside world.


Wow, that does sound like a bad one! Must put it on my list for
an official visit. <g>

--
dorayme
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie's queston on taking pictures Satoshi Digital Photography 15 04-25-2006 02:12 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Queston about the D70 Ted Digital Photography 2 04-18-2004 02:21 AM
Queston about addition in Maxplus II lezah VHDL 7 03-02-2004 06:11 PM
Win XP Queston, How to set up IE for multiple users? Bob Computer Support 5 11-16-2003 03:23 PM



Advertisments