Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    veb
    veb is offline
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I add content from another page.

    I want to create several pages (they can be text or html) with basic informatons for css formatting.
    example:
    <div class="appname"
    name: this app
    <div class="appdetails">
    Version: 1.0
    Date: 1/1/2011
    Description: this is an app
    </div>
    </div>


    I want to be able to save several of these and load them into a web page where they are formatted and displayed.

    This needs to be a client side solution so that I can be able to access this offline.

    Any suggestions?

    Edit: so far I have tried this but I am not sure about it.
    <object type="text/html" data="app1.html">

  • #2
    veb
    veb is offline
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    In Simpler Terms

    How can one web page retrieve html code from another source (text or html file) and parse it on the client's side.

  • #3
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    You can start a so called Ajax request if the source file is on the same domain, sub domain and is reachable via the same protocol as the current page

    If you search for Ajax you will find tons of examples

  • #4
    veb
    veb is offline
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you. First search result had the answer.

    Quick question: In the following example is page formatted then retrieved or does the calling page apply the CSS.

    <a href="javascript:ajaxpage('ajaxfiles/external3.htm', 'rightcolumn');">Page</a>

  • #5
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    The latter

    It is always the CSS from the calling page that is being applied to retrieved content.

  • #6
    veb
    veb is offline
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I append?

    I was searching for a new question and this was the first result. It builds on my original question so I will post here.

    How do I append (a div) from one page into the current page (div)

    So far I have two solutions for retrieving the content
    Code:
    //jquery load one element
    $('#rightcolumn').load('techtools/external.htm .app_specs');
    //ajax load full page
    ajaxpage('techtools/external.htm', 'rightcolumn');
    Now I don't want each call to the function to replace the current content but append to it.
    Last edited by veb; 07-22-2011 at 05:55 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •