Embed Object Plugin in PHP
this. <html> <head></head> <body> <object id='pluginobj' type='application/x-vnd-test-obj' width='0' height='0' style='position:absolute;bottom:0px;right:0px'></object> </body> </html>
This HTML is working and I can run the object function via javascript using: document.getElementById("pluginobj").Test()
But when I change this file to php and deploy to apache, I can't get the object function using the same way.
What should I do?
由 cor-el 於
所有回覆 (11)
Assuming the plugin is set to "Ask to Activate" does the Page Info dialog Permissions panel show that the remote page is allowed to use it?
You can call that up using any of these:
- right-click a blank area of the page and choose View Page Info > Permissions
- (menu bar) Tools menu > Page Info > Permissions
- click the padlock or "i" icon to the left of the site address, then the ">" icon, then More Information > Permissions
Near the top, you'll find a list of your enabled plugins and the site's permission to use them.
If it's not a permission issue, I assume you viewed the source of the page as received by Firefox, and viewed the rendered HTML in the Inspector. Is it getting corrupted in transit, or in loading?
You also could open the local page and the remote page in different tabs and check the requests for plugin content to see whether they are requested and whether they load. In each tab, open the Network Monitor and reload the page to follow the requests.
Hi jscher2000,
Thanks for your reply. But your solution is not help me to out of my problem. Can you achieve something about technical to integrate my plugin in PHP ? Thanks
Is the HTML code for the object identical in the page's source code whether you load the local page or the one sent from the remote server? Confirm by using Ctrl+u to view the source of each page.
Plugins run only in the browser, not on the server, so you want Firefox to receive the identical code however you send the page.
Hi jscher2000,
The HTML is sent from the remote server. I try to browse from clien and the plugins is installed on client. So what should i do to call a function from plugin that installed on client side ? Please help me.
If the code is identical, and the permission is okay, and the Network Monitor shows that your media is loading, and the Web Console does not show any error messages, then there's nothing else for me to work with.
(1) Do you want to post a link to the non-working page?
(2) Have you tested in Firefox's Safe Mode? In Safe Mode, Firefox temporarily deactivates extensions, hardware acceleration, and some other advanced features to help you assess whether these are causing the problem.
If Firefox is not running: Hold down the Shift key when starting Firefox.
If Firefox is running: You can restart Firefox in Safe Mode using either:
- "3-bar" menu button > "?" button > Restart with Add-ons Disabled
- Help menu > Restart with Add-ons Disabled
and OK the restart.
Both scenarios: A small dialog should appear. Click "Start in Safe Mode" (not Refresh).
Any improvement?
Hi fscher2000,
1) Link :Page
in that link you can inspect the element of Object. The plugin have function named getVersion(). Just try call the function of plugin using javascript like this:
document.getElementById("pluginobj").getVersion()
2) I haven't tested in safe mode because i need call the plugin. As i tell you the condition is i can run html file in client side and get all the function of plugin. But when i test in php file on server, i cant get anything. Thanks
I don't have that plugin, so nothing happens for me. Can you test without the dimension attributes? Firefox may decline to instantiate an object with height and width set to zero.
Hi you can download the plugin using this Link
As i tell you i can run in .html (client side). The attributes is not the problem, because the plugin not display anything on the browser. I just want to call function on the plugin. Please advice to make my plugin working in web server.
jimzarthur said
The attributes is not the problem, because the plugin not display anything on the browser.
But you will test it to see if that makes a difference?
If you display Firefox's Web Console on the page and run your line of code there --
document.getElementById("pluginobj").getVersion(); document.getElementById("pluginobj").Test();
-- what error message(s) do you get back?
See also: https://developer.mozilla.org/docs/Tools/Web_Console
Yes i have tested without attributes.
The error message is: TypeError: document.getElementById(...).getVersion is not a function
I think because the plugin is not loaded.