PDA

View Full Version : VB has Broken Links for .JS files


ae3799t
07-13-2014, 03:30 PM
I sent an email to support, but since I do not think they are programmers, I am not sure they can help. Maybe someone here can.

We have been using VB4 for quite some time and from the beginning, we were getting broken link notifications in Google Webmaster tools for the following:

http://www.mydomain.com/treeview/treeview-min.js%22%3E%3C/script%3E

http://www.mydomain.com/animation/animation-min.js?v=422%22%3E%3C/script%3E

I did not want to use our domain to avoid more 404s from google when they read this forum, but it does not mater since the links are built incorrectly. They should be

http://www.roadtrucker.com/forum/clientscript/yui/treeview/treeview-min.js

http://www.roadtrucker.com/forum/clientscript/yui/animation/animation-min.js

So basically, /forum/clientscript/yui is missing when VB writes these links in the WebPages.


The install file has this line: var yuipath = 'clientscript/yui'; which obviously assigns "clientscript/yui" to yuipath and I would think that somewhere, "http://www.roadtrucker.com/forum/" would be assigned before that.

I do not want to reinstall, since the forum has been up and running for a while now and we have upgraded at least 2 and I think 3 times.

This assignment has to be in the database someplace, but I am unable to find it. I searched the templates, but no luck there. I can see where it writes the webpage, but I can not see where it actually gets assigned.

Has anyone dug into the VB code enough to understand this? Any help will be greatly appreciated. Thanks

kh99
07-13-2014, 05:07 PM
Look in the setting under "Server Settings and Optimization Options", there are some path settings for YUI.

If those look OK, then chck your headinclude template for a section like this:
<script type="text/javascript">
<!--
if (typeof YAHOO === 'undefined') // Load ALL YUI Local
{
document.write('<script type="text/javascript" src="clientscript/yui/yuiloader-dom-event/yuiloader-dom-event.js?v={vb:raw vboptions.simpleversion}"><\/script>');
document.write('<script type="text/javascript" src="clientscript/yui/connection/connection-min.js?v={vb:raw vboptions.simpleversion}"><\/script>');
var yuipath = 'clientscript/yui';
var yuicombopath = '';
var remoteyui = false;
}
else // Load Rest of YUI remotely (where possible)
{
var yuipath = '{vb:stylevar yuipath}';
var yuicombopath = '{vb:stylevar yuicombopath}';
var remoteyui = true;
if (!yuicombopath)
{
document.write('<script type="text/javascript" src="{vb:stylevar yuipath}/connection/connection-min.js?v={vb:raw vboptions.simpleversion}"><\/script>');
}
}



and make sure it hasn't been changed or removed.

ae3799t
07-14-2014, 07:34 PM
Updated.. See end.

Thanks kh99. I have the following settings, which looks ok to me:
Use Remote YUI: Yahoo
Custom Remote YUI Path: ""
Custom Remote YUI Combo Path: ""

Here is that section of code and it looks ok, as far as I can tell:
if (typeof YAHOO === 'undefined') // Load ALL YUI Local
{
document.write('<script type="text/javascript" src="clientscript/yui/yuiloader-dom-event/yuiloader-dom-event.js?v={vb:raw vboptions.simpleversion}"><\/script>');
document.write('<script type="text/javascript" src="clientscript/yui/connection/connection-min.js?v={vb:raw vboptions.simpleversion}"><\/script>');
var yuipath = 'clientscript/yui';
var yuicombopath = '';
var remoteyui = false;
}
else // Load Rest of YUI remotely (where possible)
{
var yuipath = '{vb:stylevar yuipath}';
var yuicombopath = '{vb:stylevar yuicombopath}';
var remoteyui = true;
if (!yuicombopath)
{
document.write('<script type="text/javascript" src="{vb:stylevar yuipath}/connection/connection-min.js?v={vb:raw vboptions.simpleversion}"><\/script>');
}
}
------ Updated -----
Php is not my strong suite, but this looks like if I have "Use Remote YUI: Yahoo" defined, yuipath does not get assigned in the else statement. There is an assignment, but if it is empty, it assigns nothing. So where does it get assigned to the Yahoo CDN?

Should I remove this.. "Use Remote YUI: Yahoo"? Thanks