SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Dec 2001
    Location
    Boston, MA
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript in a text file?

    Hi,

    I don't know if this is possible....
    I need to disable right clicking in a frameset that calls .txt files into it. I know how to disable in a regular html file but how do you put javascript into a text file or reference a .js file from a .txt doc? please, any help or direction would be greatly appreciated.

    Thank you!

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have not tried this before, but why don't you try something like this:

    Code:
    <script language="JavaScript">
    
    include the text file here
    
    </script>
    And place that in your HTML-page. I reckon it should work .

  3. #3
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should work as long as you have all of the declarations correct in the script line.

    <script language="javascript1.2" type="text/javascript" src="blah.txt"></script>

    That should work. Javascript doesn't (or didn't used to) care if the js extension was on it or not
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could probably do OK by changing the type to text/plain.

  5. #5
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Some parsers (Mason etc) are very particular about
    the request type.

    If you put it through as text/plain these parsers might choose NOT to parse it!


    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


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
  •