如何在vb6中添加元标记?

时间:2018-12-06 18:20:34

标签: vb6

HTMLHeadElement vb6添加元

我有vb6(旧版本)和此代码 module.exports = (sequelize, DataTypes) => { const TaskType = sequelize.define( 'taskType', { id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true }, name: { type: DataTypes.STRING, unique: true } }, { tableName: 'tasks_types' } ) TaskType.associate = models => { TaskType.Task = TaskType.belongsToMany(models.Task, { as: 'tasks', foreignKey: 'typeId', through: models.TasksTypes }) } return TaskType } 我想将此meta标签(Dim helement As HTMLHeadElement)添加到文档-WebBrowser1.document

(旁注:这些标签是sh * t的一部分)

1 个答案:

答案 0 :(得分:0)

基于此代码-http://vbcity.com/forums/t/49404.aspx 在DocumentComplete子菜单中-将文档打印为text2

   Dim htDoc As HTMLDocument
    Dim htHead As HTMLHeadElement
    Dim htMeta As HTMLMetaElement

    '<meta http-equiv="X-UA-Compatible" content="IE=edge" />

    Set htDoc = WebBrowser1.document
    Set htHead = htDoc.getElementsByTagName("HEAD").Item(0)
    htDoc.designMode = "on"
    'Set htMeta = htDoc.createElement("META")
    Set htMeta = htDoc.createElement("META")
    'htMeta.httpEquiv = "MSThemeCompatible"
    htMeta.httpEquiv = "X-UA-Compatible"
    'htMeta.content = "Yes"
    htMeta.content = "IE=edge"
    Set htMeta = htHead.insertAdjacentElement("afterBegin", htMeta)
    htDoc.designMode = "off"
    Set htMeta = Nothing
    Set htHead = Nothing
    Set htDoc = Nothing
    'getElementsByTagName("HEAD").Item(0)
    'Me.Text2.Text = WebBrowser1.document.body.innerHTML
    Me.Text2.Text = WebBrowser1.document.getElementsByTagName("HTML").Item(0).innerHTML