www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 12-28-2005, 09:31 PM
    mrBusch mrBusch is offline
    Registered User
     
    Join Date: Dec 2005
    Posts: 2
    including external apis

    hello,

    I am a bit new to javascript; I mostly deal with server-side applications so im not sure what i am doing.

    I have written a bunch of javascript in my hmtl pages that use an external api (specifically google maps). I decided to clean up my web app and put all my scripts into a .js file, but now it does not work. I can only guess that it is because it can't find the google map objects. What do I say in the .js so that it knows where to find the api?

    i used to say something like this in the my html pages:


    <script src="http://maps.google.com/maps"></script>
    <script>
    //My javascript stuff
    ....
    </script>


    which worked fine and now i say:

    <script src="http://maps.google.com/maps"></script>
    <script src="functions.js"></script>


    and now it doesn't work. This seems like a common thing you would want to do and i am surprised i couldn't find the answer on my own. Any help is appreciated.

    Thanks
    Reply With Quote
      #2  
    Old 04-20-2006, 10:49 AM
    phpnovice phpnovice is offline
    Banned
     
    Join Date: Dec 2004
    Posts: 8,652
    Coding it like this:

    <script src="http://maps.google.com/maps" type="text/javascript"></script>
    <script src="functions.js" type="text/javascript"></script>

    will work fine -- provided that you do not include any HTML (like script tags or HTML comment tags) at the beginning and ending of your .js file.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 04:16 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.