show json in browser?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • xu.devel@googlemail.com

    show json in browser?

    Hello,

    a browser will download the file test.php instead of to display it, if
    the content type is text/x-json.

    Is it possible to display the text in the browser?

    == file: test.php ==
    <?php
    header("content-type text/x-json")
    echo "test";
    ?>

    thanks

    best regards,
    schuen

  • Rami Elomaa

    #2
    Re: show json in browser?

    xu.devel@google mail.com kirjoitti:
    Hello,
    >
    a browser will download the file test.php instead of to display it, if
    the content type is text/x-json.
    >
    Is it possible to display the text in the browser?
    >
    Yes, set the content-type to something the browser can handle
    (text/plain, for example) instead of text/x-json.

    --
    Rami.Elomaa@gma il.com

    "Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
    usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze

    Comment

    • Toby A Inkster

      #3
      Re: show json in browser?

      Rami Elomaa wrote:
      Yes, set the content-type to something the browser can handle
      (text/plain, for example) instead of text/x-json.
      Alternatively, configure the browser to open text/x-json documents itself.

      --
      Toby A Inkster BSc (Hons) ARCS
      Fast withdrawal casino UK 2025 – Play now & cash out instantly! Discover the top sites for rapid, secure payouts with no delays.

      Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

      * = I'm getting there!

      Comment

      • -Lost

        #4
        Re: show json in browser?

        Toby A Inkster wrote:
        Rami Elomaa wrote:
        >
        >Yes, set the content-type to something the browser can handle
        >(text/plain, for example) instead of text/x-json.
        >
        Alternatively, configure the browser to open text/x-json documents itself.
        How?

        --
        -Lost
        Remove the extra words to reply by e-mail. Don't e-mail me. I am
        kidding. No I am not.

        Comment

        • Toby A Inkster

          #5
          Re: show json in browser?

          Lost wrote:
          Toby A Inkster wrote:
          >
          >Alternativel y, configure the browser to open text/x-json documents itself.
          >
          How?
          Depends on the browser being used. In Opera it's in

          Preferences =Advanced =Downloads

          --
          Toby A Inkster BSc (Hons) ARCS
          Fast withdrawal casino UK 2025 – Play now & cash out instantly! Discover the top sites for rapid, secure payouts with no delays.

          Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

          * = I'm getting there!

          Comment

          • -Lost

            #6
            Re: show json in browser?

            Toby A Inkster wrote:
            Lost wrote:
            >Toby A Inkster wrote:
            >>
            >>Alternatively , configure the browser to open text/x-json documents itself.
            >How?
            >
            Depends on the browser being used. In Opera it's in
            >
            Preferences =Advanced =Downloads
            Thanks.

            --
            -Lost
            Remove the extra words to reply by e-mail. Don't e-mail me. I am
            kidding. No I am not.

            Comment

            Working...