Outdated frames, what is a full replacement for them?

A site that makes heavy use of the main iframe

I inherited an outdated code base / website, http://ninjawars.net . Fragments were in place before I started coding on the site.

I constantly hear about iframes problems (security, accessibility, layout problems), and I'm pretty sure iframes are not suitable for search engines (a big minus). My personal experience with iframes mostly saw problems with their load times (heavy HTTP requests, I think?).

Iframe replacement search

Unfortunately, no one who says "get rid of iframes" also provides an effective solution to my situation, usually assuming that a simple component of the frame content will do all the rainbows and unicorns (for example, Convert from frames ). In my case, the static enabled solution does practically nothing for me.

jQuery load () (dynamically loads content in a div, for example) is better suited, but converting to this method will take time and does not provide access for search engines or non-javascript-viewing users. jQuery load () fixes a performance issue, but I'm not sure if it fixes an accessibility issue. Even without javascript, iframes still work (for manual clicks), although if the practical support for iframes running under javascript is practical, I'm not sure.

Possible alternatives?

  • jQuery and load ()
  • Completely rewrite the site to static pages with a common header / footer / sidebar + some minor javascript poll.
  • ??? Something else has not been reviewed by me.
+3
3

Iframes - , . -.

. , "" - , , SEO .

jQuery . jQuery , , javascript- .

, - jQuery, :

  • . , ajax ( , iframe), . " " - - , javascript, ajax div . , . iframes div, , iframe.

  • jQuery. , ajax , .

  • javascript , script, .

( , ):

$(document).ready(function() {

    $("#menu a[href]").each(function() {
        this.href = this.href.replace(/Index/, "Ajax");
    })
    .click(function() {
        $.get(this.href, null, function(data) {
            var $main = $("#main");
            $main.hide();
            $("#main").html(data);
            $main.fadeIn("slow");
        });
        return false;
    });

script , "/Index/" URL- "/Ajax/", URL- , ajax, , .

, JS, , JS .

+4

jQuery Ajax ? , - , . , . , , .

+1

, - , , , . , :

  • , , div, div, ": ".
  • , divs PHP . , , div.

, ( , ​​ Apache Tiles Java). . <div> </div> . , , , , .

+1

Source: https://habr.com/ru/post/1725786/


All Articles