• I created a website for a local school 2 years ago; and now they want the option to update the site themselves. I’m now re-creating all of the site within WordPress.

    I’m stuck on one aspect and that is a page showing the staff members. When I did this on the original site, it worked fine within a html page, but it won’t run within WordPress.

    The original and working page is http://www.ssj-school.co.uk/staff.htm and the new (WordPress) page is http://www.ssj-school.co.uk/wp/staff

    The WordPress page shows all of the images and text, but has none of the functionality. I’ve been searching for an answer for the last 2 days and tried so many different things, but nothing is working, any ideas?

Viewing 1 replies (of 1 total)
  • It appears as though the old page uses the following code for the extra features:

    <script type="text/javascript"><!--
    
    				var arrOnImages = Array();
    				var arrOffImages = Array();
    				var intLastItem = 0;
    
    				function showBio(intId){
    					//hide last
    					var objEl = false;
    
    					if (intLastItem > 0){
    						objEl = document.getElementById("d"+intLastItem);
    						if (objEl){
    							objEl.style.display = "none";
    						}
    						objEl = document.getElementById("i"+intLastItem);
    						if (objEl){
    							objEl.src = arrOffImages[intLastItem];
    						}
    					}
    					objEl = document.getElementById("d"+intId);
    					if (objEl){
    						objEl.style.display = "block";
    					}
    					objEl = document.getElementById("i"+intId);
    					if (objEl){
    						objEl.src = arrOnImages[intId];
    					}
    					intLastItem = intId;
    					return false;
    				}
    
    			--></script>

    When you add JavaScript through the WordPress visual editor, it will be stripped out. You have a few options:

Viewing 1 replies (of 1 total)

The topic ‘Javascript not working’ is closed to new replies.