473,468 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mixing inline with external scripts... not working...

Hi Folks:

I'm trying to make a function from a inline script, which is called by
<body'onload' event, calling
an function in a external script, with no success. I'm using XHTML.
I've tried many ways....
Here comes the snippet (without XML prolog and DOCTYPE declaration):

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-br"
lang="pt-br">
<head>
<title>Adiciona e Remove Usuários</title>
<link href="/sispr/css/sispr.css" rel="stylesheet"
type="text/css"/>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"/>
<script type="text/javascript" src="/sispr/js/funcoes.js"/>
<script type="text/javascript" src="/sispr/js/json.js"/>
<script type="text/javascript" src="/sispr/js/admusuario.js"/>
<script type="text/javascript">
//<![CDATA[

var sProgs = [{"progid":"1","loc":"cademp","nome":"Cadastro de
Empresas"},{"progid":"2","loc":"reqcomb","nome":"R equisi\u00e7\u00e3o
de
Combust\u00edvel"},{"progid":"3","loc":"admreqcomb ","nome":"Administra\u00e7\u00e3o
do Requisi\u00e7\u00e3o de Combust\u00edvel"}];

function init () {
admusuario_cadastra_modulo_init (sProgs);
};

//]]>
</script>
<!-- subst -->

</head>
<body onload="init();">

My problem is tha the value of 'sProgs' is generated server side by a
PHP JSON extension... it's an
database table enconded in a array. 'admusuario_cadastra_modulo_init()'
function is in
'admusuario.js' external script.
Javascript console of Firefox 1.0.8 says: 'Error function init() not
defined' :-(
I'd like not using AJAX to get 'sProgs' values.....

Any help? Am I messing things up?

thanks a lot in advance
Lucas Brasilino

Sep 19 '06 #1
8 1816
VK

br*******@yahoo.com wrote:
<script type="text/javascript" src="/sispr/js/funcoes.js"/>
You are serving this page with Content-Type application/xml+xhtml,
right?
(asking before really going inside the code: to sort out the most
obvious options)

Sep 19 '06 #2
Hi
<script type="text/javascript" src="/sispr/js/funcoes.js"/>

You are serving this page with Content-Type application/xml+xhtml,
right?
(asking before really going inside the code: to sort out the most
obvious options)
Oops... no... I didn't see it on XHTML 1.0 specifications...
But I tried to set this header and my Firefox is now trying to
download the page... and I can't see where can I configure
it to render the page, not to download.

bests regards
Lucas Brasilino

Sep 19 '06 #3
Hi:

Let's suppose I've converted it to HTML 4.01. How should be the
<scripttag ?

regards
Lucas Brasilino
Hi
<script type="text/javascript" src="/sispr/js/funcoes.js"/>
You are serving this page with Content-Type application/xml+xhtml,
right?
(asking before really going inside the code: to sort out the most
obvious options)

Oops... no... I didn't see it on XHTML 1.0 specifications...
But I tried to set this header and my Firefox is now trying to
download the page... and I can't see where can I configure
it to render the page, not to download.

bests regards
Lucas Brasilino
Sep 19 '06 #4
br*******@yahoo.com wrote:

[VK:]
>You are serving this page with Content-Type application/xml+xhtml,
right?
[snip]
Oops... no... I didn't see it on XHTML 1.0 specifications...
In the original publication, the MIME type hadn't been decided upon. The
Recommendation has since been revised (see the updated section 5.1 [1]),
and a separate Working Group Note has been published on the subject of
XHTML media types[2]. In both cases, this information has been available
since 2002.
But I tried to set this header and my Firefox is now trying to
download the page...
That's because VK got the MIME type wrong. It should be
application/xhtml+xml. However, even though Firefox, Opera, and others
will render the document, MSIE won't as it doesn't feature a XML processor.

Don't serve XHTML to user agents (at least not on the Web). Use HTML. If
you really must use XHTML (and that's extremely doubtful), author to the
guidelines in Appendix C.

Mike
[1] <http://www.w3.org/TR/xhtml1/#media>
[2] <http://www.w3.org/TR/xhtml-media-types/>
Sep 19 '06 #5
VK

br*******@yahoo.com wrote:
Hi:

Let's suppose I've converted it to HTML 4.01. How should be the
<scripttag ?
With closing tag as it's supposed to be:
<script type="text/javascript" src="script1.js"></script>
<script type="text/javascript" src="script2.js"></script>
<script type="text/javascript" src="script3.js"></script>
<script type="text/javascript">
// your inline script
</script>

See my posts in the recent discussion "Why people use this style of
javascript declaration?" for more details.

Sep 19 '06 #6
VK

Michael Winter wrote:
VK got the MIME type wrong. It should be
application/xhtml+xml.
Oops... A Freudistic typo ("XML plus some crap atop") while W3C wants
"XHTML + some XML" :-)

Sorry anyway.

Sep 19 '06 #7
Michael Winter <m.******@blueyonder.co.ukwrites:
That's because VK got the MIME type wrong.
Surprise. :)
[...] MSIE won't as it doesn't feature a XML
processor.
Surely you're joking, Mr. Winter!

<!DOCTYPE foo [
<!ENTITY bar 'bar'>
]>
<foo>&bar;</foo>

Works for me since IE 5.01 (served properly).
--
||| hexadecimal EBB
o-o decimal 3771
--oOo--( )--oOo-- octal 7273
205 goodbye binary 111010111011
Sep 20 '06 #8
Eric B. Bednarz wrote:
Michael Winter <m.******@blueyonder.co.ukwrites:
[snip]
>[...] MSIE won't as it doesn't feature a XML processor.

Surely you're joking, Mr. Winter!
I wasn't, but I wish I had been. I have no idea what possessed me to
write that.
<!DOCTYPE foo [
<!ENTITY bar 'bar'>
]>
<foo>&bar;</foo>

Works for me since IE 5.01 (served properly).
The application/xhtml+xml media type will not cause IE to invoke MSXML
to process a document, and though application/xml will, IE fails to
recognise or understand XHTML.

Mike
Sep 20 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: bba | last post by:
os:xp pro sp1 ie 6.2800.1106 For some reason any java scripts that refers to 'external' fails: example: external.menuArguments.document.body.style.zoom="100%"; error message:
47
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
20
by: Grumble | last post by:
Hello everyone, As far as I understand, the 'inline' keyword is a hint for the compiler to consider the function in question as a candidate for inlining, yes? What happens when a function with...
6
by: John Ratliff | last post by:
I was reading the C++ FAQ Lite about inline functions, and it says the following (http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7) " It's usually imperative that the...
18
by: Method Man | last post by:
If I don't care about the size of my executable or compile time, is there any reason why I wouldn't want to inline every function in my code to make the program run more efficient?
2
by: evan | last post by:
Hi, I've got an easy one... I need to inline a few functions from one module to another. By looking at the compiled code I can see that the function is inlined if it is called from within the...
9
by: Bilgehan.Balban | last post by:
Hi, If I define an inline function in one .c file, and use it from another, after compiling and linking the two, it seems the function is not inlined but rather called as a regular function. I...
25
by: toton | last post by:
Hi, As inline is not mandetory, it depends on compiler to inline certain function (or using switch like fior GCC), my question is there any scope for inlining when it is not declared as inline...
14
by: jg | last post by:
Does C++ standard require an inline function be generated all the time ? For example, #include <iostream> using namespace std; inline int foo() {
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.