show json in browser?

This is a discussion on show json in browser? within the PHP Language forums, part of the PHP Programming Forums category; Hello, a browser will download the file test.php instead of to display it, if the content type is text/...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-26-2007
xu.devel@googlemail.com
 
Posts: n/a
Default 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

Reply With Quote
  #2 (permalink)  
Old 04-26-2007
Rami Elomaa
 
Posts: n/a
Default Re: show json in browser?

xu.devel@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.

--
Rami.Elomaa@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
Reply With Quote
  #3 (permalink)  
Old 04-27-2007
Toby A Inkster
 
Posts: n/a
Default 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
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Reply With Quote
  #4 (permalink)  
Old 04-27-2007
-Lost
 
Posts: n/a
Default 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.
Reply With Quote
  #5 (permalink)  
Old 04-27-2007
Toby A Inkster
 
Posts: n/a
Default Re: show json in browser?

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!
Reply With Quote
  #6 (permalink)  
Old 04-27-2007
-Lost
 
Posts: n/a
Default 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.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:24 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0