• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 610
  • Last Modified:

Error: 'visual_preview' is undefined

Can someone please tell me how to resolve this error that is occurring on several of my pages.  I know little (very)
javascript.  Thank you!!
0
pmilllok
Asked:
pmilllok
3 Solutions
 
REA_ANDREWCommented:
can you post your code, as it seems you reference something which is not there
0
 
pmilllokAuthor Commented:
<script type="text/javascript">
(function sce_init()
{
  window.vpreview = new visual_preview();
  window.vpreview.refresh();
})();
</script>
<!-- end container -->

does this help?
0
 
gops1Commented:
There are some extra brackets and braces around the function. Which is causing error when ever the page loads. Another thing is inside the function it is trying to instantiate some other function.

Andrew this code is not at all clear on what it does. Anyway remove those extra braces and brackets and then try.

function sce_init()
{
  window.vpreview = new visual_preview();
  window.vpreview.refresh();
};
0
 
ZvonkoSystems architectCommented:
The function visual_preview() has to be defined elsewhere, for example in an external JavaScript library which you have to include to that page.
Perhaps you have missed some statements, like: <script src="sce_lib.js"></script>
0
 
pmilllokAuthor Commented:
Thank you.  I tried all of the above suggestions - and am still receiving the error(s).  Any other ideas??  Thanks to all!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now