Ok nevermind I figured it out.

So the html file should just contain "myfunction({"json":"object"})"
and the html page catching should have
$.getJSON("http://www.simplifieddesign.biz/jsonTest.html?
myfunction=?");

function myfunction(data){
alert(data.json); // displays "object"
}

Make sure you have "?yourFunctionName=?
where yourFunctionName is the name of the sending html files
javascript function name.

That was my problem.

Thanks


On Jul 9, 3:48 pm, Wes Duff <[EMAIL PROTECTED]> wrote:
> Hello,
> I have read over almost every post in this group and still cannot
> figure this out. I am sure it has to do with the way I am creating my
> JSON object.
>
> Here is the file I am broadcasting the file 
> from.http://www.simplifieddesign.biz/jsonTest.html
>
> The source does not include any <html><head> or <body>
> just the json
>
> I did have var jsonObject = {"object1" : "test", "object2" : "test2"}
>
> and
>
> var jsonObject = ({"object1" : "test", "object2" : "test2"})
>
> Onhttp://example.com/develop/wduff/cols/default.html
> I have this script in the header
>
> $.ajax({url: "http://www.simplifieddesign.biz/jsonTest.html";,
>                                                 dataType: "jsonp",
>                                                 success: function(data, 
> textStatus) {
>                                                         alert(data.object1);
>                                                 },
>                                                 error: function(xhr, ts, err){
>                                                         alert('error' + err);
>                                                 }
>                                         });
>
>                         
> /*$.getJSON("http://www.simplifieddesign.biz/jsonTest.html?
> callback=?",function(json){
>                                 alert("JSON DATA");
>                                 });
>                         */
>
> As you can see I am trying both ways. Really I guess they are the
> same.
> I tried to put the same alert on both tries and it didnt work then I
> tried just calling an alert and the basic string alert does not even
> pull up.
>
> Any help would be appreciated. Thanks

Reply via email to