What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » MySQL

MySQL
Author: Message:
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
RE: MySQL
quote:
Originally posted by Leroux
I'm having trouble with the eval function however.  I kept getting "Error: Expected ';' (code: -2146827284)".  Now that I've changed it to your however, with the extra "(" and ")" in it, I instaed get "Error: Expected ')' (code: -2146827282)".

- Out of interest, why are the extra brackets added?  Just so I fully understand the code I use.
That's because the "syntax" of your json object is incorrect so the parser throws an error :D


code:
SONIC THE HEDGEHOG:{"Title":"Sonic The Hedgehog","PSM":"A blue streak speeds by - It\\'s Sonic The Hedgehog"}
Sonic The Hedgehog:{"Title":"Sonic The Hedgehog","PSM":"Faster than the naked eye - It\\'s Sonic The Hedgehog"}


I got a better way to organize this output and deal it with JScript.

code:
{"results": [
        {"Title": "Sonic The Hedgehog", "PSM": "A blue streak speeds by - It\\'s Sonic The Hedgehog"},
        {"Title": "Sonic The Hedgehog", "PSM": "Faster than the naked eye - It\\'s Sonic The Hedgehog"},
        {"Title": "Sonic The Hedgehog", "PSM": "test"}
    ]
}

JScript code:
        xmlhttp.onreadystatechange = function(){
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
                var json = eval( '(' + xmlhttp.responseText + ')' );
               
                for (var x = 0; x < json.results.length; x++){
                    Debug.Trace(json.results[x].Title + "\n" + json.results[x].PSM);
                }
               
            }
        }
05-03-2009 02:57 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
MySQL - by ArkaneArkade on 04-26-2009 at 10:34 PM
RE: MySQL - by MeEtc on 04-27-2009 at 12:03 AM
RE: MySQL - by ArkaneArkade on 04-28-2009 at 11:57 AM
RE: MySQL - by Matti on 04-28-2009 at 04:25 PM
RE: RE: MySQL - by ArkaneArkade on 04-28-2009 at 10:45 PM
RE: MySQL - by Matti on 04-29-2009 at 11:06 AM
RE: MySQL - by ArkaneArkade on 05-02-2009 at 09:10 PM
RE: MySQL - by felipEx on 05-03-2009 at 01:12 AM
RE: RE: MySQL - by ArkaneArkade on 05-03-2009 at 01:33 AM
RE: MySQL - by felipEx on 05-03-2009 at 02:57 AM
RE: RE: MySQL - by ArkaneArkade on 05-03-2009 at 10:59 AM
RE: MySQL - by Matti on 05-03-2009 at 07:23 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On