Load plugin with js but "<embed>"

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Load plugin with js but "<embed>"

Postby FamousHe » Thu Jan 16, 2014 4:13 am

I want to load a plugin with js but html flag "<embed>".
In ie,we can use "new ActivexObject(...)" to load an activex.
Is there anyway to define a js function like it to load a plugin in cef3?
Last edited by FamousHe on Sat Jan 18, 2014 11:28 am, edited 1 time in total.
FamousHe
Newbie
 
Posts: 8
Joined: Sun Jan 12, 2014 4:17 pm

Re: Load plugin with js but "<embed>"

Postby MichaelSun » Thu Jan 16, 2014 10:28 am

function CardReader(id){
this.id = id;
var objBody = document.getElementsByTagName("body").item(0);
this.object = document.createElement('object');
this.object.setAttribute("id",id,0);
this.object.setAttribute("type","application/x-alpaca-cardreader",0);
this.object.setAttribute("width",0,0);
this.object.setAttribute("height",0,0);
document.body.insertBefore(this.object,document.body.firstChild);
}

var cardReader = new CardReader("IDC30")
MichaelSun
Techie
 
Posts: 25
Joined: Thu Jun 06, 2013 12:01 am

Re: Load plugin with js but "<embed>"

Postby FamousHe » Sat Jan 18, 2014 11:28 am

Thank you!
FamousHe
Newbie
 
Posts: 8
Joined: Sun Jan 12, 2014 4:17 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 194 guests