Not able to invoke external function in Javascript

  • dibakar
  • Newbie
  • Newbie
  • dibakar
  • Posts: 5

Post 3+ Months Ago

Hi,

I am new to javascript and trying external functions. Problem is that when I invoke the function nothing happens, though the page loads without any error or warning.

Below is the code -

Code: [ Select ]
<HTML>
    <HEAD>
        <SCRIPT src="C:\Diba\diba2ls\functions\hello.js" language="javascript"></SCRIPT>
    </HEAD>
    <BODY>
        <P>
            <SCRIPT language="javascript">
                SayHelloTo("Dibakar");
            </SCRIPT>
        </P>
    </BODY>
</HTML>
  1. <HTML>
  2.     <HEAD>
  3.         <SCRIPT src="C:\Diba\diba2ls\functions\hello.js" language="javascript"></SCRIPT>
  4.     </HEAD>
  5.     <BODY>
  6.         <P>
  7.             <SCRIPT language="javascript">
  8.                 SayHelloTo("Dibakar");
  9.             </SCRIPT>
  10.         </P>
  11.     </BODY>
  12. </HTML>


Below is C:\Diba\diba2ls\functions\hello.js -

Code: [ Select ]
function SayHelloTo(strName)
{
    documemt.write("Hello " + strName +"!");
}
  1. function SayHelloTo(strName)
  2. {
  3.     documemt.write("Hello " + strName +"!");
  4. }


Thanks
Diba
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • BIOSTALL
  • Graduate
  • Graduate
  • User avatar
  • Posts: 125
  • Loc: UK

Post 3+ Months Ago

Check your spelling of document.write. You've put documemt.write :)
  • dibakar
  • Newbie
  • Newbie
  • dibakar
  • Posts: 5

Post 3+ Months Ago

:mrgreen:
Thanks a lot, rather embarassing to make these kind of mistake.
  • BIOSTALL
  • Graduate
  • Graduate
  • User avatar
  • Posts: 125
  • Loc: UK

Post 3+ Months Ago

No problem. I hate them kind of things you spend hours trying to work out and it comes down to a tiny spelling mistake :-P Happens to the best of programmers

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 193 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.