Results 1 to 10 of 10

Thread: Help with linked in Javascript File

  1. #1
    Join Date
    Dec 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with linked in Javascript File

    I have tried on multiple occasions to create and link in external .js files. It never works. Here is the latest attempt.

    I would like to include the CalendarPopup.js from here.

    I saved the file into a subdirectory called "js".

    I then tried to use this line to include it.

    Code:
    <script type="type/javascript" src="js/CalendarPopup.js"></script>
    I also tried the same thing with language="JavaScript" instead of type="text/javascript" and it did not work either.

    Is there something inherently wrong with the way I'm going about this? Or are there settings in IE and/or Firefox that do not allow this to work? Any help would be greatly appreciated.

  2. #2
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    Have you tried both type and language at the same time?

  3. #3
    Join Date
    Dec 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I just tried it that way, no go.

  4. #4
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    I just looked at the code, it appears you are mean't to separate it into a few different files. Date.js Anchor.js, etc. It says so in the code.

  5. #5
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by TimFA View Post
    Have you tried both type and language at the same time?
    the language attribute has been depreciated and should never be used

  6. #6
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    Either way it was worth a shot.

  7. #7
    Join Date
    Dec 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I didn't split the files. I saved the combined file version. Linked it in and tried to call the functions and objects from it and it hates me. Is there something wrong with the script tags that I used? Are there settings on Apache or in the browser that would stop this type of linking? I am at a complete loss.

  8. #8
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    I see nowhere is says it doesn't need to be seperated. Or atleast remove the text, I just skimmed it, but wasn't some of it not in comment tags?

  9. #9
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    when you save an external .js file make sure you remove the
    Code:
    <script type="text/Javascript"></script>
    from the file
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@ /\/\@|{
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  10. #10
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    Code:
    	for (var i=0; i<checkList.length; i++) {
    		var l=window[checkList[i]];
    		for (var j=0; j<l.length; j++) {
    			d=getDateFromFormat(val,l[j]);
    			if (d!=0) { return new Date(d); }
    			}
    		}
    	return null;
    	}
    
    /* SOURCE FILE: PopupWindow.js */
    
    /* 
    PopupWindow.js
    Author: Matt Kruse
    Last modified: 02/16/04
    
    DESCRIPTION: This object allows you to easily and quickly popup a window
    in a certain place. The window can either be a DIV or a separate browser
    window.
    
    COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
    positioning errors - usually with Window positioning - occur on the 
    Macintosh platform. Due to bugs in Netscape 4.x, populating the popup 
    window with <STYLE> tags may cause errors.
    
    USAGE:
    // Create an object for a WINDOW popup
    var win = new PopupWindow(); 
    
    // Create an object for a DIV window using the DIV named 'mydiv'
    var win = new PopupWindow('mydiv'); 
    
    // Set the window to automatically hide itself when the user clicks 
    // anywhere else on the page except the popup
    win.autoHide();
    That is what I was referring to. If its not removed, it will not work. Unless I'm missing something...

Bookmarks

Posting Permissions

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