Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

reading contents of a file to a table using html/js

Options
  • 19-01-2002 6:05pm
    #1
    Registered Users Posts: 10,501 ✭✭✭✭


    I have a column inside a table which is inside a table,

    Is it possible to have a frame in that column or is there some way i could have the contents of a .txt or .html file printed into it using js?


Comments

  • Registered Users Posts: 2,660 ✭✭✭Baz_


    ERK!!!! quite confusing.

    In short: no

    Theres no way to access files using javascript so your fecked im afraid, if however you can use server side includes and you dont need to format the data in the file you need to access then it can be added using this line: <!--#include file="header.html"-->

    Otherwise youre looking at php, if thats available to you.


  • Closed Accounts Posts: 2,695 ✭✭✭b20uvkft6m5xwg


    I reckon you could do that Slydice.

    If you just get a sample JS file and then leave the header commands etc. and then put your .txt contents or .html contents in that file and save it as xxxx.js .

    Then include it in the html of the page where you want it to appear. Give it a try at least:)


  • Registered Users Posts: 2,660 ✭✭✭Baz_


    I dont see what you mean 80p, if you mean a server side include then there is no need to use a javascript file extension as the include command will allow you to include and text file type .txt or .html would be fine.

    if you mean a method like this <SCRIPT type="text/javascript" language="javascript" src="http://www.programmingtutorials.org/menucode.js"&gt;
    </SCRIPT> Then you wont get the file contents either it just displays nothing. This tag expects sourcecode as the src and it might be very messy if you displayed your code everytime you used it.


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Use document.print() inside the .js file Baz. You could use an IFRAME/ILAYER alternatively, but that would be pretty sucky. :)

    adam


  • Closed Accounts Posts: 2,695 ✭✭✭b20uvkft6m5xwg


    Yeh its possible Baz but I agree...it is a bit contrived.
    I mean why go to all the trouble when you could do it in PHP / Server-Side etc.??

    IFrames are handy but not crossbrowser compatible
    ILayer works Ok too- ie- like banner ads


  • Advertisement
  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    IFrames are handy but not crossbrowser compatible
    ILayer works Ok too- ie- like banner ads


    They're not backwards-compatible, but you can make them pretty much cross-browser compatible by nesting the two:
    <iframe blah blah blah>
     <ilayer blah blah blah>
     </ilayer>
    </iframe>
    

    That way, only the ILAYER will show up in Netscape-compatible browsers, and only the IFRAME will show up in W3C-compatible jobbies.

    adam


  • Registered Users Posts: 2,660 ✭✭✭Baz_


    :o well arent i the clever one, NO!!


  • Closed Accounts Posts: 2,695 ✭✭✭b20uvkft6m5xwg


    Ah never mind baz- humility is an important trait. And you possess it:)

    Anyhooo...
    Adam you gave me an idea there for the new ticker. So I decided to bung it in the weblog using the iframe/ilayer.
    You can see it here if you like...
    http://home.stauntonline.com/
    just click on the weblog link (top frame)

    Pity the background is white, but hopefully DeV. & Cloud might tinker with that ticker page....maybe widen the width of the scroller etc. :)


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Adam you gave me an idea there for the new ticker. So I decided to bung it in the weblog using the iframe/ilayer. You can see it here if you like... http://home.stauntonline.com/
    just click on the weblog link (top frame)


    Very nice.

    Pity the background is white, but hopefully DeV. & Cloud might tinker with that ticker page....maybe widen the width of the scroller etc.

    It would be relatively easy for Cloud to make the ticker almost entirely configurable, with a bit of QUERY_STRING magic. You should ask about it on the admin forum, I'm sure others in the community would appreciate it.

    adam


  • Registered Users Posts: 944 ✭✭✭nahdoic


    that ticker is very, very cool.


  • Advertisement
Advertisement