Getting an jpeg/gif image from code (java script)
Getting an jpeg/gif image from code (java script)
Author
Discussion

samn01

Original Poster:

874 posts

294 months

Thursday 1st April 2004
quotequote all
I have the ability for upload banners on to my new website. The problem I have is that I can only upload the banners as images (jpeg/gif/bmp etc) but the companies banners I want to upload are only supplied in code form (Java script).
How do I convert the Java script into a jpeg that I can actually upload???

Thanks for your help!!!

Sam

milo

40 posts

275 months

Thursday 1st April 2004
quotequote all
Do you mean, the companies have provided a link on their website which when run, creates images dynamically? Such as <img src="http://www.domain.com/script/adsciprt.js"> type thingy?

Or they provide JS whichrender a more textural advert, such as scrolling text?


Milo

samn01

Original Poster:

874 posts

294 months

Thursday 1st April 2004
quotequote all
It looks like this

<script language="javascript">
var uri = 'http://website.com/imp/js/99761/960702?' + new String (Math.random()).substring (2, 11);
document.write('<sc'+'ript language="JavaScript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
</script>

Any ideas?

samn01

Original Poster:

874 posts

294 months

Thursday 1st April 2004
quotequote all
Anyone??

gopher

5,160 posts

285 months

Thursday 1st April 2004
quotequote all
It seems the banners are served up on a random basis which quite normal. I would suggest the easiest way would be refresh the page until you can see the banner you want, right click on the banner and choose Save Picture As - give it a name then upload it from there.

Cheers

Paul

milo

40 posts

275 months

Thursday 1st April 2004
quotequote all
If I understand correctly, You can upload binary (images) and you want to upload text. So unless you change your upload mechanisum, you won't be able to.

samn01

Original Poster:

874 posts

294 months

Thursday 1st April 2004
quotequote all
Yeah the problem I have is that the code behind the banners is what is used to montior clicks etc so I cant just right click, save as or I will get the banner but not the code behind it that will link the clicks to my site.

I can upload only images so if there was a way to convert the code into an image before I uploaded it it would solve my problem. Does anyone know how to do this?
It seems I can get the code in HTML/javascript or IFrame?????

greenv8s

31,003 posts

310 months

Thursday 1st April 2004
quotequote all
Maybe I've misunderstood your problem. The people who provide the images are obviously set up to serve them out on demand. To do this you would insert the HTML text fragment they gave you, into the document where you want the banner to appear. When the user opens the document the text fragment downloads the image directly from the people who are providing the images. You never need to upload the images to your web site at all. Or maybe you're deliberately trying to avoid having your users get the images from your supplier. If so, why?

samn01

Original Poster:

874 posts

294 months

Thursday 1st April 2004
quotequote all
Ah Ok I see how it works now...

This causes me a problem as my admin pages dont allow me to upload code.
Thanks for your help, time to talk to the developers again.

Sam