2

I have a dialog that opens when pressing my site's footer links (contactus.htm, profile.htm, useterms.htm).

The problem is that these pages are not styled well when someone gets to them from a search engine.

For example, I want to add a border line to the page and if I would do so it won't look good inside a dialog box — there will be 2 border lines: dialog and page.

How can I add a style if the page is enterned not from the footer/dialog but from a search engine?

Code:

$(document).ready(function() {
    $('#footerProfile').click(function() {
        _gaq.push(['_trackEvent', 'internal', 'popup']);
        var $dialog = $('<div></div>').load($('#footerProfile').attr('href')).dialog({
            autoOpen: false,
            width: 590,
            height: 470,
            resizable: 'false',
            modal: true
        });
        $dialog.dialog('open');
        return false;
    });
});
Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
Irena
  • 49
  • 2
  • 4

2 Answers2

0

Use norobots.txt to exclude those pages from being indexed by search engines. They aren't being used as pages anyway.

Conversely you could conditionally include the css to the file using jquery. The last answer to this question on SO seems to show to implement a scheme for doing that.

Community
  • 1
  • 1
Jason
  • 15,915
  • 3
  • 48
  • 72
0

You may append a parameter to the loaded URL when calling the URL by dialog. In the requested page you will be able to determine if this is a call via load() and if not style it(e.g. by including a stylesheet).

Another option:(I would prefer)
Use a styled page for the requested URL(as you want it to appear when it's called standalone) and use the optional selector for load() to insert only the needed fragment.

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201