I have a site.html page which include 3 .js files, the scripts runs, prepares the enviroment and extrects another m.html file out of an .xml file and present this generated m.html file on the screen using the folwing code:
var dd=document.open("text/html","replace");
dd.write(htmlData);
dd.close();
the site.html looks like this:
<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 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 presented correctly but when I'm pressing one of the buttons (links) I get the error message: object expected: JScript - window script block, line 1, char 1.
if I press the first link I get the text "undefined" in the alert box.
The PL_open() js function is defined in file1.js and according to tests is defined until the m.html is loaded to screen.
The exect same code works perfectly in chrome and safary.
Can anyone point or guide me to the problem? I'll be grateful for any kind of help! my brain is already melted :) Thanks a lot in advence!
Edit:
Thanks for your comments!! I deleted the quote by mistake when posting the question so the problem is not "missing single quote".
I made a test and included file1.js in m.html. in this case the function runs but as expected it enters an endless loop. so I think the file.js and uag.js are ok. I can post them anyway if necessary. and about using ajax... can you explain more? I would like to try it.