on load script doesn't run?

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

on load script doesn't run?

Louis LaBrunda
Hi All,

I'm running a Squeak/Seaside program on a Raspberry Pi.  I'm trying to age a little javascript
to run on load.  I have ids set at the beginning of some tables like 'Pin13'.  When I generate
an anchor with #jumpSpot set to 'Pin13' and the on load script with the this code:

                        html anchor url: 'javascript:void(0)'; onClick: 'document.getElementById("', jumpSpot,
'").scrollIntoView(true)'; with: 'Jump to Spot'.
                        html document addLoadScriptFirst: 'document.getElementById(''', jumpSpot,
''').scrollIntoView(true)'.

clicking on the anchor works but the on load script doesn't seem to run.  What an I doing
wrong?

Lou
--
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

on load script doesn't run?

Louis LaBrunda
Hi,

Sorry, I forgot to include the generated HTML looks like this:

function
onLoad(){"document.getElementById('Pin13').scrollIntoView(true)";setInterval(function(){$("#id3").load("/RaspberryRelay",["_s=qyvVLpxhBS0O8e_M","_k=Lbuu-4MsT7qed6bV","2"].join("&"))},1000);};

I'm not sure I like the double quotes around the javascript I want to run on load but if that
is the problem, I don't know how to get rid of them?

Lou

On Mon, 13 Nov 2017 15:55:53 -0500, Louis LaBrunda <[hidden email]> wrote:

>Hi All,
>
>I'm running a Squeak/Seaside program on a Raspberry Pi.  I'm trying to age a little javascript
>to run on load.  I have ids set at the beginning of some tables like 'Pin13'.  When I generate
>an anchor with #jumpSpot set to 'Pin13' and the on load script with the this code:
>
> html anchor url: 'javascript:void(0)'; onClick: 'document.getElementById("', jumpSpot,
>'").scrollIntoView(true)'; with: 'Jump to Spot'.
> html document addLoadScriptFirst: 'document.getElementById(''', jumpSpot,
>''').scrollIntoView(true)'.
>
>clicking on the anchor works but the on load script doesn't seem to run.  What an I doing
>wrong?
>
>Lou
--
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: on load script doesn't run?

Paul DeBruicker
Hi Lou,

You need to use JSStreams to get the JS code rendered without the "'s

To do that change your:

 onClick: 'document.getElementById("', jumpSpot,'").scrollIntoView(true)';


to


 onClick: (JSStream on: 'document.getElementById("',
jumpSpot,'").scrollIntoView(true)');



and do the same thing with the #addLoadScriptFirst:


Hope this helps

Paul




Louis LaBrunda wrote

> Hi,
>
> Sorry, I forgot to include the generated HTML looks like this:
>
> function
> onLoad(){"document.getElementById('Pin13').scrollIntoView(true)";setInterval(function(){$("#id3").load("/RaspberryRelay",["_s=qyvVLpxhBS0O8e_M","_k=Lbuu-4MsT7qed6bV","2"].join("&"))},1000);};
>
> I'm not sure I like the double quotes around the javascript I want to run
> on load but if that
> is the problem, I don't know how to get rid of them?
>
> Lou
>
> On Mon, 13 Nov 2017 15:55:53 -0500, Louis LaBrunda &lt;

> Lou@

> &gt; wrote:
>
>>Hi All,
>>
>>I'm running a Squeak/Seaside program on a Raspberry Pi.  I'm trying to age
a little javascript
>>to run on load.  I have ids set at the beginning of some tables like
'Pin13'.  When I generate
>>an anchor with #jumpSpot set to 'Pin13' and the on load script with the
this code:
>>
>> html anchor url: 'javascript:void(0)'; onClick:
'document.getElementById("', jumpSpot,
>>'").scrollIntoView(true)'; with: 'Jump to Spot'.
>> html document addLoadScriptFirst: 'document.getElementById(''',
jumpSpot,
>>''').scrollIntoView(true)'.
>>
>>clicking on the anchor works but the on load script doesn't seem to run.
What an I doing

>>wrong?
>>
>>Lou
> --
> Louis LaBrunda
> Keystone Software Corp.
> SkypeMe callto://PhotonDemon
>
> _______________________________________________
> seaside mailing list

> seaside@.squeakfoundation

> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside





--
Sent from: http://forum.world.st/Seaside-General-f86180.html
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

on load script doesn't run?

Louis LaBrunda
Hi Paul,

Thanks, that fixed it.

Lou

On Mon, 13 Nov 2017 14:38:20 -0700 (MST), Paul DeBruicker <[hidden email]> wrote:

>Hi Lou,
>
>You need to use JSStreams to get the JS code rendered without the "'s
>
>To do that change your:
>
> onClick: 'document.getElementById("', jumpSpot,'").scrollIntoView(true)';
>
>
>to
>
>
> onClick: (JSStream on: 'document.getElementById("',
>jumpSpot,'").scrollIntoView(true)');
>
>
>
>and do the same thing with the #addLoadScriptFirst:
>
>
>Hope this helps
>
>Paul
>
>
>
>
>Louis LaBrunda wrote
>> Hi,
>>
>> Sorry, I forgot to include the generated HTML looks like this:
>>
>> function
>> onLoad(){"document.getElementById('Pin13').scrollIntoView(true)";setInterval(function(){$("#id3").load("/RaspberryRelay",["_s=qyvVLpxhBS0O8e_M","_k=Lbuu-4MsT7qed6bV","2"].join("&"))},1000);};
>>
>> I'm not sure I like the double quotes around the javascript I want to run
>> on load but if that
>> is the problem, I don't know how to get rid of them?
>>
>> Lou
>>
>> On Mon, 13 Nov 2017 15:55:53 -0500, Louis LaBrunda &lt;
>
>> Lou@
>
>> &gt; wrote:
>>
>>>Hi All,
>>>
>>>I'm running a Squeak/Seaside program on a Raspberry Pi.  I'm trying to age
>a little javascript
>>>to run on load.  I have ids set at the beginning of some tables like
>'Pin13'.  When I generate
>>>an anchor with #jumpSpot set to 'Pin13' and the on load script with the
>this code:
>>>
>>> html anchor url: 'javascript:void(0)'; onClick:
>'document.getElementById("', jumpSpot,
>>>'").scrollIntoView(true)'; with: 'Jump to Spot'.
>>> html document addLoadScriptFirst: 'document.getElementById(''',
>jumpSpot,
>>>''').scrollIntoView(true)'.
>>>
>>>clicking on the anchor works but the on load script doesn't seem to run.
>What an I doing
>>>wrong?
>>>
>>>Lou
>> --
>> Louis LaBrunda
>> Keystone Software Corp.
>> SkypeMe callto://PhotonDemon
>>
>> _______________________________________________
>> seaside mailing list
>
>> seaside@.squeakfoundation
>
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
--
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside