Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacement of HTC files

I am working on a project which is using HTML Components files (.htc), now i want to upgrade the project that should work on all the browsers with IE10, as htc files are no longer supported by IE10. So Please give me solution how we can convert the part of project where we are using htc files. please refer below code:

this.Style.Add("BEHAVIOR", "url(xyz.htc)");

I want to replace this htc file and code written inside this file. What should needs to be put in replacement of htc file.

Please help.

like image 620
Saurabh Avatar asked Oct 31 '22 21:10

Saurabh


1 Answers

Update .htc (HTML Components) custom attributes to js since IE10 standard mode doesn't support htc.

Check this link

Edit :

var Method_Behavior = {
    get: function () {
        return this.style.behavior
    },
    set: function (val) {
        this.style.behavior = val
    }
}

//input
if (!HTMLInputElement.prototype.hasOwnProperty("Behavior")) {
    Object.defineProperty(HTMLInputElement.prototype, "Behavior", Method_Behavior);
}

Then in the Html page

<script src="new_js_file_name" type="text/javascript"></script>
    <script type="text/javascript">
        function loaded() {
            document.getElementById("Id_Name").Behavior = "new_behavior";
        }
    </script>
like image 192
CodingDefined Avatar answered Nov 09 '22 15:11

CodingDefined