[Seaside] Re: Re: How to use jQuery get
Francisco Martins
chicoary at gmail.com
Sat Feb 18 21:38:14 UTC 2012
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,''<'').replace(/>/g,''>''))';
asFunction: #(data)
)
).
On Sat, Feb 18, 2012 at 7:12 PM, Francisco Martins <chicoary at gmail.com> 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,''<'').replace(/>/g,''>''))');
> asFunction: #(data)).
>
> On Sat, Feb 18, 2012 at 5:29 PM, Francisco Martins <chicoary at gmail.com> 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,''<'').replace(/>/g,''>''));';
>> yourself)).
>>
>> On Sat, Feb 18, 2012 at 3:14 PM, Francisco Martins <chicoary at gmail.com> 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,'<').replace(/>/g,'>'));
>>>> });"
>>>>
>>>> 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,''<'').replace(/>/g,''>''));'
>>>> )
>>>>
>>>> that generated the following
>>>>
>>>> $.get("dom.sample.html",function(){$('#sampleDOM').html(data);
>>>> $('#sampleDOMCode pre').html(data.replace(/</g,'<').replace(/>/g,'>'));});
>>>>
>>>> when it should generate
>>>>
>>>> $.get('dom.sample.html',function(data){$('#sampleDOM').html(data);
>>>> $('#sampleDOMCode
>>>> pre').html(data.replace(/</g,'<').replace(/>/g,'>'));});
>>>>
>>>> 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
More information about the seaside
mailing list