Results 1 to 4 of 4

Thread: [RESOLVED] javascript q!

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Resolved [RESOLVED] javascript q!

    khello
    I have an evil practice file like this:

    HTML Code:
    <script language="javascript">
    //do some stuff
    
    //call to myFunc() which is inside test.js doesnt work :( see the below script tag
    </script>
    
    <script language="javascript" src="test.js"></script>
    now the test.js file contains a function called myFunc(). I'm wondering, how would I call that from inside the first script tag?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Member Nikhil Aggarwal's Avatar
    Join Date
    Jun 2005
    Location
    New Delhi, India
    Posts
    36

    Re: javascript q!

    Just change the order of the script tags.

    In your code the call to the function is taking place before the .js file is actually loaded/included. Thats why the function cannot be found, and hence the error.
    Nikhil Aggarwal

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: javascript q!

    yes works
    thank you
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: [RESOLVED] javascript q!

    Moved from Java forum.


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

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



Click Here to Expand Forum to Full Width