JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 26th, 2010, 10:46 PM
forume forume is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2010
Posts: 2 forume User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 34 sec
Reputation Power: 0
Javascript to call html/text file

Hi,

I would like to know if it is possible for a html page, using a javascript to call another html/text file. Basically I have many listings on ebay using standard html. In one section of the listings I have an advertisement. I would like to change this advertisement periodically. Rather than changing each and every listing with the new advertisement html code, I would like to be able to change just one file so that all my listings update with the new advertisement.

So something like this:
listing1.html
listing2.html
listing....... and so on.

Calls advertisement.html

This updates all the listings with the new code within advertisement.html

Much like CSS in that I can effectively change all the listings by changing the one .css file.

I understand that an SSI would do the job, however, ebay does not allow SSI; they do however allow javascripts.

Thank you.

Reply With Quote
  #2  
Old June 27th, 2010, 09:34 AM
E-Oreo's Avatar
E-Oreo E-Oreo is online now
Lost in code
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Dec 2004
Posts: 8,051 E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 1 Day 4 h 41 m 20 sec
Reputation Power: 7104
You could use an iframe if they allow that.
__________________
PHP FAQ
How to program a basic, secure login system using PHP
Connect with me on LinkedIn


Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
  #3  
Old June 27th, 2010, 01:37 PM
ktoz ktoz is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Posts: 562 ktoz User rank is Second Lieutenant (5000 - 10000 Reputation Level)ktoz User rank is Second Lieutenant (5000 - 10000 Reputation Level)ktoz User rank is Second Lieutenant (5000 - 10000 Reputation Level)ktoz User rank is Second Lieutenant (5000 - 10000 Reputation Level)ktoz User rank is Second Lieutenant (5000 - 10000 Reputation Level)ktoz User rank is Second Lieutenant (5000 - 10000 Reputation Level)ktoz User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 3 h 4 m 2 sec
Reputation Power: 69
Don't know if eBay would allow this...

But I use this little function to read files on servers where I have some control of the permissions.

javascript Code:
Original - javascript Code
  1.  
  2. function ReadFile(inURL)
  3. {
  4.     var http = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP') ;
  5.    
  6.     http.open("get", inURL, false);
  7.     http.send(null);
  8.    
  9.      if (http.status == 200)
  10.         return http.responseText;
  11.         
  12.     return null;
  13. }

Last edited by ktoz : June 27th, 2010 at 01:39 PM.

Reply With Quote
  #4  
Old June 27th, 2010, 03:02 PM
E-Oreo's Avatar
E-Oreo E-Oreo is online now
Lost in code
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Dec 2004
Posts: 8,051 E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 1 Day 4 h 41 m 20 sec
Reputation Power: 7104
You can't use XHR cross domain, and I doubt Ebay will let you host the file on the ebay.com domain name.

Reply With Quote
  #5  
Old June 28th, 2010, 06:56 AM
forume forume is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2010
Posts: 2 forume User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 34 sec
Reputation Power: 0
Thanks for your replies.

They won't allow iframes and I don't think they'll host any files except images.

Does this mean it isn't possible?

A php call would do, but again they don't allow any php either.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Javascript to call html/text file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap