1 (edited by meetn2veg 2010-10-28 15:35:20)

Topic: js error - Object Expected

Just bought SV Builder Pro and, although SV is a brilliant piece of SW, I'm having probs already!!

Just created a simple embedded gallery, relative paths changed accordingly, DOCTYPE set as per SVBpro generated index.html file, and I can't think of anything else that would need changing!

The SVBpro index.html file works ok in its installed directory, but the moment I move it up one directory and adjust the "simpleviewer.js" path accordingly I get a js error; Object Expected, referring to $(document).ready(function () {...});

I'm doing the site on localhost at present so I don't have anything uploaded for you to look at :-| but can assure you I'm not a newbie.

Saying that, "What else needs changing???"

Here's the adjusted code for the index.html file:

<body>
    <!--START SIMPLEVIEWER EMBED -->
    <script type="text/javascript" src="/accommodation/svcore/js/simpleviewer.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
        SV.simpleviewer.load('sv-container', '100%', '100%', '222222',true);
    });
    </script>
    <div id="sv-container"></div>
    <!--END SIMPLEVIEWER EMBED -->
   
</body>

The only change here is the addition of the "/accommodation/" in the path for the simplevierer.js file - which is loads without problem.

No other changes to the xml file, thumbs or images directories, etc.....

Thanks in advance for any very PROMPT help anyone can give me!

Re: js error - Object Expected

If you have moved your svcore folder then you'll need to define a variable svCoreURL as seen here:
http://simpleviewer.net/simpleviewer/su … tml#svcore

Steven Speirs
SimpleViewer Support Team

Re: js error - Object Expected

Steven - thanks for your reply - sorry taken so long to thank you - but been busy!

Here's the thing. I still get the js - object expected error, even after your suggestion.

This is the code I'm using - this is the one that spits the dummy!

<script type="text/javascript">
var svCoreURL = '/_minigallery/';
</script>

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="_minigallery/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
$(document).ready(function () {
SV.simpleviewer.load("sv-container01", "200", "200", "222222", true);
});
</script>

Yet the test page WITHIN the _minigallery directory works!  Here's that page's code;

<!--START SIMPLEVIEWER EMBED -->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
$(document).ready(function () {
    SV.simpleviewer.load('sv-container', '200', '200', '222222',true);
});
</script>
<div id="sv-container"></div>
<!--END SIMPLEVIEWER EMBED -->

This is really bothering me now - it appears to be such a simple thing yet ...

Any takers?? URL's for the respective pages are;

not working - http://new.motoaventures-morocco.com/ocean-of-dunes.php
working - http://new.motoaventures-morocco.com/_minigallery/

Thanks in advance for any assistance.

Re: js error - Object Expected

Your line:

var svCoreURL = '/_minigallery/';

... should be:

var svCoreURL = '_minigallery/svcore/';
Steven Speirs
SimpleViewer Support Team

Re: js error - Object Expected

Bloody marvelous! Why didn't I think of that??!?

thank you again.