View Full Version : Dynamic content error .....I do not find it...any help please

11-30-2007, 10:16 AM
Hello to you all,

honestly I do not have any experience with javascript, that is why I hope at you all. I just copied the script I for dynamic context menu and added to my page, BUT it does not work :(. Funny is that if I test it via phase5 it work :D......so I am very suprised...
The error code I get is: "bobexaple is null (zero) or no object" ???????

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="robots" content="index,follow">
<link rel="stylesheet" href="../include/style.css" />
<script type="text/javascript" src="../include/script.js"></script>
<script type="text/javascript">zeiger="ul1";</script>
<!--[if IE 6]>
<link rel="stylesheet" href="../include/ie6.css" />
<!--[if IE]>
<link rel="stylesheet" href="../include/ie.css" />
<!--[if lt IE 6]>
<link rel="stylesheet" href="../include/ie5.css" />
<script type="text/javascript" src="switchcontent.js" >
<style type="text/css">
/*Style sheet used for demo. Remove if desired*/



<body onload="start()" body oncontextmenu="return false" onselectstart="return false" ondragstart="return false">
<div id="seite">
<div id="logo"><a href="index.htm"><img src="../img/logo.jpg" alt="" /></a></div>

<div id="navi_o">
<li><a href="XXX.htm"><b>XXX</b>&nbsp;|&nbsp;</a></li>
<li><a href="XX.htm"><b>XX</b> &nbsp;|&nbsp;</a></li>
<li><span id="active"><b>XX</b>&nbsp;|&nbsp;</span></li>
<li><a href="XX.php"><b>XX</b></a></li>

<div id="menu">
<li><a href="javascript:void(0);" onclick="lese('ul1')"><b>X</b></a></li>
<ul id="ul1">
<li><a href="X.htm">X</a></li>
<li><span id="active">X</span></li>
<li><a href="XX.php?nav=2"><b>XX</b></a></li>

<div id="content">
<body text="#000000" bgcolor="#FFFFFF" link="#0000CC" alink="#0000CC" vlink="#0000CC">
<div><h5><a style="text-decoration:none" href="javascript:bobexample.sweepToggle('contract')">Contract</a> | <a style="text-decoration:none"

<h3 id="bobcontent1-title" class="handcursor">blablala </h3>
<div id="bobcontent1" class="switchgroup1">

<h3 id="bobcontent2-title" class="handcursor"> blablala </h3>
<div id="bobcontent2" class="switchgroup1">

<h3 id="bobcontent3-title" class="handcursor"> blablala </h3>
<div id="bobcontent3" class="switchgroup1">

<script type="text/javascript">
// MAIN FUNCTION: new switchcontent("class name", "[optional_element_type_to_scan_for]") REQUIRED
//1) Instance.setStatus(openHTML, closedHTML)- Sets optional HTML to prefix the headers to indicate open/closed states
//2) Instance.setColor(openheaderColor, closedheaderColor)- Sets optional color of header when it's open/closed
//3) Instance.setPersist(true/false)- Enables or disabled session only persistence (recall contents' expand/contract states)
//4) Instance.collapsePrevious(true/false)- Sets whether previous content should be contracted when current one is expanded
//5) Instance.defaultExpanded(indices)- Sets contents that should be expanded by default (ie: 0, 1). Persistence feature overrides this setting!
//6) Instance.init() REQUIRED
var bobexample=new switchcontent("switchgroup1", "div") //Limit scanning of switch contents to just "div" elements
bobexample.setColor('darkred', 'black')
bobexample.collapsePrevious(true) //Only one content open at any given time

<script type="text/javascript">
var joeexample=new switchcontent("switchgroup2", "p") //Limit scanning of switch contents to just "p" elements
joeexample.setStatus('[open] ', '[closed] ')
joeexample.setColor('green', 'red')
joeexample.collapsePrevious(false) //Allow more than 1 content to be open simultanously

<div id="footer">
<div id="foot_txt">
<a href="xxx.htm">xxx</a>&nbsp;|&nbsp;<a href="xxx.php">xxxt</a>&nbsp;|&nbsp;<a href="A.htm">A</a>
<div id="xxx"><a href="http://www.xxx.de">xxx.de</a></div>


11-30-2007, 01:25 PM
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

11-30-2007, 04:49 PM
es geht um diesen script
(it is the script)


12-01-2007, 07:41 AM
Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

Now, I copied your code and used a copy of the script from Dynamic Drive. The page looked a mess, but the expand and contract links worked.

You cannot have two body tags on a page, and body isn't an attribute, but that wasn't causing a problem with the script. I have no access to the code for '../include/script.js' or your stylesheets, those may be conflicting. To see about that:

Please post a link to the page on your site that contains the problematic code so we can check it out.

I'd highly recommend validating your HTML and css code:




12-02-2007, 03:13 PM
the page has been made by a webprogrammierer and not me, I do not have really experience within css/html and more

there are so many problems? mistakes ?

12-02-2007, 04:09 PM
Please post a link to the page on your site that contains the problematic code so we can check it out.

12-03-2007, 12:27 PM
the page isnīt online yet, fortunally ;)

I can just sent you the files..

12-03-2007, 04:46 PM
It would be easier for me if you just uploaded a demo of it (including all of the supporting scripts, style, and images) somewhere and gave me the link to it.