Java script - I.E security problem?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Java script - I.E security problem?

Hybrid View

  1. #1
    Join Date
    May 2006
    Posts
    3

    Java script - I.E security problem?

    Hi,

    I'm quite new to Java script, and I'm not having any problems as such with coding.

    But when I do try to run a simple script no matter how simple it is, I.E warns me about security settings and that fact that active content can be dangerous, asking me to manually choose whether to allow it to run or not.

    Fair enough, I thought - my security settings need to be adjusted. But when looking through other sites' source and seeing that they use scripts all the time, the big question I have is why their scripts don't produce the same effect on my browser, and I cannot see any difference between their implementation and mine.

    For example, take the following:

    Put this in the head section:

    <script language="JavaScript" type="text/javascript">
    <!--
    function checkform ( form )
    {

    // ** START **
    if (form.name.value == "") {
    alert( "Please enter name." );
    form.name.focus();
    return false ;
    }
    // ** END **

    return true ;
    }
    //-->
    </script>

    Then in the body section the following:

    <form action="process.php" method="post" onsubmit="return checkform(this);">
    <input type="text" name="name" />
    </form>

    If I manually agree to running it, it works without a problem. So where am I going wrong here? Is there some piece of code I'm missing out? - why is it that others can successfully run scripts in their head section such as:

    <script language=javascript type="text/javascript">
    if (top.location!=self.location){top.location=self.location}
    </script>

    And yet this doesn't produce the same warning.

    Thanks for your time and help, and my apologies if there is some really basic thing I'm missing here.

    Cheers,

    Will

  2. #2
    Join Date
    Aug 2005
    Posts
    23
    If you run a HTML page locally from your harddrive and the content has any <script>, on.. behavior script, <object> within it, you will receive the warning for "Active Content."
    Take the same page, and upload to your server = no warning.

    This is a change to WindowsXP SP2's security model of file: protocol, and will not be seen from a http: page.

  3. #3
    Join Date
    May 2006
    Posts
    3

    Thanks very much

    Hi KC,

    I just wanted to say thanks very much for taking the time out to explain this.
    It's a huge help, and my heads slightly less sore, as I'm not banging my head off the desk so much.

    Thanks,

    Will

Similar Threads

  1. How to run UNIX shell script in JAVA?
    By mcaashish in forum Java
    Replies: 13
    Last Post: 08-27-2012, 12:22 PM
  2. Replies: 2
    Last Post: 06-14-2006, 03:16 PM
  3. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 06:46 AM
  4. Java Applet Compiler problem?
    By mdl in forum Java
    Replies: 3
    Last Post: 03-07-2005, 02:34 AM
  5. More on Visual J#.Net
    By Jim Pragit in forum .NET
    Replies: 64
    Last Post: 10-20-2001, 08:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center