Solved

Can someone identify this error that is causing my code (HTML, Javascript, PHP) to display markup to the browser content randomly.

Posted on 2010-08-30
34
357 Views
Last Modified: 2012-06-27
I am really stuck on this one. I have a project I have developed for a client and cannot get it to function properly. The page randomly displays markup on the screen as indicated by the attached screenshot. By randomly I mean that every 4th or 5th click is returning this error... and only on certain browsers, like Chrome or Safari.

I have done everything I can think of and built and rebuilt the system. I cannot seem to find what would make the page display properly once, but then on refresh, to fail like that. Looking at the source when it fails, it does not match what is being displayed.

I can only guess it has something to do with my code being improperly developed. Any ideas on what I should be looking for?

 Screenshot of error.
 Screenshot of what it looks like on most visits.

<?php session_start(); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/wide.dwt.php" codeOutsideHTMLIsLocked="false" -->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- InstanceBeginEditable name="doctitle" -->

<title>Collaborative Family Law Group</title>

<!-- InstanceEndEditable -->

<style type="text/css">

<!--



body {

	font-family: Times, "Times New Roman", serif;

	background-image:url(images/bck_solid.jpg);

	margin-left: 0px;

	margin-top: 0px;

	margin-right: 0px;

	margin-bottom: 0px;

}



.link {

	display:block; width:100%; height:30px;

}



#wrapper {

	background-image:url(images/bck.jpg);

	background-repeat:repeat-x;

	width:100%;

	min-height:800px;

}



#header {

	width:996px; 

	margin-left:auto; 

	margin-right:auto;

}



#footer {

	clear:both;

	width:996px; 

	margin-left:auto; 

	margin-right:auto; 

	font-size:12px;

	text-align:center; 

	margin-top:40px;

}



#body {

	width:996px; 

	margin-left:auto; 

	margin-right:auto; 

}



#content {

	padding:20px;

}



h2 {

	font-style:italic; 

	margin:0px; 

	font-size:19px;

}





.buttonDiv{ 

position:relative;

float:left; 

background:#FFFFFF;

width:15px;

margin-right: 0.2em; 

cursor:pointer;

} 



#menu ul {

	list-style-type:none;

	position:relative;

	padding:0px;

	margin:0px;

	float:left;

}



#menu ul ul { 

	display:none;

	position:absolute;

}



#menu ul:hover ul {

	display:block;

}



#menu .btn:hover {

	background-position: 0px -31px;

}



.big-btn {

	height: 44px;

}



.big-btn:hover {

	background-position: 0px -44px;

}



#menu div {

	height:31px;

	background-repeat:no-repeat;

}



#menu #home_btn {

	background-image:url(images/menu_home.gif); 

	width:103px; 

}



#menu #about_btn {

	background-image:url(images/menu_about.gif); 

	width:126px; 

}



#menu #resources_btn {

	background-image:url(images/menu_resources.gif); 

	width:154px; 

}



#menu #practice_btn {

	background-image:url(images/menu_practice.gif); 

	width:279px; 

}



#menu #directory_btn {

	background-image:url(images/menu_directory.gif); 

	width:138px; 

}



#menu #contact_btn {

	background-image:url(images/sub_menu_contact.gif); 

	width:135px; 

}



#menu #what_is_btn {

	background-image:url(images/sub_menu_what_is.gif); 

	width:279px; 

}



#menu #for_me_btn {

	background-image:url(images/sub_menu_for_me.gif); 

	width:279px; 

}



#menu #faq_btn {

	background-image:url(images/sub_menu_faq.gif); 

	width:279px; 

}



#menu #glossary_btn {

	background-image:url(images/sub_menu_glossary.gif); 

	width:279px; 

}



#menu #legal_btn {

	background-image:url(images/sub_menu_legal.gif); 

	width:205px; 

}



#menu #financial_btn {

	background-image:url(images/sub_menu_financial.gif); 

	width:205px; 

}



#menu #mental_btn {

	background-image:url(images/sub_menu_mental.gif); 

	width:205px; 

}



#menu #videos_btn {

	background-image:url(images/sub_menu_videos.gif); 

	width:154px; 

}



#menu #books_btn {

	background-image:url(images/sub_menu_books.gif); 

	width:154px; 

}



#menu #articles_btn {

	background-image:url(images/sub_menu_articles.gif); 

	width:154px; 

}



#menu #links_btn {

	background-image:url(images/sub_menu_links.gif); 

	width:154px; 

}



#menu #login_btn {

	background-image:url(images/sub_menu_login.gif); 

	width:200px; 

}



#menu #board_btn {

	background-image:url(images/sub_menu_board.gif); 

	width:200px; 

}



#menu #order_btn {

	background-image:url(images/sub_menu_order.gif); 

	width:200px; 

}



#menu #dues_btn {

	background-image:url(images/sub_menu_dues.gif); 

	width:200px; 

}





#members_resources_btn {

	background-image:url(images/btn-member-resources.gif); 

	width:278px; 

}



#members_nav a {

	text-decoration:none;

	color:#003399;

}



#flashbanner {

	width:898px;

	margin-right:auto;

	margin-left:auto;

}



-->

</style>

<script type="text/javascript"> 

<!-- 



//script to change background-color of the selected 

//button and put the appropriate value in an input object 

function btnClick(btnNum){ 

for (i=1;i<=3;i++){ 

tempBtn=document.getElementById('btn'+i) 

tempBtnValue=document.getElementById('checked'+i)

if (tempBtnValue.value == 0 && i == btnNum) { tempBtnValue.value = 1; tempBtn.style.backgroundColor = "grey"; } else if (tempBtnValue.value == 1 && i == btnNum) { tempBtnValue.value = 0; tempBtn.style.backgroundColor = "#ffffff"; } //tempBtn.style.backgroundColor=(i==btnNum?'grey':'#ffffff') 

} 

tempBtnVal.value=btnNum 

} 

//--> 

</script> 



<!-- InstanceBeginEditable name="head" -->

<?php 

	$page = "directory";

	include("easy_cms_module/easy_cms_init.php"); 

?>

<!-- InstanceEndEditable -->

<script src="AC_RunActiveContent.js" type="text/javascript"></script>

</head>



<body>







<div id="wrapper">







<!-- Header Start-->



<div id="header">



<img src="images/banner_top.jpg" alt=""/>



<img src="images/menu_left.jpg" alt="" width="97" height="33" style="float:left;"/>



<div id="menu">



      <ul>

        <li>

          <div class="btn" id="home_btn"><a class="link" href="index.php"></a></div>

        </li>

      </ul>



      <ul>

        <li>

          <div class="btn" id="news_btn"><a class="link" href="news.php"></a></div>

        </li>

      </ul>



      <ul>

        <li>

          <div class="btn" id="practice_btn"></div>

          <ul>

            <li>

              <div class="btn" id="what_is_btn"><a class="link" href="whatis.php"></a></div>

            </li>

            <li>

              <div class="btn" id="for_me_btn"><a class="link" href="forme.php"></a></div>

            </li>

            <li>

              <div class="btn" id="faq_btn"><a class="link" href="faq.php"></a></div>

            </li>

            <li>

              <div class="btn" id="glossary_btn"><a class="link" href="glossary.php"></a></div>

            </li>

          </ul>

        </li>

      </ul>



      <ul>

        <li>

          <div class="btn" id="directory_btn"><a class="link" href="directory.php"></a></div>

        </li>

      </ul>

      



      <ul>

        <li>

          <div class="btn" id="about_btn"><a class="link" href="about.php"></a></div>

          <ul>

            <li>

              <div class="btn" id="contact_btn"><a class="link" href="contact.php"></a></div>

            </li>

          </ul>

        </li>

      </ul>

      

    <ul>

        <li>

          <div class="btn" id="resources_btn"></div>

          <ul>

            <li>

              <div class="btn" id="books_btn"><a class="link" href="books.php"></a></div>

            </li>

            <li>

              <div class="btn" id="videos_btn"><a class="link" href="videos.php"></a></div>

            </li>

            <li>

              <div class="btn" id="articles_btn"><a class="link" href="articles.php"></a></div>

            </li>

            <li>

              <div class="btn" id="links_btn"><a class="link" href="links.php"></a></div>

            </li>

          </ul>

        </li>

      </ul>



</div>

<img src="images/menu_right.jpg" alt="" width="94" height="30" />

<div id="flashbanner">

<script type="text/javascript">

AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','898','height','181','title','Banner','src','banner','quality','high','wmode','transparent','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','banner' ); //end AC code

</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="898" height="181" title="Banner">

    <param name="movie" value="banner.swf" />

    <param name="quality" value="high" />

    <param name="wmode" value="transparent" />

    <embed src="banner.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="898" height="181"></embed>

  </object>

</noscript>

</div>

<img src="images/blue_bar.jpg" alt="" /></div>



<!-- Header End-->









<!-- Body Start-->



<div id="body">



    <div style="float:left; width:957px; min-height:357px; background-image:url(images/content_area_bck.jpg); background-repeat:no-repeat;">

    

        <div style="padding:0px 25px 20px 70px;">

                  

            <div style="color:#022651; font-size:14px; margin-top:20px; font-weight:600; text-align:justify;">

            

            <!-- InstanceBeginEditable name="content_bottom" --> 

            

            <? content($page); ?>

            

			<?

            

            //--------------------------------------------------------------------------

            $connection = mysql_connect(EASYCMS_HOST, EASYCMS_USER, EASYCMS_PASSWORD);

            $db_select = mysql_select_db(EASYCMS_DATABASE, $connection);

            //--------------------------------------------------------------------------

            

            ?>

            



            <table style="float:left; font-size:13px; font-family:Arial, Helvetica, sans-serif;" width="280" border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td align="center"><h2>Legal</h2></td>

              </tr>

              

              <tr>

                <td>&nbsp;</td>

              </tr>

              <tr>

                <td>&nbsp;</td>

              </tr>

        

			  <? 

                

                $query ="SELECT * FROM professionals ";

                $query .="WHERE field = 1 AND activated = 1 ORDER BY firstname";

                $result = mysql_query($query, $connection);

                while ($pro_list = mysql_fetch_array($result)) { 

                

                ?>

              

              <tr>

                <td align="center" valign="top">

                <? 

				$span_id = $pro_list['title'] . $pro_list['lastname'] . $pro_list['firstname'];

				$search  = array(' ', ',', '.', '-');

				$span_id = str_replace($search, "", $span_id); 

				?>

				<span id="<?= $span_id ?>"><?= $pro_list['firstname'] . " " .  $pro_list['lastname'] .  " " . $pro_list['title']; ?></span><br />

                <?= $pro_list['address']; ?><br />

                <?= $pro_list['city'] . " " . $pro_list['state'] . ", " . $pro_list['zip']; ?><br />

                <?= $pro_list['phone']; ?><br />

                <? if ( $pro_list['email'] <> NULL ) {?> <a href="mailto:<?= $pro_list['email']; ?>">Email</a><br /> <? } ?>

                <? if ( $pro_list['website'] <> NULL ) {?> <a target="_blank" href="http://<?= $pro_list['website']; ?>">Website</a> <? } ?>

                </td>

              </tr>

              

              <tr>

                <td>&nbsp;</td>

              </tr>

              <tr>

                <td>&nbsp;</td>

              </tr>

              

			 <? } ?>

              

			</table>

            

            

            <table style="float:left; font-size:13px; font-family:Arial, Helvetica, sans-serif;" width="280" border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td align="center"><h2>Financial</h2></td>

              </tr>

              

              <tr>

                <td>&nbsp;</td>

              </tr>

              <tr>

                <td>&nbsp;</td>

              </tr>

        

			  <? 

                

                $query ="SELECT * FROM professionals ";

                $query .="WHERE field = 2 AND activated = 1 ORDER BY firstname";

                $result = mysql_query($query, $connection);

                while ($pro_list = mysql_fetch_array($result)) { 

                

                ?>

              

              <tr>

                <td align="center" valign="top">

                <? 

				$span_id = $pro_list['title'] . $pro_list['lastname'] . $pro_list['firstname'];

				$search  = array(' ', ',', '.', '-');

				$span_id = str_replace($search, "", $span_id); 

				?>

				<span id="<?= $span_id ?>"><?= $pro_list['firstname'] . " " .  $pro_list['lastname'] .  " " . $pro_list['title']; ?></span><br />

                <?= $pro_list['address']; ?><br />

                <?= $pro_list['city'] . " " . $pro_list['state'] . ", " . $pro_list['zip']; ?><br />

                <?= $pro_list['phone']; ?><br />

                <? if ( $pro_list['email'] <> NULL ) {?> <a href="mailto:<?= $pro_list['email']; ?>">Email</a><br /> <? } ?>

                <? if ( $pro_list['website'] <> NULL ) {?> <a target="_blank" href="http://<?= $pro_list['website']; ?>">Website</a> <? } ?>

                </td>

              </tr>

         

              <tr>

                <td>&nbsp;</td>

              </tr>

              <tr>

                <td>&nbsp;</td>

              </tr>

              

			 <? } ?>



              

			</table>

            

            

            <table style="float:left; font-size:13px; font-family:Arial, Helvetica, sans-serif;" width="280" border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td align="center"><h2>Mental Health</h2></td>

              </tr>

              

              <tr>

                <td>&nbsp;</td>

              </tr>

              <tr>

                <td>&nbsp;</td>

              </tr>

        

			  <? 

                

                $query ="SELECT * FROM professionals ";

                $query .="WHERE field = 3 AND activated = 1 ORDER BY firstname";

                $result = mysql_query($query, $connection);

                while ($pro_list = mysql_fetch_array($result)) { 

                

                ?>

              

              <tr>

                <td align="center" valign="top">

                <? 

				$span_id = $pro_list['title'] . $pro_list['lastname'] . $pro_list['firstname'];

				$search  = array(' ', ',', '.', '-');

				$span_id = str_replace($search, "", $span_id); 

				?>

				<span id="<?= $span_id ?>"><?= $pro_list['firstname'] . " " .  $pro_list['lastname'] .  " " . $pro_list['title']; ?></span><br />

                <?= $pro_list['address']; ?><br />

                <?= $pro_list['city'] . " " . $pro_list['state'] . ", " . $pro_list['zip']; ?><br />

                <?= $pro_list['phone']; ?><br />

                <? if ( $pro_list['email'] <> NULL ) {?> <a href="mailto:<?= $pro_list['email']; ?>">Email</a><br /> <? } ?>

                <? if ( $pro_list['website'] <> NULL ) {?> <a target="_blank" href="http://<?= $pro_list['website']; ?>">Website</a> <? } ?>

                </td>

              </tr>

         

              <tr>

                <td>&nbsp;</td>

              </tr>

              <tr>

                <td>&nbsp;</td>

              </tr>

              

			 <? } ?>



              

			</table>

            

            <div style="clear:both;">&nbsp;</div>

            

            <!-- InstanceEndEditable -->

            

            </div>

    

        </div>

    

    <img style="float:right;" src="images/content-footer.gif" alt=""/>    </div>



    </div>

<!-- Body End-->











<!-- Footer Start-->



<div id="footer">



<form id="searchform" action="site_search.php" method="get">

  <br />

  <div style="margin: 0px 0px 20px 40px; background-image:url(images/search_box.jpg); width:346px; height:53px;"> <a style="margin: 0px 0px 0px 0px; color:#908989; font-size:15.5px; font-weight:600; text-decoration:none;" onclick="searchform.submit();" href="#">SEARCH</a>

      <input style="background:transparent; border:none; width:210px; height:18px; padding-left:4px; margin:14px 10px 0px 15px;" name="search" type="text" />

  </div>

</form>



<br /><br />Copyright &copy; All Rights Reserved Collaborative Family Law Group | Website Designed by <a style="color:black; text-decoration:none;" href="http://www.creativetechniques.biz">Creative Techniques</a> | <a style="color:black; text-decoration:none;" href="professional-profile.php">Professional Login

    

    </a><br />

    <br /><br />

    

</div>



<!-- Footer End-->









</div>









</body>

<!-- InstanceEnd --></html>

Open in new window

0
Comment
Question by:swtwebdesign
  • 10
  • 8
  • 6
  • +3
34 Comments
 
LVL 8

Expert Comment

by:nahime
ID: 33562047
The HTML is right, maybe you have some refresh problem.
Try to do Control+F5 to force the reload of all the page resource by the browser.
I've tried your website with:
Internet Explorer
Firefox
Chrome
Safari

