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 3 of 3

Thread: Prefetching

  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Prefetching

    Hello.
    I am trying to prefetch pages with JS, and being a complete newcomer I googled my way to some script that would help me do that.

    I apologize in advance if this is in the wrong forum.

    I want to preload the pages when the first page loads, but don't really know exactly if this code is usable:
    <script type="text/javascript"> (function ($) {
    $.ajax({ url: "info.aspx", cache: true, dataType: "html" });
    $.ajax({ url: "contact.aspx", cache: true, dataType: "html" });
    $.ajax({ url: "links.aspx", cache: true, dataType: "html" });
    $.ajax({ url: "default.aspx", cache: true, dataType: "html" });
    })(jQuery);</script>

    Problem is, it just loads as plain text, losing all design.
    How do I get it to prefetch the pages and not abolish everything else?

    Thanks in advance!

    Regards,
    Mowinckel

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,184
    Thanks
    10
    Thanked 569 Times in 550 Posts
    use an iframe to render the pages and all their images, scripts, styles, etc...
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5

  • Users who have thanked rnd me for this post:

    Mowinckel (04-19-2012)

  • #3
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Oh, iFrames. It's been ages since I've handled that. Do you have a 101 guide to iframes?

    EDIT: Found one here inline frames
    Last edited by Mowinckel; 04-19-2012 at 04:51 PM.


  •  

    Tags for this Thread

    Posting Permissions

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