vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Where to place Javascript call? Headinclude causes header to not load properly (https://vborg.vbsupport.ru/showthread.php?t=224804)

abouthere 10-08-2009 07:03 AM

Where to place Javascript call? Headinclude causes header to not load properly
 
Hi all,

I'm struggling with a customising issue since I am still pretty wet behind the ears when it comes to vBulletin (I'm a long term PHPBB user who has converted).

I have World of Warcraft character link javascript that I'd like to use. It's designed to work on any site, you simply upload the relevant files and add the following code:
Code:

<script type="text/javascript" src="wowarmory_tooltip/js/wat.js.php" />
Once the code is in place, you add a BBCode and it just works.

Now, from what I've gathered, I'm assuming I put this in at the end of the headinclude file on a per template basis. I did this and the roll over worked fine for me; however there was a strange side effect.

- whilst on the index page, half the header doesn't load
- whilst on some pages the header does load

I can't work out why. Am I injecting the Javascript in the wrong place? Or is it more likely to be that the script is conflicting with vBulletin functionality?

Thanks in advance for any replies.

Lynne 10-08-2009 02:09 PM

Do you get any errors (like in the browser console)? How about the source code - is the header all in the page source and just not showing up in the browser?

abouthere 10-08-2009 02:26 PM

Thank you for coming back to me, I will check and look at the areas you've mentioned and post some results.

--------------- Added [DATE]1255015932[/DATE] at [TIME]1255015932[/TIME] ---------------

Ok, I opened the page source and straight away saw that Firefox was marking the "/" at the end of my command in red.

Red isn't good, so I looked at how vBulletin scripts are details and used the same format, i.e.

Code:

<script type="text/javascript" src="wowarmory_tooltip/js/wat.js.php"></script>
At the moment, it all seems to work!


All times are GMT. The time now is 03:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01060 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete