I think that if you need styles in the "child" you should use a iframe...
Personally I prefer to load all my css in the parent and use div...
The child should have only html and scripts no <html>, <head>,
<title>, <body> tags...
About the javascript I don't know... but my bet si because the use of <head>...
On Mon, Sep 8, 2008 at 8:49 PM, JOVE <[EMAIL PROTECTED]> wrote:
>
> I use $("#mydiv").load() to load a html file that has its own style
> and js, on IE and Firefox, it work good, but on Safari and Google
> Chrome, it can't load style and js in the html file, how can I fix
> it?
>
>
> example:
> MainPage.htm
>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title>Main Page</title>
> <script src="js/jquery.js" type="text/javascript"></script>
> <script type="text/javascript">
> $(document).ready(function(){
> $("#mydiv").load("test.htm");
> });
> </script>
> </head>
> <body>
> <div id="mydiv"></div>
> </body>
> </html>
>
> SubPage.htm
>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title>Sub Page</title>
> <style type="text/css">
> #box {
> height:400px;
> width:400px;
> background:red;
> }
> </style>
> <script type="text/javascript">
> alert("Hello!");
> </script>
> </head>
> <body>
> <div id="box">Test Box</div>
> </body>
> </html>
>
> on IE and Firefox,it alert "Hello" and show a red box, but on Chrome
> it show text only, no alert, no style.
>
>
>
> >
>
--
Perhaps the depth of love can be calibrated by the number of different
selves that are actively involved in a given relationship.
Carl Sagan (Contact)
Jaime Ochoa Malagón
Arquitecto de Soluciones
Cel: +52 (55) 1021 0774
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---