By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

show json in browser?

P: n/a
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

Apr 26 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
xu******@googlemail.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.

--
Ra*********@gmail.com

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

P: n/a
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
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 27 '07 #3

P: n/a
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.
Apr 27 '07 #4

P: n/a
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

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 27 '07 #5

P: n/a
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.
Apr 27 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.