www.webdeveloper.com
Results 1 to 5 of 5

Thread: Uncaught reference error

  1. #1
    Join Date
    Feb 2014
    Posts
    2

    Exclamation Uncaught reference error

    hie everyone.. I m new to javascript .. I am not able to understand why is it giving meSpeak object undefined..
    I have the fragment of html file index.html as shown.
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title>meSpeak.js: Text-to-Speech on the Web</title>
    <script>
    // This demo is licensed under the GNU GPL.
    </script>
    <script type="text/javascript" src="/static_files/js/mespeak/mespeak.js"></script>
    <script type="text/javascript ">
    meSpeak.loadConfig("/static_files/js/mespeak/mespeak_config.json");
    meSpeak.loadVoice("/static_files/js/mespeak/voices/en/en.json");
    ..... ....
    meSpeak.js has meSpeak defined.. still it is giving undefined error.. can anyone help me out..

  2. #2
    Join Date
    Oct 2012
    Location
    Croatia
    Posts
    255
    Undefined is usually a value of:

    1. variables that are not initialized
    2. property of an object that doesn't exist
    3. value of a function that doesn't actually return a value
    4. value of a function parameter for which no argument is supplied

    Since you didn't post any JavaScript code it's hard to tell what's your problem... Maybe you should try to check path to your script file (src attribute).

  3. #3
    Quote Originally Posted by ayesha.aj View Post
    meSpeak.js has meSpeak defined.. still it is giving undefined error.. can anyone help me out..
    Please make sure it is meSpeak.js or mespeak.js

  4. #4
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,290
    You browser has a console for JavaScript errors, it will tell you what line the error was detected in and the module, try using it to narrow down and zoom in on the problem, then post here the section of code, preferably a good chunk and indicate what line the error is on and wrap your code in forum tags to make life easier than seeing a wall of text...
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  5. #5
    Join Date
    Feb 2014
    Posts
    2
    Thank you .. My js file was not loading thats why the error was there.. I changed the location of js and wrote that path. It worked.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles