MyBB Community Forums

Full Version: How do i add a java script beside the logo in the header?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How would I add this javascript to the right of the logo?
Quote:<script language=javascript>var LocationID = 'CAON0696';</script>
<script language=javascript src='http://www.theweathernetwork.com/weatherbutton/wxbutton.js'></script>


I tried adding it to the header template. but it always put it on the next line below the logo. Any help is appreciated.


Changing
<a href="$settings[bburl]" class="logo"><img src="$theme[logo]" alt="$settings[bbname]" border="0" /></a>
in the header template into
<table border="0" summary="">
<tr><td>
<a href="$settings[bburl]" class="logo"><img src="$theme[logo]" alt="$settings[bbname]" border="0" /></a>
</td></tr>
<tr><td>
<script language=javascript>var LocationID = 'CAON0696';</script>
<script language=javascript src='http://www.theweathernetwork.com/weatherbutton/wxbutton.js'></script>
</td></tr>
</table>
might work. not sure, havn't tested it. It also depends what the script your using is.

Also, what do you mean by right?? The very right of the logo/screen, or straight after the logo??
Thanks K776. It worked.

I initially wanted to put the script to the very right of the logo/screen to display the weather icon. Now I have changed my mind and added a few more icons for different cities.

Thanks again for your help.

PS. Here is the result of what I did: http://www.gtasportriders.com/forum/