Every time I attempt to open it in IE9, I encounter the SCRIPT1014 error: Invalid character on LINE1 and CHARACTER1

Similar Query:
SCRIPT1014: Invalid character

This is the HTML Code I have written

<html>

<head>

<style type="text/css">
#p1 span {
width: 65px;
display: block;
float: left;
}

</style>

</head>

<body>

<script charset="UTF-8"      src="C:\Users\Chris\Documents\Projects\HTML_XML_JAVASCRIPT\jscodeloginpage.js"></script>

<h1 style="text-align:center;" STYLE="font-family:verdana;">FDM Markets</h1>
<h2 style="text-align:center;">Trading Platform</h2></br>

<p1>Login</p1></br>
</br>

<form name="anyForm">
Username: 
<input type="text" name="anyName" size="15" onKeyUp="Complete(this, event)">
</br>
Password: <input type="text" size="15" name="password_box">
</form>

<span id="clock" style=font-size: 12">&nbsp;</span>

</body>

</html>

The javascript file I am using is as follows:

function Complete(obj, evt) {

var names = new Array("albert","alessandro","chris");
    names.sort();

if ((!obj) || (!evt) || (names.length == 0)) {
    return;
}

if (obj.value.length == 0) {
    return;
}

var elm = (obj.setSelectionRange) ? evt.which : evt.keyCode;

if ((elm < 32) || (elm >= 33 && elm <= 46) || (elm >= 112 && elm <= 123)) {
    return;
}

var txt = obj.value.replace(/;/gi, ",");
elm = txt.split(",");
txt = elm.pop();
txt = txt.replace(/^\s*/, "");

if (txt.length == 0) {
    return;
}

if (obj.createTextRange) {
    var rng = document.selection.createRange();
    if (rng.parentElement() == obj) {
        elm = rng.text;
        var ini = obj.value.lastIndexOf(elm);
    }
} else if (obj.setSelectionRange) {
    var ini = obj.selectionStart;
}

for (var i = 0; i < names.length; i++) {
    elm = names[i].toString();

    if (elm.toLowerCase().indexOf(txt.toLowerCase()) == 0) {
        obj.value += elm.substring(txt.length, elm.length);
        break;
    }
}

if (obj.createTextRange) {
    rng = obj.createTextRange();
    rng.moveStart("character", ini);
    rng.moveEnd("character", obj.value.length);
    rng.select();
} else if (obj.setSelectionRange) {
    obj.setSelectionRange(ini, obj.value.length);
        }
}


function tick() {

  var hours, minutes, seconds, ap;
  var intHours, intMinutes, intSeconds;
  var today;

  today = new Date();

  intHours = today.getHours();
  intMinutes = today.getMinutes();
  intSeconds = today.getSeconds();

  switch(intHours){

case 0: 

  intHours = 12;
      hours = intHours+":";
      ap = "A.M.";
      break;

case 12:

  hours = intHours+":";
      ap = "P.M.";
      break;

case 24:

  intHours = 12;
      hours = intHours + ":";
      ap = "A.M.";
      break;

default: 

  if (intHours > 12)

    {
        intHours = intHours - 12;
        hours = intHours + ":";
        ap = "P.M.";
        }

  if(intHours < 12)

   {
       hours = intHours + ":";
       ap = "A.M.";
       }

   break;

  } 

  if (intMinutes < 10) {
    minutes = "0"+intMinutes+":";
  } 

  else {
    minutes = intMinutes+":";
  }

  if (intSeconds < 10) {
    seconds = "0"+intSeconds+" ";
  } 

  else {
    seconds = intSeconds+" ";
  } 

  timeString = hours+minutes+seconds+ap;

  document.getElementById("clock").firstChild.nodeValue = timeString;

  window.setTimeout("tick()", 100);

  }

  window.onload=tick;

Whenever attempting to open the HTML file in IE9, an error message appears in the console stating: SCRIPT1014: Invalid character LINE1 AND CHARACTER1. Interestingly, the code functions correctly in Google Chrome but encounters issues in IE9. What could be causing this discrepancy?

Answer №1

It appears that the starting html tag is missing in your code sample. This could potentially be causing the error you are experiencing.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can you explain the significance of verbosity in a nodemon setup?

Can someone explain the verbose setting in my nodemon configuration and what impact it has on the project? { "verbose": true, "watch": "./server" } I have checked the readme file for nodemon, but it doesn't provide any information on this specif ...

Executing JavaScript code within a class object using ASP-VB

I'm looking to create a function that will show a Javascript-based notification. I already have the code for the notification, but I'm trying to encapsulate it in a class library as a function. However, I am unsure about what to return from the f ...

Incorporating visuals into dynamic circles that are in motion and interacting

I have a collection of bouncing balls that are colliding with each other within a confined space. Currently, the balls are just simple green circles. However, I would like to replace them with images. How can I accomplish this? Here is the render functio ...

Vue. A variable that changes dynamically in v-if conditions

How can I include a variable in a v-if statement based on my specific situation? I have a data variable called language = 'en' and a large json object with data in multiple languages (referred to as message). Here is an example of the structure o ...

Can you explain the significance of these vertices in the box geometry in THREE.js?

After creating a box geometry using the code below: const hand1geo = new THREE.BoxGeometry(2, 0.01, 0.2); const material_sidehand = new THREE.MeshBasicMaterial({ color: 0x3cc1b7 }); const sidehand = new THREE.Mesh(hand1geo, material_sidehand); ...

The second JSP page fails to load following an AJAX POST request

The following code snippet is found in page1.jsp. $.ajax({ type: "post", url: "page2.jsp", data: newdata, success:function(msg){ return msg; } ...

Would it be considered improper to implement an endless loop within a Vue.js instance for the purpose of continuously generating predictions with Tensorflow.js?

In my project, I am leveraging different technologies such as Tensorflow.js for training and predicting foods, Web API to access the webcam in my notebook, and Vue.js to create a simple web page. Within the addExample() method, there is an infinite loop r ...

How can you calculate the number of elements in a jQuery array and iterate through each of them?

After extracting a string from a mySQL query with PHP, my AJAX script comes into play. This string is then dissected and placed into a jQuery array. The results are displayed on the screen using .html() The length of this array can range from zero items t ...

Tips for incorporating routes in Polka.js in a way that resembles the functionality of express.Route()

One of the challenges I am facing is trying to import route logic from another file in my project. While using Express.js, this could be done easily with express.Route(). However, when attempting polka.Route(), an error occurs stating that Route doesn&apos ...

Reordering items within an array of objects using JavaScript

I am working with an array of objects that needs to be sorted by category, and I also need to find the total number of items in each category. In the example provided below, all categories with "toys" should be grouped together for easier counting, like in ...

Guide to using react-router for redirection and displaying messages

Is there a way in React to redirect after a successful login with a success message displayed on another component? I previously used flash messages, but they didn't integrate well with react-router and caused full page refreshes. Now that I am using ...

Generating new objects from API request in React and aggregating them into a single, comprehensive object

I have developed a program that utilizes Axios to fetch data through API calls. I aim to save the fetched result as an object within my this.state.matrixDictionary variable. However, each time I make another API call, the previous object gets replaced. My ...

What's the process for creating a Java object in PHP and utilizing it in JavaScript?

I am looking to create an object on a PHP page and send it as a response through an AJAX call to be used as a JavaScript object on the response page. This type of object is what I need to generate and pass along. var areaChartData = { labels ...

What could be causing the CSS to not display properly on specific routes?

I'm facing an issue where CSS seems to be working fine for certain routes with node.js & express, but not for others. It's puzzling because the HTML file links to the same CSS file in both cases. For instance, CSS works perfectly for the route " ...

React Native, state values are stagnant

I created an edit screen where I am attempting to update the post value through navigation v4 using getParams and setParams. However, when I modify the old value and click the save button, it does not update and no error is displayed. The old values still ...

Using JQuery to deactivate a button based on a specific select option

Once a user selects and submits an option from the dropdown list of collections in my form, I aim to disable the button so that they cannot submit that same collection again. Although Ajax is functioning properly and successfully disables the button upon s ...

Error: Unable to locate module: cannot find the file at '../file'

Currently, I am utilizing an application that is based on electron-vue. When running yarn run dev on Windows, it runs smoothly without any issues. However, upon transitioning to Ubuntu 18.04, I encountered an error each time I tried to execute yarn run dev ...

The Firefox Nightly Android add-on content script will only load when the add-on popup is opened

After creating an add-on that manipulates a specific site's HTML based on user settings in the add-on's 'popup', I encountered an issue. The add-on is supposed to run a continuous content script when the user opens the site, but it only ...

Struggling to get Axios working in Node despite having it properly installed

I am encountering an issue with my Jasmine test that involves HTTP requests. Despite having Axios installed using the command npm install axios --save, I keep getting the error message axios is not defined. var request = require('axios'); var co ...

The AJAX request encountered an error due to an Unexpected End of JSON Input

My AJAX code is encountering an error message. parsererror (index):75 SyntaxError: Unexpected end of JSON input at parse (<anonymous>) at Nb (jquery.min.js:4) at A (jquery.min.js:4) at XMLHttpRequest.<anonymous> (jquery.min.js: ...