Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Location
    USA
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    external openup file

    If I have the .js script for openup as an external file (instead of inserting it b/w </head> and <body>), how will I have to replace:

    <a href="javascriptpenup('http://www.newsite.com/','new')">Link</a>

    Thanks.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Shouldn't what you have there work. As long as the openup() function is correct in your external file, you should have no problem with what you are currently using.

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Location
    USA
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I understand.

    But how am I going to refer to the external file?

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ssskaya can we see your function.

    Do you mean how can you access the window that the website is opened up in?

    scroots
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished

  • #5
    Regular Coder
    Join Date
    Oct 2002
    Location
    USA
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts
    well,.. what I mean is:

    I have the external .js file that has the openup script.

    As for the .html page, in which I will insert the openup command, I believe what I have above will not be enough since it does not have anything that refers to the external file.

    For example, if it was an external date script called date.js, I would refer to it with a script like: <script src="www.mywebsite.com/date.js"></script>

    This script would show the path to the external file.

    How about this openup function?

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    As you said, you need to refer to the .js file in your html pages.

    <head>
    <script type="text/javascript" src="pathToJSfile.js"></script>
    </head>

    And then you can call any method or global variables in that js in your html pages.

    Just make sure the .js file does not contain <script></script> tags.

  • #7
    Regular Coder
    Join Date
    Oct 2002
    Location
    USA
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts
    great!

    this was what I was looking for.

    thanks!


  •  

    Posting Permissions

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