Jump to content

Displaying info. on multiple sites through a code snippet.


Dannyboyonline

Recommended Posts

I'm trying to figure out a way to effectivly display information on client sites, the same way google adsense, adbrite or basically any other PPC website out there, just by having my clients add some code to their website.

 

Can someone please tell me what the best approach would be, such as should I use javascript, DHTML, iframes etc...

 

Thank you

i've written a couple of widgets in the past, and I usually used JS. really it comes down to what you want. If it's a large, complicated widget with LOTS of styling, you will probably want to go with iFrames. If it's something simple, you can probably get away with just JS

It's only a couple of 125x125 images on it.

 

What is this teqnique called? like using javascript to be used in this manner, I've been trying to find some guides online as to how to do it in a propper way. Although I know there's a ton of resources online as to how this is done I haven't managed to find the right place for it yet.

not sure what you will find out there...but you can just do:

 

<script type="text/javascript">var clientId = 123;</script>
<script type="text/javascript" src="http://www.your-server.com/widgets/widgetName.js"></script>

hmm... ok thanks guys, well from the javascript samples I've seen online most people simply point to a javascript file that basically collects some information such as document.location.href and document.referrer then document.write an iFrame that basically calls some sort of script passing those variables with it...

 

I was thinking that it would also be possible to actually creating a dynamic javascript file, whereby the website would use javascript.js.php?i=siteid as a javascript file, containing the dynamic data that is to be displayed for that site.

 

I don't know if it's a good idea or not but from my thoughts my idea would result in a single request on the server against the first method I mentioned where two requests are required to first load the js file and then load the php file to fill the iFrame.

 

what do you guys think I should do?

That should work. Keep in mind though, that an all in one request will slow the user's page load. By doing the bulk of the work in a request post page load, the client's page will load quickly still, and your stuff might just take an extra half second to show up. The choice is yours...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.