Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Need help loading an external DIV file
Old 03-14-2005, 04:01 PM Need help loading an external DIV file
Junior Talker

Posts: 2
Trades: 0
Here is a link to a working example I am using.

http://www.medequipserv.com/needSomeHelp.htm

I need to load the part at the bottom of the page that looks like this:

<div id="excel">
Item,Price
LHA103GP,$999.99
AAM102,$999.99
AAM103,$999.99
</div>

I would like to load this part of the code from an external file instead of manually putting it in the page. This example is small, the actual model will have about 30,000 lines of items and prices. The prices will fluctuate, so if I have one external file that contains ALL the items and prices. I can easilly update the prices when they change, if I keep the DIV excel in the file, I would have to manually change it each time price changes, also it would take a ton of processing to put a div tag with 30,000 lines on every page that looks like this.
suspect52732 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-14-2005, 05:11 PM
numbenator's Avatar
Webmaster Talker

Posts: 523
Location: London
Trades: 0
My first thought is NO. the only way you can do this is is you have server side includes such as asp, php etc

Im wandering though if you could put code in a text file and change to

document.write("<<div id="excel">
Item,Price
LHA103GP,$999.99
AAM102,$999.99
AAM103,$999.99
</div>")

name it ??.js


and then usine the <javascript src=

Im just learning this but it might work. Would be intersested to know if does. I have a similar problem my self at the moment.
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 03-14-2005, 07:10 PM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
There is a way to do this... in Javascript.
You need to use the .innerHtml attribute of the DIV to manipulate it. You can get the contents of the file using the MSXMLHTTP object.
Can't give you the exact code cos I don't have it any more, sure there's examples around though...
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 03-15-2005, 11:32 AM Ian
Junior Talker

Posts: 2
Trades: 0
Thanks for the replys! I also thought about document.write to insert the data. The problem with this is the overhead processing. The example I showed had a few values, the actual working model has roughly 30,000 variable and values. Doing a doc.write is a good idea, but would require so much overhead it wouldn't be worth loading the page.



I think I maybe able to do this with javascript. I am thinking that I could use an external javascript (.js) which would contain:

var 12345 = "$10"
var 12346 = "$11"
and so on...

then in my html page have each link display its variable value. This way there would be a central item / pricing document.

Let me know if anyone has any other ideas. Also, I am very interested in this .innerHTML attrib for DIV. I will put in some hours tring to figure it out. Thanks guys, your advice is an invaluable resource!
suspect52732 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help loading an external DIV file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22801 seconds with 12 queries