GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Webmaster Q & Fuckin' A (https://gfy.com/forumdisplay.php?f=27)
-   -   Javascript Questions (https://gfy.com/showthread.php?t=902813)

JimmyStephans 04-30-2009 01:12 PM

Javascript Questions
 
I just had some new pages done for TrueBabes that includes some JS

The designer includes the script like this

<script type="text/javascript" src="images/scripts/tb.js"></script>

I would rather the JS be in the head of the HTML file so that pages moved to sub-directories with ease.

How would I do that?

The code is:

?// JScript File
function onmenubuttonover(cb,nm)
{
if(cb==null){return;}
cb.src="images/common/" + nm+"_hl.jpg";
}

function onmenubuttonout(cb,nm)
{
if(cb==null){return;}
cb.src="images/common/" + nm+".jpg";
}

function onclientbuttonover(cb,num,nm)
{
if(cb==null){return;}
cb.src="images/" + num + "/" + nm+"_hl.jpg";
}

function onclientbuttonout(cb,num,nm)
{
if(cb==null){return;}
cb.src="images/" + num + "/" + nm+".jpg";
}

So, basically how do I place that is the head of the HTML?

Thanks in advance

AdultSoftwareSolutions 04-30-2009 01:37 PM

Quote:

I would rather the JS be in the head of the HTML file so that pages moved to sub-directories with ease.
huh? What does this mean? If you want it in the head, put it in the head. Just make sure it doesn't do anything that requires the page to be loaded first though.

sexuallyhealed 04-30-2009 03:01 PM

no clue..

cyco_cc 04-30-2009 03:16 PM

If you want the javascript to be inline (not including an external file), it would look like this:

Code:

<script language="javascript" type="text/javascript">
// Your code
</script>

However, you should just include it in your header. It's the exact same thing as putting it inline.

JimmyStephans 04-30-2009 03:17 PM

Thanks, I get it now.


All times are GMT -7. The time now is 07:37 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123