« first day (136 days earlier)      last day (4805 days later) » 

11:00 PM
if i call the server for the json, it tries to save it. When i do that and paste the contents of the file into jsonlint.com, it is valid json. However, when i paste the server url in jsonlint, i get invalid json: it shows two dashes as the first character
and jquery also compains it is invalid json
it worked on my dev servers, moved it to production environment and the json is invalid
i don't get it
 
Neo
are you using php to generate json?
 
yes
 
Neo
are you doing something like: `header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');`
 
retrieve data from mysql > array ? json_encode
 
Neo
at the begining of the php file?
noteably: header('Content-type: application/json');
 
11:01 PM
`header("Content-Type: application/json; charset=utf8");
echo json_encode(array('albums'=>$albums));`
 
Neo
?
 
no it's not at the beginning
 
Neo
try 'text/json' instead.
 
ok
 
Neo
it doesnt have to be at the begining as long as there is not output or compression
 
11:03 PM
nope
this is what ff shows in the alert:
parsererror
Invalid JSON: {"albums":[{"album":
hmm if i paste it in notepad++ i get a ? before the first {
like i said, it works on my dev environment
 
Neo
just to find where your problem is try text/html
 
ok
 
Neo
is your html doctype strict?
 
nope
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
with text/html, ff returns the json as expected
 
Neo
then you should be able to use it by changing application/json to text/plain
 
11:08 PM
but when i copy it to np++, it shows a ? before the first { again
 
@Roel The reason you're getting a "?" in notepad is because of this character: fileformat.info/info/unicode/char/feff/index.htm
For some reason your json contains that character, which it probably shouldn't
 
indeed
the text/plain doesn't fix it
i think it has to do with server config
because on my local hosts i don't see this behavior
 
Neo
@Roel my understanding is that something in the serverside http header makes the browser react that way I had similar problem with apache when I upgrade to apache2 it was resolved..I've always been trying to find out what it is that makes it download the JSON file
@Roel well does text/plain still try to download it?
 
no text/plain shows the json
but the javascript still bombs:
parsererror
Invalid JSON: {"albums":[{"album":
 
Neo
well that is a totally separate problem... no you need to validate your json
 
11:13 PM
Are you using php?
 
yes
 
Neo
is this somewhere we can see?
 
not really
let me see
ok FF doesn't show anything strange in the text/plain, Chrome shows a small -
i'm just gonna have a chat with the server admin tomorow, maybe he knows something
thanks you guys for the help already! really appreciate it
is there i way to give you some Stackoverflow reputation?
 
Not really, unless you upvote a random answer or question we have made. :P
 
allo all :)
 
11:18 PM
Hey Gray
 
ok
but thanks again!
 
When's pay day
@Roel Yw
 
Neo
@Roel yw, sorry couldnt help much
 
yes no problem
 
Trying to decide how I should start making an isometric game in javascript/html
 
Neo
11:25 PM
what kind of game
 
Some sort of RPG
 
Neo
Im using jqEngine
 
@david o.O
 
Neo
nice
 
11:26 PM
that's as far as the isometric thing got though :(
 
Neo
@david nice
Im actually working on something too but I didnt even get as far as david
 
That's using the actual html5 canvas
 
Neo
I was working on a 2d fighter game before that: neo.ironguin.com
 
@Neo Wow very nice
 
Neo
but I need to find other people to work with, its too much work to invest in by myself right now
 
11:29 PM
Anyone able to help me with figuring out why the OnSelectedIndexChanged event handler does not fire
 
this is where the isometric thing ended up: jsfiddle.net/ctrlfrk/hNaYu/74
4
 
Neo
@david this is awesome
 
@david nice
 
@david Sweetness
 
@David, what does one have to study to learn to write code that does that?
 
11:32 PM
@Kobojunkie I was just dinking with something similar the other day. IE was stupid and wouldn't fire onChange on a checkbox, so I had to use onClick...
 
I am using a RadComboBox and it seems it renders as a table, so I searched to find the OnSelectedIndexChanged event is what I needed to tie into
 
Neo
@Kobojunkie javascript? you need to be smart and mathematical like david too
 
@Kobojunkie er, I just read lots of stuff online.
I'd also encourage everyone to sign up to javascriptweekly.com
2
It has some awesome links in it. Like this flocking one last week: harry.me/2011/02/17/neat-algorithms---flocking/…
 
Neo
@david cool, I feel like I know nothing
well on second thought I already knew that
lol
 
Essentially, I have a RadComboBox a Radgrid to allow users, in edit mode, make more selections by displaying a popup when user makes a selection from the RadComboBox
Problem is, the code does not seem to be firing at all
I added some alert boxes in my code to check and nothing still happens
@david, I will definitely sign up and look into that
I want to learn to code Javascript that well
 
11:44 PM
:( unfortunately I now know that what i wrote isn't coded well. It's better than I used to do, but still pretty gross at the end of the day.
needed more planning...
 
Neo
@Shaz what is this?
 
@Neo Google Chrome "weekly" build
 
Neo
cool
 

« first day (136 days earlier)      last day (4805 days later) »