Treehouse: Grow your CSS skills. Land your dream job.

If No Text is on the Page…

  • # April 10, 2010 at 12:01 pm

    Im reletively new to javascript / jquery but is there a way to do the following?

    if, there is no text whatsoever on the page, then, display the following text: "some text".


    # April 10, 2010 at 1:04 pm

    I don’t think there is a way to do it if there is nothing on the page whatsoever.

    In any case, this should be done server side using PHP or ASP because it is not reacting to user input but should be actioned before the page loads

    # April 10, 2010 at 1:26 pm

    how is this done? is it simple or is it more complex?

    # April 11, 2010 at 8:39 pm

    It depends on the circumstances of why you would want to do this.

    Could you give us an example of how it would be used e.g. why would there be no text on the page?

    # April 11, 2010 at 9:34 pm

    we have a bomgar support portal (remote support) that if a representative is logged in the Bomgar support client it lists their name. but if no one is online the page is left blank. I would like it to say "No representative is available.

    There is nothing elses on this page. I have the support page loading in an iframe in another page. I have my reasons why I have it set up this way, but this i basically why I would like to do this.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.