[jQuery] Re: getjson request an unavailable page

2009-11-20 Thread MorningZ
"ok, I will try by the use of ajax but nobody that used getjson had this problem?" Everyone and anyone using "$.getJSON" *is* using "$.ajax" straight from the jQuery file getJSON: function( url, data, callback ) { return jQuery.get(url, data, callback, "json"); }, which in turn calls

Re: [jQuery] Re: getjson request an unavailable page

2009-11-20 Thread Jon Crump
On Wed, 18 Nov 2009, Humpty Dumpty wrote: Thanks, I though that there was a "JSON" solution; ok, I will try by the use of ajax but nobody that used getjson had this problem? As a matter of fact, I just did. As I understand it $.getJSON() seems to be just a wrapper around an $.ajax() request

[jQuery] Re: getjson request an unavailable page

2009-11-18 Thread Humpty Dumpty
Thanks, I though that there was a "JSON" solution; ok, I will try by the use of ajax but nobody that used getjson had this problem?

[jQuery] Re: getjson request an unavailable page

2009-11-18 Thread Peter
use $.ajax() instead, you can define function when the ajax fails On Nov 18, 12:17 am, Humpty Dumpty wrote: > Hi guys, > I write a web page that retrieve the data from a JSON formatted file > but when this fiel doesn't exist I can't see any error; > how I can handle this situation > thanks

Re: [jQuery] Re: getJSON - need some direction please.

2009-11-07 Thread Michael Geary
Yeah, I though Michel's reply was a little snippy too. But that aside, he's right on the specific point that a synchronous Ajax call is to be avoided at all cost. It's even worse than he said: In a single-threaded browser like Firefox, *all* browser windows and tabs are locked up until your Ajax c

Re: [jQuery] Re: getJSON - need some direction please.

2009-11-05 Thread Michel Belleville
As long as you find your way b^^d Kind regards, and keep us updated. Michel Belleville 2009/11/6 RayJames > Man, that felt like an ass chewing but I needed it. :) I am going to > do some more homework and see how to put the advice you gave me to > good use. Thanks for your time Michel. I

[jQuery] Re: getJSON - need some direction please.

2009-11-05 Thread RayJames
Man, that felt like an ass chewing but I needed it. :) I am going to do some more homework and see how to put the advice you gave me to good use. Thanks for your time Michel. I really appreciate it. Ray James. On Nov 5, 2:42 pm, Michel Belleville wrote: > 2009/11/5 RayJames > > > Hi Michel,

Re: [jQuery] Re: getJSON - need some direction please.

2009-11-05 Thread Michel Belleville
2009/11/5 RayJames > Hi Michel, I think I might have confused you a bit. The user is not > necessarily my concern. Well... Then I guess it's not necessarily a good thing you design UI because it's all about the user. Ultimately, you're designing machines to work for humans, and when you're des

[jQuery] Re: getJSON: use retrieved data outside the function???

2009-10-20 Thread Dave
Ok, thats how it work. Thanks for your answer. :) Cheers / David On Oct 20, 6:38 pm, MorningZ wrote: > "Why, and how can I make it work??? " > > Because you aren't understanding asynchronous behavior... > > The script doesn't "wait" for the $.getJSON call to finish before > continuing on yo

[jQuery] Re: getJSON: use retrieved data outside the function???

2009-10-20 Thread MorningZ
"Why, and how can I make it work??? " Because you aren't understanding asynchronous behavior... The script doesn't "wait" for the $.getJSON call to finish before continuing on you'll need to do your work with "content" inside the success event, even if that means calling another function pas

Fwd: [jQuery] Re: getJSON callback not firing?

2009-09-26 Thread Felspar
Begin forwarded message: > From: Igor Romero > Date: September 26, 2009 AM 04:22:07 GMT+08:00 > To: jquery-en@googlegroups.com > Subject: Re: [jQuery] Re: getJSON callback not firing? > > can try this out > > function ajaxSucceed(result){ > alert(result.d);

[jQuery] Re: getJSON callback not firing?

2009-09-25 Thread Rick Faircloth
an consider myself at least a well-versed, basic programmer. -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Friday, September 25, 2009 11:19 PM To: jQuery (English) Subject: [jQuery] Re: getJSON callback not firing?

[jQuery] Re: getJSON callback not firing?

2009-09-25 Thread MorningZ
"the method as "post", occasionally venturing to use "get" when just retrieving data, just to see what might happen.nothing different. " Wow, really? knowing the difference between GET an POST are pretty fundamental things to know as a programmer http://www.google.com/search?q=get+vs+post It'

[jQuery] Re: getJSON callback not firing?

2009-09-25 Thread Rick Faircloth
Hang in there, Charlie! My head was very bloody from banging it against the wall when I first started down the AJAX road. Now I'm finally getting some work done with it! I almost gave up several times. fwiw, I have always used the $.ajax method without any problems and typically specify

[jQuery] Re: getJSON callback not firing?

2009-09-25 Thread MorningZ
$.getJSON is a convenience/wrapper method around the $.ajax call... so is $.getScript and $.get and $.post just open up the unpacked version of jQuery and search for "getJSON" and you'll see this first hand On Sep 25, 3:07 pm, Charlie Griefer wrote: > Z: thanks for the response.  I'm making my

[jQuery] Re: getJSON callback not firing?

2009-09-25 Thread Charlie Griefer
Z: thanks for the response. I'm making my initial foray into using jQuery for AJAX (up 'til now, had only used it for page manipulations). Given your response... would there ever be a situation where .getJSON() would be preferable to .ajax()? It seems odd that jQuery would have 2 methods that es

[jQuery] Re: getJSON callback not firing?

2009-09-25 Thread MorningZ
I'd suggest using the more generic $.ajax method so you can actually catch the error, as the $.getJSON fails silently, which is no good for programmers :-( $.ajax({ type: GET, url: "your URL", processData = true, data: {}, dataType: "json", success: function(json) {

[jQuery] Re: getJSON returning undefined instead of XMLHttpRequest

2009-09-20 Thread Blixa
Wonderful! Thanks. On Sep 20, 12:16 pm, Michael Geary wrote: > Ah, I did misread the problem. Now I follow you, thanks for the > clarification. > > There is indeed a better and simpler way to do this, which works with > *any*kind of asynchronous callback. You don't need to rely on having a > sp

[jQuery] Re: getJSON returning undefined instead of XMLHttpRequest

2009-09-20 Thread Michael Geary
Ah, I did misread the problem. Now I follow you, thanks for the clarification. There is indeed a better and simpler way to do this, which works with *any*kind of asynchronous callback. You don't need to rely on having a specific object returned that you can stuff data into. Simply use a closure.

[jQuery] Re: getJSON returning undefined instead of XMLHttpRequest

2009-09-19 Thread Blixa
Hi Mike, I think you might have misread my post and the code attached. I am quite aware of the fact that the callback function only runs upon a successful completion of the request and is run asynchronously. If you look at the code i've written you'll see that i am in fact _counting_ on that sin

[jQuery] Re: getJSON returning undefined instead of XMLHttpRequest

2009-09-19 Thread Michael Geary
getJSON, like all Ajax and Ajax-style calls, is *asynchronous*. That's what the A in Ajax stands for. Instead of trying to use a return value, you need to use the getJSONcallback function (which you're already providing) to do whatever you want with the data. So your code might look something lik

[jQuery] Re: getJSON response limit

2009-08-09 Thread rickoshay
I guess the surprise was his alert *appeared* to be dependent on the response size, and "of course" he did not get an error message.

[jQuery] Re: getJSON response limit

2009-08-09 Thread Michael Geary
You're giving the right answer to the wrong question. ;-) Chad's question had nothing to do with limits on GET parameters or the maximum length of a URL. The parameters were making it to the server just fine. The question was about any possible limits on the *response*. This wouldn't be affected

[jQuery] Re: getJSON response limit

2009-08-09 Thread MorningZ
"GET vs. POST would have nothing to do with this" Sure it could. http://classicasp.aspfaq.com/forms/what-is-the-limit-on-querystring/get/url-parameters.html Granted i do not know if newer browser versions have raised or removed that cap, but it's still something to consider To original po

[jQuery] Re: getJSON response limit

2009-08-09 Thread cfddream
Query (English)"; Subject: [jQuery] Re: getJSON response limit Well, the response actually returns, but the jQuery code do

[jQuery] Re: getJSON response limit

2009-08-09 Thread thephatp
I used json_encode in php to escape the new-lines and all works great now!

[jQuery] Re: getJSON response limit

2009-08-09 Thread thephatp
Well, the response actually returns, but the jQuery code doesn't execute. I've isolated the problem--I have a field in the database that stores general instructions that can be entered by a user. There is a carriage return for new-lines in the text that is captured. When one of these entries is

[jQuery] Re: getJSON response limit

2009-08-09 Thread Michael Geary
There is no set limit on the size of a JSON response, any more than there is on an HTML or XML response. You can have very large JSON responses with no problem. GET vs. POST would have nothing to do with this. Those are only different in the way the request is sent to the server; the response for

[jQuery] Re: getJson failing silently

2009-07-10 Thread poluris82
Thank you both, I've learned something new today from each of you. After a number of trials, I think I found the issue. There are some newline characters in some of the rows fetched from the database. I'm almost sure this is what is causing all the issues. I'll see if I can handle them in the ser

[jQuery] Re: getJson failing silently

2009-07-10 Thread Michael Geary
Instead of repeating the object name over and over again, you can simplify the code with an object literal: $.ajax({ type: 'GET', url: 'qtool', processData: true, data: { action: 'executeQuery', entity_name: queryText },

[jQuery] Re: getJson failing silently

2009-07-10 Thread poluris82
yes, I'm using firebug and it's really helpful. That's where I got the sample JSON data (that I gave in my message) from. The response header shows '200 OK' even when the ajax fails. And I see the json data returned in the response. On Jul 10, 11:18 am, MorningZ wrote: > Also i forgot to add: >

[jQuery] Re: getJson failing silently

2009-07-10 Thread MorningZ
That JSON looks fine in JSON Viewer as well (awesome tool if you are on a windows machine: http://www.codeplex.com/JsonViewer) I'd guess that the content type isn't what jQuery is expecting Firebug could/would tell you that "text/plain" or "application/json" is what would be best (and should

[jQuery] Re: getJson failing silently

2009-07-10 Thread poluris82
Thanks MorningZ. I just tried what you said and I got the alert for the responseText, which is basically the sample json data I gave in my listing. That json data looks good to me, but I cant understand why it failed though. Do you see any issues with that data? The json validator on www.jsonlint.

[jQuery] Re: getJson failing silently

2009-07-10 Thread MorningZ
Also i forgot to add: Use Firebug!! it's a HUGE help to help debug AJAX issues

[jQuery] Re: getJson failing silently

2009-07-10 Thread MorningZ
Don't use the $.getJSON method as it, as you are finding out, has no way to handle an error... use the generic $.ajax instead var Params = {}; Params.type = "GET"; Params.url = "qtool"; Params.processData = true; Params.data = {action: "executeQuery", entity_name: queryText }; Params.dataType =

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread mkmanning
You mentioned "Access to restricted URI denied", which is a cross- domain error. Just as an FYI, making a request to a different port number will trigger this. Something to always keep in mind when working with ajax. On Jul 6, 10:09 am, expresso wrote: > Ok, so their sending back a json response

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread Ricardo
When you use callback=? jQuery will create a random name for the anonymous function you pass in. For example: $.getJSON("CarouselHandler.ashx?jsoncallback=?",function(data) { }); The actual requested URL will be CarouselHandler.ashx? jsoncallback=abc12345, and the global variable 'abc12345' wil

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread expresso
Ok, so their sending back a json response wrapped with method foo. So then how would you specify foo in my example as the method to call on the getJSON script I've created? I think my example is fine as it is. We're not going cross server for now but wanted to understand how to form this and ho

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread expresso
Thanks. I'm not following you though per my example. I have specified function(data) as the method On Jul 6, 10:56 am, Bill Ramirez wrote: > If you pass a param to the json call, it gets passed into the > querystring: > > $.getJSON("jsdata/customerhandler.ashx", { show: Math.random(), > depart

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread Bill Ramirez
If you pass a param to the json call, it gets passed into the querystring: $.getJSON("jsdata/customerhandler.ashx", { show: Math.random(), departmentId: dptId}, customerLoaded); would be rendered as: jsdata/customerhandler.ashx?show=0.23231553&departmentId=123 the second parameter to the getJs

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread mkmanning
For JSONP, the server needs to wrap the response in the supplied callback. The cross-domain getJSON function is basically appending a script to the page, with the contents of that script being a function containing the data you want to pass back. Play around with the URL in the flickr example from

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread expresso
Adding a "&jsoncallback=?" or "&callback=?" got rid of the Access to restricted URI denied" code: "1012 but I get no data showing in my plug-in when adding either of those querystring params to my url. So I don't get it. I thought that it's supposed to automatically replace ? with function(data)

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread expresso
Adding a "&jsoncallback=?" or "&callback=?" got rid of the Access to restricted URI denied" code: "1012 but I get no data showing in my plug-in when adding either of those querystring params to my url. So I don't get it. I thought that it's supposed to automatically replace ? with function(data)

[jQuery] Re: getJSON 2nd param to pass data

2009-06-29 Thread mkmanning
It uses a GET request, so yes, it converts the name:value pairs into a querystring. Fiddler's fine but you can view the request in Firebug (which overall has more value for web development). On Jun 29, 8:00 pm, expresso wrote: > http://docs.jquery.com/Ajax/jQuery.getJSON > > I don't get what it

[jQuery] Re: getJSON not finding any data

2009-06-29 Thread expresso
to backtrack previous to my last post with the second error, I had to encode the string to get it working. Encoding got rid of the \u00 which it looked like jQuery did not like? On Jun 29, 9:25 am, MorningZ wrote: > The fact it is escaped could be an issue > > are you doing HttpUtility.HtmlEnc

[jQuery] Re: getJSON not finding any data

2009-06-29 Thread expresso
Fixed it. I actually needed to Encode it before. However now I have a second problem with the following code: $.getJSON("http://localhost:59396/xxx/xxxHandler.ashx? action=xxxjson", function(Data) { $.each(Data.items, function(i, item) { alert('got here'); ca

[jQuery] Re: getJSON not finding any data

2009-06-29 Thread MorningZ
The fact it is escaped could be an issue are you doing HttpUtility.HtmlEncode in your handler for some reason? Do you know about NewtonSoft's Json.NET library that makes it a snap to generate JSON from .NET classes? On Jun 29, 10:07 am, expresso wrote: > I have the following setup on my page

[jQuery] Re: getJSON parameter - long string

2009-06-26 Thread mkmanning
In a GET request the length of the URL is also browser dependent. IE has the shortest (at least as of IE7) at 2,083 characters with no more than 2,048 in the path portion. A non-scientific 2006 test showed Firefox to accept at least 100,000 characters, Safari at 80,000 characters, Opera at 190,000

[jQuery] Re: getJSON parameter - long string

2009-06-26 Thread Zbyszek Matuszewski
Maybe you hit the timeout for AJAX in jQuery? Try: $.ajaxSetup({ timeout: 1 }); It will change AJAX timeout to 10 seconds. Or you can try to do this by $.ajax method where you can specify the timeout. On Jun 26, 12:07 pm, "saa...@gmail.com" wrote: > Hi > > I am trying to send with getJ

[jQuery] Re: getJSON parameter - long string

2009-06-26 Thread David Andrews
Hi, There is a byte limit (2048) on the size of a url set in the server configuration (I think specific t IIS but maybe apache too) , if you dont have access to change these you will have to use POST to submit your string. On 26 Jun 2009, at 11:07, saa...@gmail.com wrote: Hi I am try

[jQuery] Re: getJSON flicker works but not mine -- URGENT HELP

2009-06-25 Thread David here
To: jquery-en@googlegroups.com > Subject: [jQuery] Re: getJSON flicker works but not mine -- URGENT HELP > > > > Since I can't debug pretty much on the server-side, I'd suspect that > somehow the data coming from flickr is more clean than from your host. > > I also get the f

[jQuery] Re: getJSON flicker works but not mine -- URGENT HELP

2009-06-25 Thread Etienne Robillard
Since I can't debug pretty much on the server-side, I'd suspect that somehow the data coming from flickr is more clean than from your host. I also get the following error, indicating most likely a problem parsing the json data: Error: invalid label Source File: http://include.classistatic.com/i

[jQuery] Re: getJSON flicker works but not mine -- URGENT HELP

2009-06-25 Thread dtrannn
Etienne, I'm using getJSON because I need to do cross-domain data fetching. I thought getJSON is the best way for doing that from reading the docs. No error messages show up in FF. In HTTP watch, I see the JSON content coming throw as { "title": "Recent Uploads tagged cat",

[jQuery] Re: getJSON flicker works but not mine -- URGENT HELP

2009-06-25 Thread Etienne Robillard
Hi dtrann, I never tried the $.getJSON method before but generally have better results using the plain $.ajax method. If you switch to that alternative, you should also pay attention to specifying the "json" dataType param. Oh and what is the error message reported ? ;-) Hope this helps, Etienn

[jQuery] Re: $.getJSON() Special Chars

2009-06-17 Thread Obi1
Ok, solved the problem using htmlentities() in all variables before assingnig them to smarty.

[jQuery] Re: $.getJSON() Special Chars

2009-06-17 Thread Obi1
everything is set to use utf-8. though i've notice now, first time i call the getJSON, on $ (document).ready, the response comes fine, with the right chars. the problem happens whe i click a button that calls the method again, witch is meant to perform a search. On 16 Jun, 19:23, James wrote: >

[jQuery] Re: $.getJSON() Special Chars

2009-06-16 Thread James
Make sure the page your Javascript is on is also also uses utf-8 content-type (e.g. in meta tags). Same for your PHP script. On Jun 16, 1:45 am, Obi1 wrote: > Hi, > > I'am having a bit of a problem with special chars in a getJSON > response which is the result from php and smarty > > the file ca

[jQuery] Re: getJson + asp.net

2009-05-28 Thread will
I noticed something...instead of parsing a json object I think it is trying to parse an xml docit is hitting the catch. I think I know what the issue is. This project was designed to work on a servlet engine and I'm running it via IIS 7the web config needs to have appropriate settings. Wil

[jQuery] Re: getJson + asp.net

2009-05-28 Thread will
Thanks so much...much cleaner. The json is generated fine ( [{"value":"","caption":"choose color"}, {"value":"bk","caption":"Black"}] ) but the drop downs are still not populating. Here's the after call returns: It appears that jQuery has touch the element but there are no options. On May 2

[jQuery] Re: getJson + asp.net

2009-05-28 Thread MorningZ
yck handcrafting JSON is a pain, thankfully there's great stuff out there by people who have thought of how to help, so some advice: grab this .NET component and drop it in your BIN directory: http://www.codeplex.com/json (note the new version only works with .NET 3.5, grab t

[jQuery] Re: getJson + asp.net

2009-05-28 Thread MorningZ
yck Advice: grab this .NET component and drop it in your BIN directory: http://www.codeplex.com/json (note the new version only works with .NET 3.5, grab the older one if you're in 2.0) then you can stay thinking like .NET and objects Class for each item Private Class

[jQuery] Re: getJSON problems

2009-05-24 Thread Al
Thanks for the reply. I changed it so that processData is declared before $(document).ready. Unfortunately, however, the function still does not seem to be called. getJSON must be doing the right thing, because I can see the data I'm trying to get when I go to the Net panel in Firebug and look in

[jQuery] Re: getJSON problems

2009-05-23 Thread Donny Kurnia
Al wrote: Hi, I'm trying to get some data as JSON, and want to show a spinning animation while doing so. I have the following jQuery/HTML: http://dpaste.com/46873/ The URL I pass to getJSON returns some data e.g. {'data': '123456789'} and seems to be working properly and returning valid JSON.

[jQuery] Re: getJSON

2009-03-26 Thread Mauricio (Maujor) Samy Silva
De: "iceangel89" i still cant out put anything even with a simple alert(json); - You must loop through data in order to retrieve their values: $.getJSON("data.js", function (json) {var allItems = json.length;$.each(jso

[jQuery] Re: getJSON

2009-03-26 Thread iceangel89
ok i solved it, it shld be something like { "departments": { "department": {"ID": 1, "Name": "Physics"}, "department": {"ID": 2, "Name": "Chemistry" }, "department": {"ID": 3, "Name": "Biology"},}} instead, use of {} and "departments": d: {xxx}, d: {yyy}, d: {zzz} am i right to say all these ar

[jQuery] Re: getJSON

2009-03-26 Thread iceangel89
i still cant out put anything even with a simple alert(json); in firebug i see that ... below ... is returned [ {"Value": 1, "Item": "Physics"}, {"Value": 2, "Item": "Chemistry"}, {"Value": 3, "Item": "Biology"} ]; On Mar 26, 5:34 pm, jakenoble wrote: > Shouldn't your JSON return values be dou

[jQuery] Re: getJSON

2009-03-26 Thread jakenoble
Shouldn't your JSON return values be double quoted"? [ {"Value": 1, "Item": "Physics"}, {"Value": 2, "Item": "Chemistry"}, {"Value": 3, "Item": "Biology"} ]; On Mar 26, 9:16 am, iceangel89 wrote: > i am trying to load json. but it seems like its not working. nothing > is alerted. supposed to be

[jQuery] Re: getJSON() response into a table

2009-03-21 Thread Mauricio (Maujor) Samy Silva
osh Powell" Para: "jQuery (English)" Enviada em: sábado, 21 de março de 2009 17:16 Assunto: [jQuery] Re: getJSON() response into a table $.getJSON("url", function(json){ $(json).each(function(){ row = $("#table").append(""); $(row).append(""

[jQuery] Re: getJSON() response into a table

2009-03-21 Thread Josh Powell
> $.getJSON("url", function(json){ > $(json).each(function(){ >    row = $("#table").append(""); >    $(row).append("").html(json.cell1.value); >    $(row).append("").html(json.cell2.value); > }); > }); > > something like this? This is a very, very, very... very slow way to append var html = ''

[jQuery] Re: getJSON() response into a table

2009-03-21 Thread Mauricio (Maujor) Samy Silva
[SOLVED] Maurício -Mensagem Original- De: "Maujor" Para: Enviada em: sábado, 21 de março de 2009 13:09 Assunto: [jQuery] getJSON() response into a table I'm trying to display data from a json request into a table. Table heading disapear when the request finishes and I can't figu

[jQuery] Re: getJSON() response into a table

2009-03-21 Thread Joseph Le Brech
have you got firebug? use the inspector to find out what it produces. From: css.mau...@gmail.com To: jquery-en@googlegroups.com Subject: [jQuery] Re: getJSON() response into a table Date: Sat, 21 Mar 2009 15:23:31 -0300 Hi Joseph, Thanks, but this didn't solve. Any ideas? Mau

[jQuery] Re: getJSON() response into a table

2009-03-21 Thread Mauricio (Maujor) Samy Silva
Hi Joseph, Thanks, but this didn't solve. Any ideas? Maurício -Mensagem Original- De: Joseph Le Brech Para: jquery-en@googlegroups.com Enviada em: sábado, 21 de março de 2009 13:23 Assunto: [jQuery] Re: getJSON() response into a table $.getJSON("url"

[jQuery] Re: getJSON() response into a table

2009-03-21 Thread Joseph Le Brech
$.getJSON("url", function(json){ $(json).each(function(){ row = $("#table").append(""); $(row).append("").html(json.cell1.value); $(row).append("").html(json.cell2.value); }); }); something like this? sorry im just coding this blind from my email account. >

[jQuery] Re: $.getJSON isn't working while getting the JSON data from hidden field

2009-03-18 Thread Steven Yang
yes $.getJSON does do eval internally so what your trying to accomplish is, trying to eval a string into javascript object but u dont want to write eval() everywhere right? or i misunderstood your question in anyway?

[jQuery] Re: $.getJSON isn't working while getting the JSON data from hidden field

2009-03-17 Thread Mohammed Arif
Steven, I am doing the same way as you said using eval and storing the string in JS variable. I may be wrong but as per my understanding $.getJSON also does eval() internally. Just wanted to do pure implementation only through $.getJSON without using eval() custom JS method. Thanks Mohammed Ari

[jQuery] Re: $.getJSON isn't working while getting the JSON data from hidden field

2009-03-17 Thread Steven Yang
Sorry if i am mistaken in anywaybut $.getJSON is suppose to be for getting JSON data from remote server or simply server, but not for you to eval a String into javascript object. And from the source of jQuery I believe it will simply to eval('('+json+')') anyway. And if you want to do it that way,

[jQuery] Re: .getJSon

2009-03-14 Thread finco
Thanks for the code snippet Josh. It's exactly what I was looking for. Certainly load works as well. At this point I am trying to understand various options for producing data on an intranet. In the past I have written asp pages which format the HTML and then use ajax (with or without jquery)

[jQuery] Re: .getJSon

2009-03-14 Thread Josh Powell
What I don't like about that method is the loss of ease of updating and reuse of code later on. If you stick it in a table coming back, and need the some data somewhere else you cannot reuse it. Also, changing things on server side requires recompiling in a java environment, which is a drag for

[jQuery] Re: .getJSon

2009-03-14 Thread donb
Then I must be missing something: $("#placetoinsert").load("path/to/url"); would do the same thing, with the tableHTML constructed on the server side. On Mar 14, 5:02 pm, Josh Powell wrote: > Because it puts it in the javascript and lets you easily manipulate it > with javascript.  If you get

[jQuery] Re: .getJSon

2009-03-14 Thread Josh Powell
Because it puts it in the javascript and lets you easily manipulate it with javascript. If you get html back from the server, it's more difficult to manipulate. $.getJson('path/to/url', function(data) { var tableHTML = ''; $.each(data.aaData, function() { tableHTML += '' + this

[jQuery] Re: .getJSon

2009-03-14 Thread donb
If that's all your going to do with it, why not return a table from the server and simply .load() it? No transformation required in that case. On Mar 14, 9:23 am, finco wrote: > Sorry if this is a duplicate post - doesn't look like the last one > went through. > > I've seen several examples of

[jQuery] Re: getJSON url variable broken

2009-03-08 Thread David Muir
My guess is that you could still do it if you globally set async to false. Wouldn't recommend it though. David James wrote: Yes, David is right. My example would not work. Sorry about that. For other jQuery AJAX functions, there's an option to set 'async' to false if you do want to let your

[jQuery] Re: getJSON being ignored

2009-03-06 Thread Hill
parentDiv.innerHTML = ''; / var header = document.createElement('h2'); header.innerHTML = 'Select Hold Baggage Carrier'; parentDiv.appendChild(header); /

[jQuery] Re: getJSON being ignored

2009-03-06 Thread Hill
parentDiv.innerHTML = ''; / var header = document.createElement('h2'); header.innerHTML = 'Select Hold Baggage Carrier'; parentDiv.appendChild(header); /

[jQuery] Re: getJSON being ignored

2009-03-06 Thread MorningZ
Well, it's for sure code related and how you wired up these events. But without seeing the code, it's very difficult to help diagnose On Mar 6, 1:15 pm, Hill wrote: > This is probably a simple problem, but I can't seem to find the fix. > > I have three getJSON events that work inside of a t

[jQuery] Re: getJSON url variable broken

2009-03-06 Thread James
Yes, David is right. My example would not work. Sorry about that. For other jQuery AJAX functions, there's an option to set 'async' to false if you do want to let your script halt until the AJAX response is received. I don't think there's an option for getJSON for that, so you'll have to do every

[jQuery] Re: getJSON url variable broken

2009-03-05 Thread David Muir
You need to include what you want to do within the callback: $(function(){ var youtubeurl; $.getJSON('data.inc.json', function(j){ youtubeurl = j.video_url; so = new SWFObject(j.video_url, "TEST", "498", "278", "9.0.28","#00", "true"); //etc... });

[jQuery] Re: getJSON url variable broken

2009-03-05 Thread josp
that's not the problem unfortunately, cause my real script is different. The problem must be connected to the way $.getJSON parses the data On 5 Mrz., 21:11, James wrote: > The scope of your youtubeurl variable exists only within the callback > function of your getJSON(). Set the variable ou

[jQuery] Re: getJSON url variable broken

2009-03-05 Thread James
The scope of your youtubeurl variable exists only within the callback function of your getJSON(). Set the variable outside first. $(function(){ var youtubeurl; $.getJSON('data.inc.json', function(j){ youtubeurl = j.video_url; }); so = new SWFObject(youtubeurl, "TES

[jQuery] Re: $.getJSON

2009-03-02 Thread Joseph Le Brech
My project has an example of getJSON() here. http://code.google.com/p/ajaxmmo/source/browse/trunk/src/static/default.js#105 > Date: Mon, 2 Mar 2009 03:12:34 -0800 > Subject: [jQuery] Re: $.getJSON > From: seas...@gmail.com > To: jquery-en@googlegroups.com > > >

[jQuery] Re: $.getJSON

2009-03-02 Thread Josh Powell
Using console.log and firebug will show you what everything is. console.log(data); $.each(data.records, function(i,item){ console.log(i); console.log(item); console.log(this); }); On Mar 2, 1:54 am, Alain Roger wrote: > On Mon, Mar 2, 2009 at 10:52 AM, Matt Quackenbush wrote: > > > > >

[jQuery] Re: $.getJSON

2009-03-02 Thread Alain Roger
On Mon, Mar 2, 2009 at 10:52 AM, Matt Quackenbush wrote: > Yes. > > > > On Mon, Mar 2, 2009 at 3:35 AM, Alain Roger wrote: > >> Hi Wil, >> >> so if i understood well, having the following JSON: >> >>> {"records":[{"id":1,"abbreviation":"fre","description":"french"},{"id":2,"abbreviation":"eng","de

[jQuery] Re: $.getJSON

2009-03-02 Thread Matt Quackenbush
Yes. On Mon, Mar 2, 2009 at 3:35 AM, Alain Roger wrote: > Hi Wil, > > so if i understood well, having the following JSON: > >> {"records":[{"id":1,"abbreviation":"fre","description":"french"},{"id":2,"abbreviation":"eng","description" >> :"english"},{"id":3,"abbreviation":"ger","description":"ge

[jQuery] Re: $.getJSON

2009-03-02 Thread Alain Roger
On Sun, Mar 1, 2009 at 9:59 PM, Wil Everts wrote: > > One of my favorite examples of this is the Flickr example on Visual > jQuery (http://remysharp.com/visual-jquery/). > > $.getJSON(" > http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback= > ?", >

[jQuery] Re: $.getJSON

2009-03-01 Thread Wil Everts
One of my favorite examples of this is the Flickr example on Visual jQuery (http://remysharp.com/visual-jquery/). $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?";, function(data){ $.each(data.items, function(i,item){ $

[jQuery] Re: getJSON IE7 problem- caching request/responses?

2009-02-17 Thread adexcube
You can try $.ajaxSetup ({ cache: false}); Cheers On 17 Feb, 13:26, Hernando Gisinger wrote: > May be $.postJSON work too!!! > > 2009/2/17 IanW > > > > > Sorry all, I've fixed this now by just appending the time on the end > > of the request to make it appear differerent to IE each time, this

[jQuery] Re: getJSON IE7 problem- caching request/responses?

2009-02-17 Thread Hernando Gisinger
May be $.postJSON work too!!! 2009/2/17 IanW > > Sorry all, I've fixed this now by just appending the time on the end > of the request to make it appear differerent to IE each time, this > seems to work! > > On Feb 17, 11:49 am, IanW wrote: > > Hi, > > I've got an application developed in ASP.N

[jQuery] Re: getJSON IE7 problem- caching request/responses?

2009-02-17 Thread IanW
Sorry all, I've fixed this now by just appending the time on the end of the request to make it appear differerent to IE each time, this seems to work! On Feb 17, 11:49 am, IanW wrote: > Hi, > I've got an application developed in ASP.NET MVC using jQuery to > handle JSON requests and responses. >

[jQuery] Re: getJSON how to manage objects.

2009-01-25 Thread Ricardo Tomasi
A JSON object can only contain either other objects, arrays, numbers or strings. In your case the #test is just a text string, not an element. So yes, you need to append it to the document so that it's parsed and becomes part of the DOM tree. But you can also create the element without appending i

[jQuery] Re: getJSON how to manage objects.

2009-01-25 Thread MorningZ
"how can i talk to an html object $('#test') that is in the JSON Object. " That doesn't make any sense $("#test") will be a DOM object, not a "JSON Object" On Jan 25, 2:35 pm, Trend-King wrote: > hello, i have another question about JSON i received the JSON Objekts > well, so my question

  1   2   >