It is currently Wed Aug 23, 2017 2:40 am Advanced search

Highslide works locally but not on remote server

Technical support, bug reports, feature requests and more.

Highslide works locally but not on remote server

Postby simonolley » Mon Aug 07, 2017 10:26 pm

I have recently revamped a site which had Highslide working well and is working well on my local drive. Since uploading the new site, Highslide is not working. The browser is recognising the <a> tag but not successful calling up the javascript.

Here is a sample page: https://www.vintagecushions.com/detail_ ... _174.shtml

I have the following alerts

Uncaught ReferenceError: hs is not defined at detail_174.shtml:34
(anonymous) @ detail_174.shtml:34
highslide-with-gallery.js:1 Uncaught SyntaxError: Unexpected end of input
highslide.config.js:1 Uncaught SyntaxError: Unexpected end of input

Highslide is functioning locally when I load a file directly but is not working on the remote server.

Is it possible that a file is being altered/damaged during upload?

Thanks,

Simon
simonolley
 
Posts: 2
Joined: Sun Aug 06, 2017 4:44 pm

Re: Highslide works locally but not on remote server

Postby MisterNeutron » Mon Aug 07, 2017 10:47 pm

A few thoughts, in no particular order (and not all necessarily relevant):

You're trying to define hs.graphicsDir before you've loaded the script. You can't do that - hs is, indeed, not defined until after the script has been loaded, so move that line below the loading of the script and the config file.

Save yourself heartache later, and don't try to use any of the subsets of the script, like highslide-with-gallery.js. You'll end up trying to use some feature of Highslide, it won't work, and you won't be able to figure out why. The whole script is still tiny, so there's no reason to use anything other than highslide-full.js or highslide-full.min.js (the same thing, but minified).

You're using an obsolete version of Highslide. Download version 5.0.0, the latest (and it will be the last, alas).

Your copies of the script and config file appear to have no newlines in them at all (ditto for your CSS files). Since Javascript uses either a newline or a semicolon to terminate a statement, that might be dangerous. I have no idea why your files are like that.

XHTML is a dead dog. Time to bury it! ;)
User avatar
MisterNeutron
 
Posts: 351
Joined: Sun Aug 18, 2013 1:20 pm

Re: Highslide works locally but not on remote server

Postby simonolley » Tue Aug 08, 2017 11:35 pm

Thanks for all the tips and I know you're absolutely right about that dead dog. Have managed to fix the corrupted script files by uploading a zipped version. Seems to have got everything working again. Now to get my head around the modern way of site building.

Cheers
simonolley
 
Posts: 2
Joined: Sun Aug 06, 2017 4:44 pm

Re: Highslide works locally but not on remote server

Postby MisterNeutron » Tue Aug 08, 2017 11:52 pm

Glad you got it working.

You can actually delete this line entirely - the location of the graphics directory is being properly specified in the config file, so there's no need to try to do it again in the page code:

Code: Select all
<script type="text/javascript">hs.graphicsDir = 'highslide/graphics/';</script>
User avatar
MisterNeutron
 
Posts: 351
Joined: Sun Aug 18, 2013 1:20 pm


Return to Highslide JS Usage

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests