Javascript function undefined only in

I have a site.html page that includes 3 .js files, runs scripts, prepares the environment, and outputs another m.html file from an XML file and presents this generated m.html file on the screen using folwing code:

var dd=document.open("text/html","replace");
dd.write(htmlData);
dd.close();

site.html is as follows:

    <html>
    <head>
     <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
     <script type="text/javascript" src="file1.js"></script>
     <script type="text/javascript" src="file2.js"></script>
     <script type="text/javascript" src="file3.js"></script>
     <link rel="stylesheet" type="text/css" href="file4.css">
    </head>
    <body>
    _
    </body>
    </html>

the generated m.html file, which looks like this:

<html>
<head>
   <meta name="viewport" content="user-scalable=no">
   <link rel="stylesheet" type="text/css" href="file4.css">
   <script type="text/javascript" src="uag.js"></script>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head> 
<body id="homebody">
<img class="background" src="a.jpg">
<div id="homebuttons">
<table>
<tr>
<td>
<a href="javascript:alert(typeof PL_open)"><img src="b.png"></a>
</td>

<td class="spacer">
</td>
<td>
<a href="javascript:PL_open('activate:a')"><img src="c.png"></a>
</td>
</tr>
<tr class="spacer">
</tr>
<tr>

<td>
<a href="javascript:PL_open('activate:b')"><img src="d.png"></a>
</td>
<td class="spacer">
</td>
<td>
<a href="javascript:PL_open('activate:c')"><img src="e.png"></a>
</td>
</tr>
</table>

</div>
</body>
</html>

is displayed correctly, but when I click one of the buttons (links), I get an error message: expected object: JScript - window script block, line 1, char 1.

if I click the first link, I get the text "undefined" in the warning field.

The PL_open () js function is defined in file1.js and, according to tests, is defined until m.html is loaded onto the screen.

.

- ? ! :) !

Edit:

!! , " ".

file1.js m.html. , , , . , file.js uag.js . , . ajax... ? .

+3
1

, ajax ( document.open), :) d4rkpr1nc3 ! , , .. , .

+1

All Articles