And it works good. I've also tried to refresh a lot, but no errors were displayed.
0
 

Author Comment

by:swtwebdesign
ID: 33562057
The link to the site is: http://www.cfl-cfl.com/
0
 

Author Comment

by:swtwebdesign
ID: 33562104
Sometimes I can't seem to get it to display the error, but often it takes 5-10 clicks on a page to get it. If I force a refresh, it displays fine, but then after several more clicks I will see it again. It baffles me. The client is seeing it on Mac Safari and I see it on PC Chrome.
0
 
LVL 8

Expert Comment

by:nahime
ID: 33562218
I've refreshed, clicked on "directory" link,several several times,  but nothing, no errors :(
0
 

Author Comment

by:swtwebdesign
ID: 33562489
That's the killer, it is not consistent. What could cause that? I once was developing a web application and embedding a PHP function within another PHP function in a certain instance was causing a similar issue, however I do not believe I have done that here.
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 33582482
It might be nothing, but check out the W3 Validator on your site, http://validator.w3.org/check?uri=http%3A%2F%2Fwww.cfl-cfl.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

Also, set the pages to "no-cache" to see if it can be a caching issue.  This is a VBScript example, but I think PHP uses something similar;

<%
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate"
%>
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 33582551
@mgfranz, yes there is - header(). See http://docs.php.net/manual/en/function.header.php for details.

0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 33582576
You're right there's nothing wrong with your code and the html conforms with w3 standards so really it's about Safari and Chrome handling the flash object.  What versions of the browsers are you using that experience this error?

Have you considered replacing the flash object with javascript??  I'm sure you can achieve the same result mootools or equivalent javascript animation library.  The TinyMCe editor control you are using references jQuery so you'd use that
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 33582581
< RQuadling.  So there is!  

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

I'm thinking this has something to do with the way the SWF is being embeded/called...
0
 
LVL 8

Expert Comment

by:nahime
ID: 33584367
try to remove the flash object to see if the error disappear.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 33584372
@nahime the error is the flash object not appearing
0
 
LVL 8

Expert Comment

by:nahime
ID: 33584627
No, the error is the flash obkect not appearing and a string on top of the page that seems "broken html". But I've tested the website with IE, FFOX, Chrome, Safari and I see the flash object without error.
Also the Author see the flash object only that sometimes it disappear (every 5/6 refresh) on chrome and safari.
You can try by yourself going on: http://www.cfl-cfl.com/directory.php.
I suggested to remove the flash object to see if the html error on top of the page disapper: If so the problem is the flash movie.
0
 

Author Comment

by:swtwebdesign
ID: 33586125
Thanks for the responses!

Attempting to remove the Flash object now to see if the issue ceases. Will update.
0
 

Author Comment

by:swtwebdesign
ID: 33586196
I removed the Flash object and am still getting the error. Scratch that one.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 33586318
It looks like the first example showed this string in error...

ctiveContent.js" type="text/javascript">

... and that is from line 254 in the code snippet.  It says in full this...

<script src="AC_RunActiveContent.js" type="text/javascript"></script>

... and that is located inside the <head> of the HTML document.  It almost certainly should be part of the <body> so that would be my first suggestion - move it into the body and see if the failure disappears.

HTH, ~Ray
0
 
LVL 8

Expert Comment

by:nahime
ID: 33586321
Really strange.
If I do a lot of refresh the only error I see sometimes is a ">" character  before the "Legal" label.

I attach a screenshot showing you the html code generated. I don't know if can be a server error that sometimes doesn't send the content correctly to the client.

Cattura.JPG
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 108

Accepted Solution

by:
Ray Paseur earned 167 total points
ID: 33586405
Second idea... Here is the code snippet for the AC_RunActiveContent.js file.  If you look at the top you will see that it is rather ancient by WWW standards.  Perhaps a version update is in order?

Third idea... Who is your hosting company?  Intermittent output is often an error on the host side of things.
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

Open in new window

0
 
LVL 18

Assisted Solution

by:mgfranz
mgfranz earned 166 total points
ID: 33587546
The file AC_RunActiveContent.js is not needed with the browsers of today from what I am able to deduce from readings.  More reading here, http://www.adobe.com/devnet/activecontent/articles/devletter.html

Try the page without the call to the .js file and just use the Object and Embed call.  When you tested the page without the .swf, did you remove the enire block of code that wraps the .js and the .swf?
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 33592206
Again I have to ask what version of chrome are you running?
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 33592210
When you get the error can you view the page source and post that?  that will answer whether it's a hosting problem or a browser issue
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 33592330
The fact that the error is being displayed as a javascript issue, pretty much concludes that this is a client side issue.  You can effectively comment out the .js function calls and verify the fact that this is not a server-side issue.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 33592349
@mgfranz - it doesn't look like a javascript issue to me more like a html parsing issue hence part of the code displayed at the top.
often found when inverted commas haven't been closed etc
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 33592753
Could be, I'm betting on an issue with Safari and the way the browser detection is being called via .js.  Old code can be brutal, and the AC_RunActiveContent.js file is dated 2006.
0
 
LVL 42

Assisted Solution

by:Rob Jurd, EE MVE
Rob Jurd, EE MVE earned 167 total points
ID: 33592807
first thing is to replace the AC_RunActiveContent.js file with the raw tags or use another library such as swfobject that is kept up to date ie
http://mootools.net/docs/core/Utilities/Swiff

see here for more details

http://blog.deconcept.com/swfobject/

0
 
LVL 18

Expert Comment

by:mgfranz
ID: 33593320
Or... like I said before, use straight Object and Embed tags.
0
 

Author Comment

by:swtwebdesign
ID: 33596231
Thanks so much! Looks like I need to make sure I am using a newer file then my current AC_RunActiveContent.js.

I am using the following version of Chrome: 5.0.375.127.

Looks like the issue was in my PHP for the CMS I am using, which is a custom build. Apparently somewhere in there I had some code that was causing this, because I upgraded it to a newer version of it that I recently built and the problem ceased. I am baffled as to what part of my code was the culprit.

Any ideas of what kind of code issue would cause this?
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 33598555
I don't know why you would simply close the Q when a number of experts posted possible solutions and ideas to solve this issue.  
0
 

Author Comment

by:swtwebdesign
ID: 33598892
I am relatively new to Experts Exchange. The issue was not solved by their comments, although they were greatly appreciated and I learned from them. Should I have awarded points for the good suggestions anyways?

Forgive me for my ignorance of how the system works.
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 33599300
The fact that the error was isolated to the AC_RunActiveContent.js file should be enough to award points, if it was me, I would split the points across the baord to Ray, Tagit and myself.  But if you think that the experts suggestions were not enough to solve the issue then go ahead and close it.
0
 

Author Comment

by:swtwebdesign
ID: 33599336
Although my javascript file was outdated and that was valuable information, the problem was actually in my PHP content management system... which is why I did not away points. You all did, however help me greatly in other areas, so I will award points as you suggested.
0
 

Author Comment

by:swtwebdesign
ID: 33599352
I would prefer to award some points to those who came close. How do I do this now that I have started closing it?
0
 

Author Closing Comment

by:swtwebdesign
ID: 33599377
Thank you guys!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now