Dynamically managing certain document aspects (e.g. title)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • KE

    #1

    Dynamically managing certain document aspects (e.g. title)

    Hi

    I have this Javascript code snippet which I add to the "onload" event
    of the "<body>" tag:

    document.title = document.getEle mentById('colum n_title').inner HTML;

    The element id "columnt_ti tle" is the id of a heading ("<h1>") on the
    page that happens to be the title of the main article on that page.

    I couldn't find this in the help or main reference documents on
    php.org. I'm sure it's pretty simple. Is it...

    $document->title =
    €document->get_element__b y___id('column_ title')->£(["_inner_HTM L_"])->|<<-(...);

    ? :-D (impish grin) (I added the other currencies to make the code more
    robust. The extra underscores makes the call virtual :-])

    Thanks!


    -- K

    P.S. This is a serious question, I'm only trying to be humorous.

  • Mateusz Markowski

    #2
    Re: Dynamically managing certain document aspects (e.g. title)


    KE napisał(a):
    Hi
    >
    I have this Javascript code snippet which I add to the "onload" event
    of the "<body>" tag:
    >
    document.title = document.getEle mentById('colum n_title').inner HTML;
    >
    The element id "columnt_ti tle" is the id of a heading ("<h1>") on the
    page that happens to be the title of the main article on that page.
    >
    I couldn't find this in the help or main reference documents on
    php.org. I'm sure it's pretty simple. Is it...
    >
    $document->title =
    €document->get_element__b y___id('column_ title')->£(["_inner_HTM L_"])->|<<-(...);
    >
    ? :-D (impish grin) (I added the other currencies to make the code more
    robust. The extra underscores makes the call virtual :-])
    >
    It's rather DOM question.

    echo $document->getElementById ('column_title' )->firstChild->nodeValue;

    Comment

    • mannerboy

      #3
      Re: Dynamically managing certain document aspects (e.g. title)

      sth wrong with the tag <hl>

      i can't get the string value between <hland </hl>,

      <div or <spanworks...

      "KE дµÀ£º
      "
      Hi
      >
      I have this Javascript code snippet which I add to the "onload" event
      of the "<body>" tag:
      >
      document.title = document.getEle mentById('colum n_title').inner HTML;
      >
      The element id "columnt_ti tle" is the id of a heading ("<h1>") on the
      page that happens to be the title of the main article on that page.
      >
      I couldn't find this in the help or main reference documents on
      php.org. I'm sure it's pretty simple. Is it...
      >
      $document->title =
      €document->get_element__b y___id('column_ title')->¡ê(["_inner_HTM L_"])->|<<-(...);
      >
      ? :-D (impish grin) (I added the other currencies to make the code more
      robust. The extra underscores makes the call virtual :-])
      >
      Thanks!
      >
      >
      -- K

      P.S. This is a serious question, I'm only trying to be humorous.

      Comment

      • KE

        #4
        Re: Dynamically managing certain document aspects (e.g. title)

        well, as I've noted, you need an "id" attribute set. e.g.

        <H1 id="article_tit le">I am a cool title for an article, if you've ever
        seen one</H1>

        See if you can reference it this way. "<span>" is fine too, thought.

        Thanks


        mannerboy wrote:
        sth wrong with the tag <hl>
        >
        i can't get the string value between <hland </hl>,
        >
        <div or <spanworks...
        >
        "KE дµÀ£º
        "
        Hi

        I have this Javascript code snippet which I add to the "onload" event
        of the "<body>" tag:

        document.title = document.getEle mentById('colum n_title').inner HTML;

        The element id "columnt_ti tle" is the id of a heading ("<h1>") on the
        page that happens to be the title of the main article on that page.

        I couldn't find this in the help or main reference documents on
        php.org. I'm sure it's pretty simple. Is it...

        $document->title =
        €document->get_element__b y___id('column_ title')->¡ê(["_inner_HTM L_"])->|<<-(...);

        ? :-D (impish grin) (I added the other currencies to make the code more
        robust. The extra underscores makes the call virtual :-])

        Thanks!


        -- K

        P.S. This is a serious question, I'm only trying to be humorous.

        Comment

        • william.clarke

          #5
          Re: Dynamically managing certain document aspects (e.g. title)

          I'm confused, how does any of this relate to PHP?

          Comment

          • KE

            #6
            Re: Dynamically managing certain document aspects (e.g. title)

            Doesn't finding the way to dynamically change the title of an HTML
            document with a PHP script relate to PHP in any way?

            william.clarke wrote:
            I'm confused, how does any of this relate to PHP?

            Comment

            Working...