I'm having some trouble with my script tag. I'm trying to include a
piece of PHP text via the script tag by doing so:
<script src="http://pinata.no-ip.org/~altmarvel/Scripts.php"></script>
This produces nothing, but I don't know why. I've even gone so far as
to make it as simple as putting a simple HTML string inside
Scripts.php, which it refuses to print out. Yet, this refuses to print
anything out.
I've gotten some sample code from some 80s toy site, and the string
they use which works is:
<script src="http://www.seibertron.com/news/include_news.php"></script>
I have no clue what the difference between these two strings is, and
it's infuriating. Does anybody know? Is there a PHP switch or
something? 14 3380 li***************@yahoo.com (Liam Gibbs) wrote: I'm having some trouble with my script tag. I'm trying to include a piece of PHP text via the script tag by doing so:
<script src="http://pinata.no-ip.org/~altmarvel/Scripts.php"></script>
This produces nothing, but I don't know why.
Browsers don't ordinarily know how to execute PHP. Even if they did,
you would have to *tell* them that the script is going to be PHP by
using the SCRIPT tag's TYPE attribute. If you're using a browser that
doesn't disqualify the SCRIPT tag altogether for omitting the required
TYPE attribute, it expects Javascript when no type is given
explicitly.
I've even gone so far as to make it as simple as putting a simple HTML string inside Scripts.php, which it refuses to print out. Yet, this refuses to print anything out.
I've gotten some sample code from some 80s toy site, and the string they use which works is:
<script src="http://www.seibertron.com/news/include_news.php"></script>
What site? URL?
--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Liam Gibbs wrote: I'm having some trouble with my script tag. I'm trying to include a piece of PHP text via the script tag by doing so:
<script src="http://pinata.no-ip.org/~altmarvel/Scripts.php"></script>
PHP is a server-side language interpreter.
I suppose you could try giving a "type" value, something like
type="text/php". I have no clue what the difference between these two strings is, and it's infuriating. Does anybody know? Is there a PHP switch or something?
Do you know what PHP is?
--
jmm dash list at sohnen-moe dot com
(Remove .TRSPAMTR for email)
Liam Gibbs wrote: I'm having some trouble with my script tag. I'm trying to include a piece of PHP text via the script tag by doing so:
<script src="http://pinata.no-ip.org/~altmarvel/Scripts.php"></script>
You appear not to know what PHP is. http://www.php.net/tut.php http://www.php.net/manual/en/
--
Mark.
Liam Gibbs wrote:
<snip> <script src="http://pinata.no-ip.org/~altmarvel/Scripts.php"></script>
<snip> <script src="http://www.seibertron.com/news/include_news.php"></script>
If you enter:-
view-source: http://pinata.no-ip.org/~altmarvel/Scripts.php
- and:-
view-source: http://www.seibertron.com/news/include_news.php
- into the location/address bar of a web browser to view the material
actually being sent to the browser you will find that the first is
returning a fragment of HTML, while the second is returning valid
javascript source code.
The second works because the browser's javascript interpreter is able to
understand and execute javascript source code, while its interpretation
of an HTML fragment will be as a series of javascript syntax errors, and
it will terminate its attempt to execute the script at the first it
encounters.
Richard.
"Liam Gibbs" <li***************@yahoo.com> a écrit dans le message de
news:62**************************@posting.google.c om I'm having some trouble with my script tag. I'm trying to include a piece of PHP text via the script tag by doing so:
<script src="http://pinata.no-ip.org/~altmarvel/Scripts.php"></script>
This produces nothing, but I don't know why.
What are your exacts needs ?
If you want to include text produce by another web page, then <script
src...> is one of the solutions. Please read the recent thread
"Templates/inclusion in the new age" : http://www.google.fr/groups?hl=fr&lr...com%26rnum%3D1
If you choose to use script, then your php page should send to the browser
correct mime type and javascript code (document.write(...) )
Pierre Goiffon wrote:
<snip> ... , then your php page should send to the browser correct mime type and javascript code (document.write(...) )
There is no correct mime type for client-side javascript source.
Browsers appear to ignore content type headers sent in the context of
script elements.
Richard. li***************@yahoo.com (Liam Gibbs) wrote in message news:<62**************************@posting.google. com>... I'm having some trouble with my script tag.
You're unclear about the differences between server-side and
client-side scripting.
PHP is server-side only. <script> is client-side only.
_If_ your PHP code's function is to _make_ a client-side script
(sometimes called "meta-scripting"), then you might have a client-side
<script> that refers to a piece of server-side PHP. But what the
<script> element is referring to is the _output_ of the PHP script,
not its source code.
Ahhh.... I'm starting to see now. I was familiar with PHP, but not
with the SCRIPT tag. What I thought it would do is run the PHP on my
server, my server would spit the output to that page, and.... then a
whole bunch of stuff I was unclear about. I guess I have more muddling
to do now with JavaScript and so forth.
And I was unaware of the view-source thing. I'll also try that type
value.
Thanks all!
On Tue, 8 Jun 2004 13:04:06 -0500, kaeli <ti******@NOSPAM.comcast.net>
wrote: Well, there _is_ a <script runat="server"> for ASP.
I was hoping no-one would mention that - let's not confuse the poor
guy, OK ?
"Richard Cornford" <Ri*****@litotes.demon.co.uk> a écrit dans le
message de news:ca*******************@news.demon.co.uk There is no correct mime type for client-side javascript source. Browsers appear to ignore content type headers sent in the context of script elements.
Yes, it seems there are not any "official" mime type meant to serve
JavaScript. But are you sure any mime type would fit in any browser ? I was
unclear about that, but unfortunatly haven't got enough time to test
yesterday evening.
In fact in a previous job we used JavaScript for external inclusion, these
JavaScript source were generated through ASP pages. As far as I can remember
we choosed to send something like application/x-javascript because some
browsers (probably NS4) absolutly wanted something different from the
default ASP text/html.
Her, I guess I'll test this evening...
James Moe wrote: PHP is a server-side language interpreter. I suppose you could try giving a "type" value, something like type="text/php".
The type should match the MIME type of the scripting language used.
Whether the client-side scripting code (most probably Javascript code)
is a static file with a .js extension, or generated by PHP script on the
server, should not and does not matter to the browser.
The problem is that http://pinata.no-ip.org/~altmarvel/Scripts.php does
not return Javascript code but returns text/html, and no content.
--
Klaus Johannes Rusch Kl********@atmedia.net http://www.atmedia.net/KlausRusch/
Pierre Goiffon wrote: Richard Cornford wrote: There is no correct mime type for client-side javascript source. Browsers appear to ignore content type headers sent in the context of script elements. Yes, it seems there are not any "official" mime type meant to serve JavaScript.
After nine years of Internet javascript use it really feels like there
should be an official mime type doesn't it?
But are you sure any mime type would fit in any browser ?
I don't have access to all 40-odd javascript capable user agents, and it
was a couple of years ago that I tested this, but at the time I could
not get any browsers to refuse to handle JSP generated javascript as
javascript when sent with any of content-type header from a range that
included types that the browser would have had an attitude towards in
other contexts, unusual and very wrong types, and fictional mime types.
The browsers don't seem to care.
But how could they? Something isn't wrong until you judge what would be
right.
I was unclear about that, but unfortunatly haven't got enough time to test yesterday evening.
In fact in a previous job we used JavaScript for external inclusion, these JavaScript source were generated through ASP pages. As far as I can remember we choosed to send something like application/x-javascript because some browsers (probably NS4) absolutly wanted something different from the default ASP text/html. Her, I guess I'll test this evening...
Yes, that is exactly what happened to me. I was generating javascript
with JSP and a senior colleague told me to send text/javascript headers
with it, so I did. Later I was told on Usenet that it was nonsense so I
tried it out for myself and discovered that it was nonsense.
My experiment definitely included sending the content as text/html and
(Windows) Netscape 4 was among the test browser used. Also, in a couple
of years of regularly contributing to comp.lang.javascript, I have not
yet seen a javascript problem actually attributed to a content type
header on any browser or platform.
If you can find a browser that cares I would like to hear about it.
Richard.
Richard Cornford wrote: There is no correct mime type for client-side javascript source.
But are you sure any mime type would fit in any browser ?
I was generating javascript with JSP and a senior colleague told me to send text/javascript headers with it, so I did. Later I was told on Usenet that it was nonsense so I tried it out for myself and discovered that it was nonsense.
Err well I guess I could now get exactly the same conclusion as you did.
Thanks a lot for your posts, I learnt something new ! Usenet is cool :)
--
Pour me répondre par mail privé, merci de supprimer _NOSPAM_ de mon
adresse.
Un grand merci à OE Quote Fix pour rendre OE utilisable :)
=> http://home.in.tum.de/~jain/software/oe-quotefix/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mike Daniel |
last post by:
I am attempting to use document.write(pageVar) that displays a new html page
within a pop-up window and the popup is failing. Also note that pageVar is
a complete HTML page containing other java...
|
by: bayouprophet |
last post by:
Cant get menu script to to put linked page in the same frame. I am
new to Java
and I am wondering what am I doing wrong? below are my java applet
file, frame.html file, and my text file and one...
|
by: Allen |
last post by:
I am trying to add an additional photo/hyperlink to the company web
site (I didn't create it) without any luck. The mouseover feature
'highlights' pics by swapping them with another pic using this...
|
by: Water Cooler v2 |
last post by:
Questions:
1. Can there be more than a single script block in a given HEAD tag?
2. Can there be more than a single script block in a given BODY tag?
To test, I tried the following code. None...
|
by: bilaribilari |
last post by:
Hi all,
I am using Tidy (C) for parsing html pages. I encountered a page that
has some script as follows:
<script>
....
var abc = "<script>some stuff here</" + "script>";
....
</script>
| |
by: thisis |
last post by:
Hi All,
i have this.asp page:
<script type="text/vbscript">
Function myFunc(val1ok, val2ok)
' do something ok
myFunc = " return something ok"
End Function
</script>
|
by: rsteph |
last post by:
I have a script that shows the time and date. It's been working on my site for quite a while now. Suddenly it stops showing up, after getting my drop down menu to work.
If I put text between the...
|
by: Angus |
last post by:
I have a web page with a toolbar containing a Save button. The Save
button can change contextually to be a Search button in some cases.
Hence the button name searchsavechanges.
The snippet of...
|
by: imtmub |
last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted.
Check this page for reference....
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Many websites have a form or a link you can use to download a file. You click a form button or click...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |