Author Topic: Java Script Files Identified as HTML  (Read 10311 times)

revdrmarsh

  • Newbie
  • *
  • Posts: 11
Java Script Files Identified as HTML
« on: May 16, 2008, 05:57:10 PM »
I have a Java Script file that is identified as an HTML file.

Trid results:

TrID/32 - File Identifier v2.02 - (C) 2003-06 By M.Pontello
Definitions found:  3273
Analyzing...

Collecting data from file: C:\Temp\Example.JS

Warning: file seems to be plain text/ASCII
         TrID is best suited to analyze binary files!

100.0% (.HTML) HyperText Markup Language (3000/1/1)

Content of file:
<!--
// JavaScript Document

var AnswerArray = new Array(5);

AnswerArray[0] = "<h2>Question 1? </h2><p>Answer 1 </p>";
AnswerArray[1] = "<h2>Question 2? </h2><p>Answer 2 </p>";
AnswerArray[2] = "<h2>Question 3? </h2><p>Answer 3 </p>";
AnswerArray[3] = "<h2>Question 4? </h2><p>Answer 4 </p>";
AnswerArray[4] = "<h2>Question 5? </h2><p>Answer 5 </p>";


function getAnswerHTML(topicIndex)
{
   return AnswerArray[topicIndex];
}

-->

I don't know enough about Javascript structure to suggest how to tell the difference, or what in particular makes this differentiate as HTML.

Thanks

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Re: Java Script Files Identified as HTML
« Reply #1 on: May 16, 2008, 06:07:33 PM »
TrID in facts isn't very well suited for analyzing text files.
It can get away sometimes with good results, but it depend on a lots of factors. Very "free form" filetypes (like both HTML and JavaScript sources) are among the most easy to cause misidentification.

A file identifier for text files would have been designed in a very different way. Probably a next verision of TrID (or a different tool) will handle that too.

Thanks for your feedback,
Bye!