Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 10-27-2008, 02:15 PM
Mavrik347's Avatar
Mavrik347 Mavrik347 is offline
 
Join Date: Dec 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Javascript Compatability?

Hi guys, I was told over @ vbulletin.com to post my ticket here as this is the place to ask. So here it is.

Quote:
Hi, I'm having a problem with vB understanding Javascript.

Our site has a roster for the members I made but its shows up wrong... It should work so when you click on a picture of a member the full version opens up in a window as displayed in the third link below.

How it should 'appear'. (Javascript removed) - http://www.britishroguewarriors.com/...?pageid=roster

How it does appear. - http://www.britishroguewarriors.com/...hp?pageid=java

How it should work with Javascript. (Source File) - http://www.britishroguewarriors.com/javaroster.html

Do you know how to fix it or is there a work around to make vBulletin let the browser show Javascript properly.
Any help on this would be verrrry appreciated.
Reply With Quote
  #2  
Old 10-27-2008, 02:26 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why don't you post your page code and template here so we can take a look at it. Please use the code/html/php tags to enclose the code.
Reply With Quote
  #3  
Old 10-27-2008, 04:40 PM
Mavrik347's Avatar
Mavrik347 Mavrik347 is offline
 
Join Date: Dec 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The template is "dark futura". Are you sure you want me to post it all? It would flood the thread You can see the code by Right clicking the page and selecting 'View Source' on the third link above (Source File).
Reply With Quote
  #4  
Old 10-27-2008, 05:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You might want to read up a bit on including javascript in pages. You should define your script type:
HTML Code:
<script type="text/javascript">
And you should enclose all javascript in comment tags:
HTML Code:
<!--
javascript
// -->
That probably has nothing to do with your problems, but those were two very obvious things I saw and I'm wondering now about the rest of the code. Did you copy it from somewhere? I'm not a javascript expert, so I can't go through your code for you to see if you wrote it correctly.


Just wondering, but.... you have the list spit out correctly in the first link, right? But the javascript isn't popping up a window, right? And the third link is to an html page which shows the working popup. And the second page is your working page (the one you are trying your code in) which is incorrect. I don't even see where you include the javascript in your second page, I just see it being spit out incorrectly. Try doing what I suggested above and see what the result is.
Reply With Quote
  #5  
Old 10-27-2008, 05:56 PM
Mavrik347's Avatar
Mavrik347 Mavrik347 is offline
 
Join Date: Dec 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The Javascript has been taken out of the first link to show what it should look like.

I have added what you suggested. Yeah it still doesn't show. :/
Reply With Quote
  #6  
Old 10-27-2008, 06:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where are you adding in the javascript in the second link? I don't see it being added anywhere. You should either have it added at the top, like you do the third link, or it should be added as a script like the vb javascript scripts. But, I don't see your's being added anywhere. That is the page I was asking about the source code for - the actual php code for the page that inputs the javascript.
Reply With Quote
  #7  
Old 10-27-2008, 07:19 PM
Mavrik347's Avatar
Mavrik347 Mavrik347 is offline
 
Join Date: Dec 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's the problem. You see I used the "Add Page" function in vBAdvanced to create the page, I told it to use a HTML file and that third link is the file it's using.

Now for some reason as you just said, on the page it doesn't show and only shows that bit of text "') else writeln(''); writeln('" which is a snippet from the rest of the Java it seems to have ignored. But as you cn see in the source file it's all there.
Reply With Quote
  #8  
Old 10-27-2008, 07:28 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is an issue you will have to take up with on the vbadvanced forums then. I have no clue how to help using vbadvanced. I just know that that page is not correct for what you want to do. You need to include the javascript in the correct script manner, not from an html page.
Reply With Quote
  #9  
Old 10-27-2008, 10:09 PM
Mavrik347's Avatar
Mavrik347 Mavrik347 is offline
 
Join Date: Dec 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ohhhh yeah, worked it out. Thank you Lynne for saying something that made me work it out.



Answer: Ok in order for custom Java to work in your pages you need to add the script into the global header. Because this is included in every page you need to make sure your variables are long and preferably complicated so there are no conflicts within the forum.

Admin CP -> Styles & Templates -> Style Manager ->

Expanding all the styles you want it to work in (<< >>) find in each one "headinclude" under "Forum Home Templates".

Make a backup of the old headinclude and add your Javascript to the bottom of headinclude after ALL previous tags have closed.

If your variables are as I suggested then you should encounter no conflicts and all should work fine.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:55 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04925 seconds
  • Memory Usage 2,233KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete