homepage Welcome to WebmasterWorld Guest from 184.72.72.182
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
Calling Javascript and Css
punchy




msg:3410418
 1:36 pm on Aug 1, 2007 (gmt 0)

I need to call a javascript file as well as a CSS file for a menu I'm adding onto my job's server. The problem is, I'm not allowed to add anything into the head section of page. Is there a way for me to call it in the <body>?
Or does anyone know of a code that doesn't need javascript of CSS to make a nice menu?
Thank you.

 

Tidal2




msg:3410463
 2:12 pm on Aug 1, 2007 (gmt 0)

Welcome to webmasterworld punchy

This should do it -
...
<body>
...
<script language="JavaScript" type="text/javascript">
<!--
alert("test")
//-->
</script>
....
</body>

or an external file

<body>
...
<script language="JavaScript" src="js/welcome.js" type="text/javascript"></script>
...
</body>

These both verify on the w3c site. I find the last one useful as a way of including common code in multiple programs.

Tidal2




msg:3410473
 2:19 pm on Aug 1, 2007 (gmt 0)

I think the css too can be loaded after the <body> start too I don't use it that way so I am not sure. I just did a quick test and it seemed to work.

If you do it, its probable best to do it ASAP right after the <body> tag.

<body>
<link rel="stylesheet" type="text/css" href="example.css">

....
</body>

punchy




msg:3410816
 7:06 pm on Aug 1, 2007 (gmt 0)

This is the code I'm trying to use.
Putting in the javascript like you said didn't work for me so it isn't included in this. Does anyone know what I'm doing wrong. I really appreciate the help.
Thanks

<TABLE style="width:100%;" cellpadding="0" cellspacing="0" border="0">

<tr valign="top">

<td bgcolor="white" width="170" class="rightbordergrey">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="8" height="12">

<table border="0" cellpadding="0" cellspacing="0" width="169">

<tbody>

<tr height="18" style="cursor:hand" >

<td align="left" style="padding-left:10px" class="menu" bgcolor="#E7E7E7" colspan="2">About SG CIB</td>

</tr>

<tr>

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="3">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=about_org" onClick="return (false);">Organisation</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=about_str" onClick="return (false);">Strategy</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=about_stepup" onClick="return (false);">Step Up 2010</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=about_cs" onClick="return (false);">Core Slides</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=about_sua" onClick="return (false);">STEP UP Awards</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=com" onClick="return (false);">Communication</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=aud" onClick="return (false);">Internal Audit</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

</tbody>

<tbody>

<tr height="18" style="cursor:hand" >

<td align="left" style="padding-left:10px" class="menu" bgcolor="#E7E7E7" colspan="2">Businesses</td>

</tr>

<tr>

<td colspan="2"><img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="3">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=cafi" onClick="return (false);">Capital Raising and Financing</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=ficc" onClick="return (false);">Fixed Income Currencies and Commodities</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=geds" onClick="return (false);">Global Equities and Derivatives Solutions </a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=cori" onClick="return (false);">Corporates, Institutions &amp; Advisory</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=bien" onClick="return (false);">Mid Caps Investment Banking and Emerging Markets</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=pfe" onClick="return (false);">Principal Finance and Equity</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

</tbody>

<tbody>

<tr height="18" style="cursor:hand" >

<td align="left" style="padding-left:10px" class="menuon" id="omenu" colspan="2">Resources</td>

</tr>

<tr>

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr style="display:block" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="3">

</td>

</tr>

<tr height="20" style="display:block" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=acfi" onClick="return (false);">Accounting &amp; Finance</a>

</td>

</tr>

<tr style="display:block" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:block" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=humn" onClick="return (false);">Human Resources</a>

</td>

</tr>

<tr style="display:block" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:block" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="http://itecdirect/" target="_blank" >Information Technologies</a>

</td>

</tr>

<tr style="display:block" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:block" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

<img width="8" height="8" hspace="5" vspace="4"src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/bullet_menu_off.gif">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=corp" onClick="return (false);">Corporate functions</a>

</td>

</tr>

<tr style="display:block" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:block" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

<img width="8" height="8" hspace="5" vspace="4"src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/bullet_menu_on.gif">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">
<a class="menu" href="page.aspx?p=oper" onClick="return (false);">Operations</a>

</td>

</tr>

<tr style="display:block" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

</tbody>

<tbody>

<tr height="18" style="cursor:hand" >

<td align="left" style="padding-left:10px" class="menu" bgcolor="#E7E7E7" colspan="2">Regions</td>

</tr>

<tr>

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr style="display:none" >

<td colspan="2"><img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="3">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

<img width="8" height="8" hspace="5" vspace="4"src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/bullet_menu_off.gif">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=euro" onClick="return (false);">Europe</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:10px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="http://canalsg/" target="_blank" >France</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:10px;vertical-align:top" width="15">

<img width="7" height="7" hspace="5" vspace="4"src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/bullet_menu_off.gif">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=es" onClick="return (false);">Spain</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:10px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=gb" onClick="return (false);">United Kingdom</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:10px;vertical-align:top" width="15">

<img width="7" height="7" hspace="5" vspace="4"src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/bullet_menu_off.gif">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=pl" onClick="return (false);">Poland</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:10px;vertical-align:top" width="15">

<img width="7" height="7" hspace="5" vspace="4"src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/bullet_menu_off.gif">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=de" onClick="return (false);">Germany</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2"><img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2"></td></tr><tr height="20" style="display:none" ><td align="left" style="padding-left:5px;vertical-align:top" width="15"><img width="8" height="8" hspace="5" vspace="4" src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/bullet_menu_off.gif"></td><td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px"><a class="menu" href="page.aspx?p=amer" onClick="return (false);">Americas</a></td></tr><tr style="display:none" ><td colspan="2"><img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2"></td></tr><tr height="20" style="display:none" ><td align="left" style="padding-left:10px;vertical-align:top" width="15"><img width="7" height="7" hspace="5" vspace="4" src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/bullet_menu_off.gif"></td><td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="http://entrenet.us.world.socgen/" target="_blank" >US</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=asia" onClick="return (false);">Asia</a>

</td>

</tr>

<tr style="display:none" ><td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

</tbody>

<tbody>

<tr height="18" style="cursor:hand" >

<td align="left" style="padding-left:10px" class="menu" bgcolor="#E7E7E7" colspan="2">Projects</td>

</tr><tr><td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="3">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=xsell" onClick="return (false);">XSell</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

<tr height="20" style="display:none" >

<td align="left" style="padding-left:5px;vertical-align:top" width="15">

</td>

<td width="100%" style="cursor:hand;vertical-align:top;padding-top:1px">

<a class="menu" href="page.aspx?p=basle2" onClick="return (false);">Basle 2</a>

</td>

</tr>

<tr style="display:none" >

<td colspan="2">

<img src="http://sginsite/world/capabilities/insite_adm.nsf/vxf/images/$file/pixtrans.gif" width="2" height="2">

</td>

</tr>

</tbody>

</table>

Tidal2




msg:3411640
 4:40 pm on Aug 2, 2007 (gmt 0)

I ran the posted code and saw the left hand side menu, I am not sure what you are trying to get javascript to do with it though.

You may get a better response if you post a specific problem/question in the Javascript and AJAX forum.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved