markschenkel
asked on
When to use javascript or <object> tag
I have an application which dynamically creates jpeg based charts which can embedded into other web sites. I need to make available a script or code snippet which web publishers can copy and paste into their code. This code will then pull the graphic from my site when their page is served. It is more or less how Google Adsense works.
I have been able to successfully get it to work using the object tag (see sample below).
Would using some sort of javascript be a more robust solution? I ask because I notice that Google Adsense uses javascript instead of a simple object tag. If I use the object tag method, is there a better chance my content will be blocked by firewall security programs?
I have been able to successfully get it to work using the object tag (see sample below).
Would using some sort of javascript be a more robust solution? I ask because I notice that Google Adsense uses javascript instead of a simple object tag. If I use the object tag method, is there a better chance my content will be blocked by firewall security programs?
<OBJECT DATA="http://www.mysite.com/getjpeg" TYPE="image/jpg">
ASKER
Yes - I suppose that would work fine. Is this a common thing? What would happen if mysite.com goes down? Would it cause major delays on the "parent" page or even cause it to time-out?
ASKER
Some additional information. Accompanying this graphic there would be a clickable link back to the site (like a "Powered by"). I know this could still be included in the object tag. But I would want control over this and prevent it from being suppressed. Is this why javascript would be used in this situation? With javascript it is as the browser/client and not the server.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1. you mean
<script type="text/javascript" src="http://myserver.com/myscri pt.js"></script>
And fully qualify the paths to your server
2. why escape/unescape?
<script type="text/javascript" src="http://myserver.com/myscri
And fully qualify the paths to your server
2. why escape/unescape?
document.write('<a href="http://myserver.com/my_page_link.html" target="_blank" title="Powered by My Page"><img src="http://myserver.com/logo.jpg" border="0" /></a>');
Well, you can use an un-encoded form, it should not cause any problems.
<img src="http://www.mysite.com/getjpeg" />
?