How to use jQuery get

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use jQuery get

chicoary
Again I'm playing around with the Seaside and the examples I found on
the book site of JQuery In Action, Second Edition.
I tried to render the code

"$.get(
          'dom.sample.html',
          function(data){
            $('#sampleDOM').html(data);
            $('#sampleDOMCode
pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));
          });"

with the following code

html jQuery get
        url: 'dom.sample.html';
        onSuccess: (
                JSStream new
                        nextPutAll: '$(''#sampleDOM'').html(data);';
                        nextPut: Character cr;
                        nextPutAll: '$(''#sampleDOMCode
pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''));'
                        )

that generated the following

$.get("dom.sample.html",function(){$('#sampleDOM').html(data);
$('#sampleDOMCode pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});

when it should generate

$.get('dom.sample.html',function(data){$('#sampleDOM').html(data);
$('#sampleDOMCode
pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});

I do not know how to make the argument "data" in "function (date)" is rendered.
Does anyone know?


Already thank you for your attention.

--
Sds.,

Francisco Ary Martins
http://chicoary.wordpress.com
----
"A filosofia não é senão uma poesia sofisticada."
Montaigne
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to use jQuery get

chicoary
Please, where is it written

"I do not know how to make the argument "data" in "function (date)" is
rendered."

read

"I do not know how to make the argument "data" in "function (data)" is
rendered."

> Again I'm playing around with the Seaside and the examples I found on
> the book site of JQuery In Action, Second Edition.
> I tried to render the code
>
> "$.get(
>          'dom.sample.html',
>          function(data){
>            $('#sampleDOM').html(data);
>            $('#sampleDOMCode
> pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));
>          });"
>
> with the following code
>
> html jQuery get
>        url: 'dom.sample.html';
>        onSuccess: (
>                JSStream new
>                        nextPutAll: '$(''#sampleDOM'').html(data);';
>                        nextPut: Character cr;
>                        nextPutAll: '$(''#sampleDOMCode
> pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''));'
>                        )
>
> that generated the following
>
> $.get("dom.sample.html",function(){$('#sampleDOM').html(data);
> $('#sampleDOMCode pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});
>
> when it should generate
>
> $.get('dom.sample.html',function(data){$('#sampleDOM').html(data);
> $('#sampleDOMCode
> pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});
>
> I do not know how to make the argument "data" in "function (date)" is rendered.
> Does anyone know?
>
>
> Already thank you for your attention.
>
> --
> Sds.,
>
> Francisco Ary Martins
> http://chicoary.wordpress.com
> ----
> "A filosofia não é senão uma poesia sofisticada."
> Montaigne



--
Sds.,

Francisco Ary Martins
http://chicoary.wordpress.com
----
"A filosofia não é senão uma poesia sofisticada."
Montaigne
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to use jQuery get

chicoary
After a poke around in the library I managed to solve the following code:

        html document addLoadScript: (
                html jQuery get
                        url: 'dom.sample.html';
                        onSuccess: (
                                (JSStream new asFunction: #(#data ))
                                        add: '$(''#sampleDOM'').html(data);';
                                  add: '$(''#sampleDOMCode
pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''));';
                                  yourself)).

On Sat, Feb 18, 2012 at 3:14 PM, Francisco Martins <[hidden email]> wrote:

> Please, where is it written
>
> "I do not know how to make the argument "data" in "function (date)" is
> rendered."
>
> read
>
> "I do not know how to make the argument "data" in "function (data)" is
> rendered."
>
>> Again I'm playing around with the Seaside and the examples I found on
>> the book site of JQuery In Action, Second Edition.
>> I tried to render the code
>>
>> "$.get(
>>          'dom.sample.html',
>>          function(data){
>>            $('#sampleDOM').html(data);
>>            $('#sampleDOMCode
>> pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));
>>          });"
>>
>> with the following code
>>
>> html jQuery get
>>        url: 'dom.sample.html';
>>        onSuccess: (
>>                JSStream new
>>                        nextPutAll: '$(''#sampleDOM'').html(data);';
>>                        nextPut: Character cr;
>>                        nextPutAll: '$(''#sampleDOMCode
>> pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''));'
>>                        )
>>
>> that generated the following
>>
>> $.get("dom.sample.html",function(){$('#sampleDOM').html(data);
>> $('#sampleDOMCode pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});
>>
>> when it should generate
>>
>> $.get('dom.sample.html',function(data){$('#sampleDOM').html(data);
>> $('#sampleDOMCode
>> pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});
>>
>> I do not know how to make the argument "data" in "function (date)" is rendered.
>> Does anyone know?
>>
>>
>> Already thank you for your attention.
>>
>> --
>> Sds.,
>>
>> Francisco Ary Martins
>> http://chicoary.wordpress.com
>> ----
>> "A filosofia não é senão uma poesia sofisticada."
>> Montaigne
>
>
>
> --
> Sds.,
>
> Francisco Ary Martins
> http://chicoary.wordpress.com
> ----
> "A filosofia não é senão uma poesia sofisticada."
> Montaigne



--
Sds.,

Francisco Ary Martins
http://chicoary.wordpress.com
----
"A filosofia não é senão uma poesia sofisticada."
Montaigne
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to use jQuery get

chicoary
I was not satisfied with what has been rendered prior to and modified
the code to:

html document addLoadScript: (
        html jQuery get
                url: 'dom.sample.html';
                onSuccess: (JSStream new
                        nextPutAll: '$(''#sampleDOM'').html(data);';
                        nextPut: Character cr;
                        nextPutAll: '$(''#sampleDOMCode
pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''))');
                        asFunction: #(data)).

On Sat, Feb 18, 2012 at 5:29 PM, Francisco Martins <[hidden email]> wrote:

> After a poke around in the library I managed to solve the following code:
>
>        html document addLoadScript: (
>                html jQuery get
>                        url: 'dom.sample.html';
>                        onSuccess: (
>                                (JSStream new asFunction: #(#data ))
>                                        add: '$(''#sampleDOM'').html(data);';
>                                        add: '$(''#sampleDOMCode
> pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''));';
>                                        yourself)).
>
> On Sat, Feb 18, 2012 at 3:14 PM, Francisco Martins <[hidden email]> wrote:
>> Please, where is it written
>>
>> "I do not know how to make the argument "data" in "function (date)" is
>> rendered."
>>
>> read
>>
>> "I do not know how to make the argument "data" in "function (data)" is
>> rendered."
>>
>>> Again I'm playing around with the Seaside and the examples I found on
>>> the book site of JQuery In Action, Second Edition.
>>> I tried to render the code
>>>
>>> "$.get(
>>>          'dom.sample.html',
>>>          function(data){
>>>            $('#sampleDOM').html(data);
>>>            $('#sampleDOMCode
>>> pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));
>>>          });"
>>>
>>> with the following code
>>>
>>> html jQuery get
>>>        url: 'dom.sample.html';
>>>        onSuccess: (
>>>                JSStream new
>>>                        nextPutAll: '$(''#sampleDOM'').html(data);';
>>>                        nextPut: Character cr;
>>>                        nextPutAll: '$(''#sampleDOMCode
>>> pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''));'
>>>                        )
>>>
>>> that generated the following
>>>
>>> $.get("dom.sample.html",function(){$('#sampleDOM').html(data);
>>> $('#sampleDOMCode pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});
>>>
>>> when it should generate
>>>
>>> $.get('dom.sample.html',function(data){$('#sampleDOM').html(data);
>>> $('#sampleDOMCode
>>> pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});
>>>
>>> I do not know how to make the argument "data" in "function (date)" is rendered.
>>> Does anyone know?
>>>
>>>
>>> Already thank you for your attention.
>>>
>>> --
>>> Sds.,
>>>
>>> Francisco Ary Martins
>>> http://chicoary.wordpress.com
>>> ----
>>> "A filosofia não é senão uma poesia sofisticada."
>>> Montaigne
>>
>>
>>
>> --
>> Sds.,
>>
>> Francisco Ary Martins
>> http://chicoary.wordpress.com
>> ----
>> "A filosofia não é senão uma poesia sofisticada."
>> Montaigne
>
>
>
> --
> Sds.,
>
> Francisco Ary Martins
> http://chicoary.wordpress.com
> ----
> "A filosofia não é senão uma poesia sofisticada."
> Montaigne



--
Sds.,

Francisco Ary Martins
http://chicoary.wordpress.com
----
"A filosofia não é senão uma poesia sofisticada."
Montaigne
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to use jQuery get

chicoary
Oooops ... I made a mistake by placing "asfunction: # (date)" in the cascade.
The correct code is below:

        html document addLoadScript: (
                html jQuery get
                        url: 'dom.sample.html';
                        onSuccess: (
                                JSStream new
                                        nextPutAll: '$(''#sampleDOM'').html(data);';
                                        nextPut: Character cr;
                                        nextPutAll: '$(''#sampleDOMCode
pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''))';
                                        asFunction: #(data)
                        )
        ).

On Sat, Feb 18, 2012 at 7:12 PM, Francisco Martins <[hidden email]> wrote:

> I was not satisfied with what has been rendered prior to and modified
> the code to:
>
> html document addLoadScript: (
>        html jQuery get
>                url: 'dom.sample.html';
>                onSuccess: (JSStream new
>                        nextPutAll: '$(''#sampleDOM'').html(data);';
>                        nextPut: Character cr;
>                        nextPutAll: '$(''#sampleDOMCode
> pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''))');
>                        asFunction: #(data)).
>
> On Sat, Feb 18, 2012 at 5:29 PM, Francisco Martins <[hidden email]> wrote:
>> After a poke around in the library I managed to solve the following code:
>>
>>        html document addLoadScript: (
>>                html jQuery get
>>                        url: 'dom.sample.html';
>>                        onSuccess: (
>>                                (JSStream new asFunction: #(#data ))
>>                                        add: '$(''#sampleDOM'').html(data);';
>>                                        add: '$(''#sampleDOMCode
>> pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''));';
>>                                        yourself)).
>>
>> On Sat, Feb 18, 2012 at 3:14 PM, Francisco Martins <[hidden email]> wrote:
>>> Please, where is it written
>>>
>>> "I do not know how to make the argument "data" in "function (date)" is
>>> rendered."
>>>
>>> read
>>>
>>> "I do not know how to make the argument "data" in "function (data)" is
>>> rendered."
>>>
>>>> Again I'm playing around with the Seaside and the examples I found on
>>>> the book site of JQuery In Action, Second Edition.
>>>> I tried to render the code
>>>>
>>>> "$.get(
>>>>          'dom.sample.html',
>>>>          function(data){
>>>>            $('#sampleDOM').html(data);
>>>>            $('#sampleDOMCode
>>>> pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));
>>>>          });"
>>>>
>>>> with the following code
>>>>
>>>> html jQuery get
>>>>        url: 'dom.sample.html';
>>>>        onSuccess: (
>>>>                JSStream new
>>>>                        nextPutAll: '$(''#sampleDOM'').html(data);';
>>>>                        nextPut: Character cr;
>>>>                        nextPutAll: '$(''#sampleDOMCode
>>>> pre'').html(data.replace(/</g,''&lt;'').replace(/>/g,''&gt;''));'
>>>>                        )
>>>>
>>>> that generated the following
>>>>
>>>> $.get("dom.sample.html",function(){$('#sampleDOM').html(data);
>>>> $('#sampleDOMCode pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});
>>>>
>>>> when it should generate
>>>>
>>>> $.get('dom.sample.html',function(data){$('#sampleDOM').html(data);
>>>> $('#sampleDOMCode
>>>> pre').html(data.replace(/</g,'&lt;').replace(/>/g,'&gt;'));});
>>>>
>>>> I do not know how to make the argument "data" in "function (date)" is rendered.
>>>> Does anyone know?
>>>>
>>>>
>>>> Already thank you for your attention.
>>>>
>>>> --
>>>> Sds.,
>>>>
>>>> Francisco Ary Martins
>>>> http://chicoary.wordpress.com
>>>> ----
>>>> "A filosofia não é senão uma poesia sofisticada."
>>>> Montaigne
>>>
>>>
>>>
>>> --
>>> Sds.,
>>>
>>> Francisco Ary Martins
>>> http://chicoary.wordpress.com
>>> ----
>>> "A filosofia não é senão uma poesia sofisticada."
>>> Montaigne
>>
>>
>>
>> --
>> Sds.,
>>
>> Francisco Ary Martins
>> http://chicoary.wordpress.com
>> ----
>> "A filosofia não é senão uma poesia sofisticada."
>> Montaigne
>
>
>
> --
> Sds.,
>
> Francisco Ary Martins
> http://chicoary.wordpress.com
> ----
> "A filosofia não é senão uma poesia sofisticada."
> Montaigne



--
Sds.,

Francisco Ary Martins
http://chicoary.wordpress.com
----
"A filosofia não é senão uma poesia sofisticada."
Montaigne
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside