Ok. I am writing Object tags to change the innerHTML of the main div on my site. These Objects are written by clicking on UL Li elements in other divs and grab html pages from the server. The html pages show up fine but if they have any javascript written in them or by external.js the main page throws a header error blocking the scripts from running and any form validation in javascript goes out the window and won’t run at all. I was hoping that cdata enclosure tags would help but I guess the objects aren’t initialized on the server and require a classId of some kind issued by the server which basicaly shuts that method of calling forms down unless there is another way of referancing the object id to run the script?
Part of Index Html
<!--============================#MENUE DIV===========================-->
<div id="menue">
<!--===========================#MENULIST UL===========================-->
<ul id="menulist">
<li id="home" class="show" title="Click and Start All Over Again Easily!">Home</li>
<li id="products" class="show" title="Our Products.">Products</li>
<li id="testimonials" class="show" title="Our Fans Testimonials">Testimonials</li>
<li id="aboutus" class="show" title="Articles about us.">About us</li>
<li id="faq" class="show" title="Mexicali Rose Order FAQ">Order FAQ</li>
<li id="contact" class="show" title="Contact us!">Contact us</li>
<li id="mexicali" class="hide" title="Change or Review Your account info.">My Mexicali</li>
<li><span class="show" id="noofitems" title="Number of items in Your Order."></span></li>
<li><span class="show" id="ordersum" title="Click to View more of Your Order."></span></li>
</ul>
</div>
External.js
//---------------------------#menulist ul--------------------//
/*
Change f1 innerHTML with object Technique???
<object id="foo" name="foo" type="text/html" data="aboutus.html"></object>
*/
var aboutus=document.getElementById('aboutus');
addEvent(aboutus,'click',function(){
var f1=document.getElementById('f1');
f1.innerHTML='<object id=articlehtml class=htmlpage type=text/html data=article.html></object>';
window.history.forward();
},false);
var testimonials=document.getElementById('testimonials');
addEvent(testimonials,'click',function(){
var f1=document.getElementById('f1');
f1.innerHTML='<object id=testimonialshtml class=htmlpage type=text/html data=testimonials.html></object>';
},false);
var faq=document.getElementById('faq');
addEvent(faq,'click',function(){
var f1=document.getElementById('f1');
f1.innerHTML='<object id=faqhtml class=htmlpage type=text/html data=faq.html></object>';
},false);
/*
function insertcontact()
{
document.write('<object id=contacthtml class=htmlpage type=text/html data=contactus.html>\
');
document.write('<param name=allowScriptAccess value=sameDomain />\
');
document.write('</object>\
');
}
*/
//not using this document write as it returns the same result
var contact=document.getElementById('contact');
addEvent(contact,'click',function(){
var f1=document.getElementById('f1');
f1.innerHTML='<object id=contacthtml class=htmlpage type=text/html data=contactus.html></object>';
},false);
I need to know how to get the object that recognizes the built in javascript?