Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    BHI
    BHI is offline
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HTML/Java Code Help Needed

    **This is also posted in the Javascript help section, but I've posted it here as well because I don't know if it's the java or the html that needs fixing. They just seem to be clashing. **

    Hello everyone,

    Currently I am trying to add a tab menu into a preselected web template of mine. I am using the program SoThink DHTML to create my tab menu navigation.

    Here is the link to the website without the javascript navigation added:
    http://www.fortressadvisor.com/indextesterwithout.htm

    You'll have to right click and pull the source files so you can see the exact coding within the site, sorry for not being able to provide them.

    Now here is the same exact website link only with the javascript navigation added:
    http://www.fortressadvisor.com/indextester.htm

    Notice how everything gets moved around? The alignment goes off and the tables get larger even though NONE of the other code was touched. I only added the <script type="text/javascript" language="JavaScript1.2" src="stmenu.js"></script> into the <head> </head> and then the rest of the javascript inbetween the <body> </body> where I wanted the nav bar to appear. (As seen in the website demonstration.)

    What am I doing wrong?
    I've looked it over several times and I just can't figure it out! Nor do I understand why everything is getting changed around when I add the javascript required for the navigation bar.

    Thanks in advance!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Java is NOT javascript don't confuse them. Your problem is you just slapped the javascript inside of a tr element rather than a td element. Change this
    Code:
    <tr align="center">
    					
    						<script type="text/javascript" language="JavaScript1.2">
    <!--
    stm_bm(["menu1ea9",660,"","blank.gif",0,"","",1,0,250,0,1000,1,0,0,"","",0,0,1,2,"default","hand",""],this);
    stm_bp("p0",[0,4,0,0,3,2,0,7,100,"",-2,"",-2,50,0,0,"#999999","#333366","",3,1,1,"#000000"]);
    stm_ai("p0i0",[0,"Home","","",-1,-1,0,"http://www.fortressadvisor.com/","_self","","","","",0,0,0,"","",0,0,0,0,1,"#333399",0,"#333366",0,"","",3,3,1,1,"#FFFFF7","#000000","#FFFFFF","#000000","12pt Charter Bd BT","10pt Charter Bd BT",0,0]);
    stm_aix("p0i1","p0i0",[0,"About Us","","",-1,-1,0,"http://www.fortressadvisor.com/aboutus.htm","_self","","","","",0,0,0,"arrow_r.gif","arrow_r.gif",7,7]);
    stm_bpx("p1","p0",[0,2,-90,25,2,3,0,0,100,"",-2,"",-2,50,0,0,"#999999","#333399"]);
    stm_ai("p1i0",[0,"Overview","","",-1,-1,0,"http://www.fortressadvisor.com/aboutus.htm","_self","","","","",0,0,0,"","",0,0,0,0,1,"#333366",0,"#333399",0,"","",3,3,1,1,"#FFFFF7","#000000","#FFFFFF","#FFFFFF","9pt Terminal","9pt Terminal",0,1]);
    stm_aix("p1i1","p1i0",[0,"Why Choose Fortress?","","",-1,-1,0,"http://www.fortressadvisor.com/whychoosefortress.htm"]);
    stm_aix("p1i2","p1i0",[0,"Company Mission and Vision","","",-1,-1,0,"http://www.fortressadvisor.com/company.htm"]);
    stm_aix("p1i3","p1i0",[0,"History","","",-1,-1,0,"http://www.fortressadvisor.com/history.htm"]);
    stm_ep();
    stm_aix("p0i2","p0i1",[0,"Services","","",-1,-1,0,"http://www.fortressadvisor.com/services1.htm"]);
    stm_bpx("p2","p1",[]);
    stm_aix("p2i0","p1i0",[0,"What Do We Provide?","","",-1,-1,0,"http://www.fortressadvisor.com/services1.htm"]);
    stm_aix("p2i1","p1i0",[0,"Our Partners and Structure","","",-1,-1,0,"http://www.fortressadvisor.com/services2.htm"]);
    stm_ep();
    stm_aix("p0i3","p0i1",[0,"Contact Us","","",-1,-1,0,"http://www.fortressadvisor.com/contactus.htm"]);
    stm_bpx("p3","p1",[]);
    stm_aix("p3i0","p1i0",[0,"Phone & Email","","",-1,-1,0,"http://www.fortressadvisor.com/contactus.htm"]);
    stm_aix("p3i1","p3i0",[0,"Hours of Operation"]);
    stm_aix("p3i2","p3i0",[0,"Locations"]);
    stm_ep();
    stm_ep();
    stm_em();
    //-->
    </script>
    					</tr>
    to this
    Code:
    <tr align="center">
    					<td>
    						<script type="text/javascript" language="JavaScript1.2">
    <!--
    stm_bm(["menu1ea9",660,"","blank.gif",0,"","",1,0,250,0,1000,1,0,0,"","",0,0,1,2,"default","hand",""],this);
    stm_bp("p0",[0,4,0,0,3,2,0,7,100,"",-2,"",-2,50,0,0,"#999999","#333366","",3,1,1,"#000000"]);
    stm_ai("p0i0",[0,"Home","","",-1,-1,0,"http://www.fortressadvisor.com/","_self","","","","",0,0,0,"","",0,0,0,0,1,"#333399",0,"#333366",0,"","",3,3,1,1,"#FFFFF7","#000000","#FFFFFF","#000000","12pt Charter Bd BT","10pt Charter Bd BT",0,0]);
    stm_aix("p0i1","p0i0",[0,"About Us","","",-1,-1,0,"http://www.fortressadvisor.com/aboutus.htm","_self","","","","",0,0,0,"arrow_r.gif","arrow_r.gif",7,7]);
    stm_bpx("p1","p0",[0,2,-90,25,2,3,0,0,100,"",-2,"",-2,50,0,0,"#999999","#333399"]);
    stm_ai("p1i0",[0,"Overview","","",-1,-1,0,"http://www.fortressadvisor.com/aboutus.htm","_self","","","","",0,0,0,"","",0,0,0,0,1,"#333366",0,"#333399",0,"","",3,3,1,1,"#FFFFF7","#000000","#FFFFFF","#FFFFFF","9pt Terminal","9pt Terminal",0,1]);
    stm_aix("p1i1","p1i0",[0,"Why Choose Fortress?","","",-1,-1,0,"http://www.fortressadvisor.com/whychoosefortress.htm"]);
    stm_aix("p1i2","p1i0",[0,"Company Mission and Vision","","",-1,-1,0,"http://www.fortressadvisor.com/company.htm"]);
    stm_aix("p1i3","p1i0",[0,"History","","",-1,-1,0,"http://www.fortressadvisor.com/history.htm"]);
    stm_ep();
    stm_aix("p0i2","p0i1",[0,"Services","","",-1,-1,0,"http://www.fortressadvisor.com/services1.htm"]);
    stm_bpx("p2","p1",[]);
    stm_aix("p2i0","p1i0",[0,"What Do We Provide?","","",-1,-1,0,"http://www.fortressadvisor.com/services1.htm"]);
    stm_aix("p2i1","p1i0",[0,"Our Partners and Structure","","",-1,-1,0,"http://www.fortressadvisor.com/services2.htm"]);
    stm_ep();
    stm_aix("p0i3","p0i1",[0,"Contact Us","","",-1,-1,0,"http://www.fortressadvisor.com/contactus.htm"]);
    stm_bpx("p3","p1",[]);
    stm_aix("p3i0","p1i0",[0,"Phone & Email","","",-1,-1,0,"http://www.fortressadvisor.com/contactus.htm"]);
    stm_aix("p3i1","p3i0",[0,"Hours of Operation"]);
    stm_aix("p3i2","p3i0",[0,"Locations"]);
    stm_ep();
    stm_ep();
    stm_em();
    //-->
    </script>
    </td>
    					</tr>
    There are a lot more issues with your code such using tables for page layout. Read the link in my sig titled "Why Tables for Layout is Stupid?".

    Also you have 23 coding errors without your menu in there. See them here.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    BHI
    BHI is offline
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you so much for the help. I'm fairly new at all of this and still getting the hang of it. It plainly didn't occur to me that I needed the scripting to be inside <td> </td>... I think I've just fried my brain for one day, lol.

    Anyways, this is greatly appreciated and I'm definitely going to have a look at those errors and your sig links.

    Thanks again! Have a nice day.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •