0

How do I available plug-in for this < object > tag?

  function load_about(){    
document.getElementById("content").innerHTML='<object type="type/html" data="about.html" > </object>';
  }

when I call the function using the browser google chrome this shows. No plugin available

any solutions?


Yes, that’s possible using the library controlP5.

import controlP5.*;

ControlP5 cp5;

String[] textfieldNames = {"tf1", "tf2", "tf3", "tf4", "tf5"};

void setup() {
  size(700,400);

  PFont font = createFont("arial",20);

  cp5 = new ControlP5(this);

  int y = 20;
  int spacing = 60;
  for(String name: textfieldNames){
    cp5.addTextfield(name)
       .setPosition(20,y)
       .setSize(100,40)
       .setFont(font)
       .setFocus(true)
       .setColor(color(255,0,0))
       ;
     y += spacing;
  }

  textFont(font);
}

void draw() {
  background(0);
}

void controlEvent(ControlEvent theEvent) {
  if(theEvent.isAssignableFrom(Textfield.class)) {
    println("controlEvent: accessing a string from controller '"
            +theEvent.getName()+"': "
            +theEvent.getStringValue()
            );
  }
}
4

1 回答 1

0

缺少 type="text/html" 或问题代码示例 (?) 中的拼写错误会导致 chrome 中出现错误消息(但在 Firefox 中不会)。

于 2014-04-04T15:57:16.330 回答