Computer problems,Computer help
*AX SOFT>>>Programming & Design

How do you automatically load a javascipt?


I'm working on a website and i'm thinking of using some javascript except i don't like how some browsers will stop the code because it might be a potential threat. The user then has to allow permission to run the javascript or active x code.

Does anybody know how to go around this?

Put the javascript in a file and in a subfolder of your project and then reference it in the header

Example:
<script language="javascript" src="scripts/general.js"></script>

Two ways.

(1) Don't use Internet Explorer

or

(2) Don't load the HTML document directly from the hard disk. Access it via a web server.

This deals with the warning IE gives you about JS in documents it loads from the hard disk (there are security considerations about what JS can access based on where the HTML document it is loaded into resides).

If the user has has explicitly disabled it, then there is nothing you can do, except code defensively (which you should be doing anyway): http://icant.co.uk/articles/seven-rules-...

There's no way around it. About all you can do is put some text on your page encouraging the user to enable JavaScript.

This is really an issue with how the user has their particular browser set up. There is no way to get around your conundrum because you can only change what is on the web server but you have no control over what the settings of the users browser is.

As they said above, it's a limitation imposed by the web. "The customer is always right!" Each person using the web has the ULTIMATE RIGHT to turn off yer danged javascript or activeX code, just as you would, if you visted a magazine site to get information on PCs and didn't want their danged subscription requests constantly popping up to block the view, or if you went to buy a subscription to the magazine and didn't want their activeX creeping in to steal a copy of yer street address to ship off to cousin Jake for his mail-order business!

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • Is there any basic principles or codes needed to design a web page?

    Checkout AceHtmlPro (Free Edition) which will help you learn html and allows for easy page generation. Great for anyone starting out.

    ...
  • Dreamweaver MX: Why has the background & links disappeard on my 3rd page when I link to it from my homepage?

    Where exactly are you storing the specification of your links? In each page? Or in a separate style sheet (CSS)? If you're not using an external style sheet, I highly recommend starting to do ...

  • Unix help!!?

    Files in Unix filesystems use inodes as structures that hold the actual file data on disks. inode number uniquely identifies a physical file on disk. Hard links are pretty much multiple names fo...

  • Entering words in to C++?

    It's as simple as this, in C++: string s; cin >> s;

    ...
  • Does Gimp work on Vista?

    GIMP should run on any NT-based version of Windows (NT4, 2000, XP or Vista). Older GIMP versions (2.0.x) could also work with older versions of Windows such as Windows 95 but they are not supported...

  • How can I have a link to a flash file (.swf) open in a new window on my website?

    When you link to the .swf you can use target="blank" in the href.... <A HREF="link.swf" target="_blank"> This will force the page to open in a new window.....

  • Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int?

    main() ...should be... int main(void) ...aside from that, you should probably work on understanding how "else if" works.

    ...
  • Open source function... Or how to do this conversion?

    I recommend the open source CxImage library located at

    ...
  •  

    Categories--Copyright/IP Policy--Contact Webmaster