SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Albany, N.Y.
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    non intrusive javascript

    I currently have a function stored in an external file that contains

    Code:
    function showdate() {
    	var curr_datetime = new Date;
    	var display_timedate = curr_datetime.toLocaleDateString();
    	return (display_timedate);
    }

    In the html doc head I have the usually link to the external file
    Code:
    <script type="text/javascript" src="index.js"></script>
    In the body I have the following code:

    Code:
    <p><script type="text/javascript">document.write(showdate())</script></p>
    The problem is that when it loads in IE I get:

    "To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could a cess your computer"

    Is their a non intrusive javascript version to this task that will not cause IE to give that statement?

    Thanks

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Internet Explorer gives you this prompt for ANY kind of script that runs locally on your machine. When the page and script are remote on a server, there is no such warning.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Albany, N.Y.
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks I never knew that fact.


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
  •