vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Javascript Loading problem (https://vborg.vbsupport.ru/showthread.php?t=202442)

vbplusme 01-20-2009 08:49 AM

Javascript Loading problem
 
Hello and Greetings,

I have a javascript that I am working on and like a lot of javascripts, part of it needs to be loaded in the head tags and the other part is in the body somewhere. The script works perfectly standalone in an html page but when I tried to load it into vBulletin using a file instead of the code which is quite long, Only the framework loads, none of the javascript variables display. The script is using a "window.onload="somefunction";" and I am wondering if that is the problem. I created a Template the contains the html that is suppose to display the javascript and a plugin that defines the template. I think its all correct but I'm mystified why it doesn't work. As I said, standalone using a simple html page it works beautifully?

Any ideas?

TIA

SEOvB 01-20-2009 11:08 AM

Have you tried without using the plugin to display it (though I dont see that causing a problem)

mikesz 01-22-2009 05:03 AM

Thanks for the reply. I did but what I discovered is that when I moved the onload function call out of the javascript file and into the template using :

Code:

<script language="JavaScript" type="text/javascript">onLoad="functioncall()"</script>
Everything just magically worked! I even tried moving it to different locations in the head tag to see if it was being stepped on by other javascipt and none of that worked.

Thanks again. I appreciate your comments.


All times are GMT. The time now is 03:29 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.00975 seconds
  • Memory Usage 1,709KB
  • 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
  • (1)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