3

I have written a HTML code of 300x200 dimension. Now my client wants that the code must fetch from a server and show it to the site they add the code.

We need to add this advertisement to approx 30-40 sites and the content will be changed after 10-15 days so replacing he content on these sites again and again will be pain.

So, I am thinking on adding this code to server/host and fetching and displaying to the website.

I am thinking of using a js script. But I have no idea how I can achieve it.

P.S. I have search on internet but I am not getting a proper keyword or what should I search for.

Can you help me in this thing?

The code will be implemented on blogging websites and wordpress websites.

Thanks

user2485649
  • 235
  • 1
  • 3
  • 13
  • This is what I understood. You want to put some html code in server and want to show in multiple sites. If this is your case then you can use iframe. You can simply upload your advertisement page in server. And load that into several sites using iframe. – AtanuCSE Dec 14 '13 at 17:02

1 Answers1

1

Host your dynamic PHP page (which shows your advertisement) on your server. Then you have a few options to display it on other websites:

  • Use JavaScript and include a .js file from your server (same php page, which outputs Javascript), and either use document.write or change the content of a div through a function
  • Use an iFrame and directly display the PHP page
  • HI, Currently the page is just normal HTML, so will that work? using iframe will help? will it not show the extra spacing? – user2485649 Dec 14 '13 at 17:42
  • Using an iFrame is not the best way out there. You can create a function to replace the Div's content with Javascript, save it on your server, and give the following to your customers:
    – Mohammad Tomaraei Dec 14 '13 at 17:45
  • okay, and in that script I will replace the div id content. But one more thing, what if the site already has js running and I will add mine, sometimes I have seen that two jquery files of diff. version conflict. – user2485649 Dec 14 '13 at 18:03