html codes from external html-file in to textarea (any professional in active-x or javascript help me)

后端 未结 1 1459
無奈伤痛
無奈伤痛 2020-12-22 14:54

In the below code how can i make it load the file into a textarea where textarea path is parent.a.frame_name1.document.form_name1.textarea_name1



        
相关标签:
1条回答
  • 2020-12-22 15:41

    Replace the lines

        if (!/(\.txt)$/i.test(obj.value)) {
        alert("Local file name must include the '.txt' extension.");
        return false;
    }
    

    with

        if (!/(\.txt|\.htm|\.html)$/i.test(obj.value)) {
        alert("Local file name must include the '.txt', '.htm' or '.html' extension.");
        return false;
    }
    

    For your convenience, it now takes htm-files as well.

    0 讨论(0)
提交回复
热议问题