pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

PharoJs with JQuery/JQuery-ui

V
voxkmp@gmail.com
Fri, May 6, 2022 3:30 PM

Hi -

Can anyone give an example of how to use Jquery-ui in PharoJs?

I would like to use PharoJs to generate a page with a jquery-ui Slider widget and process its events through its slide function.

To give an illustration - what is the PharoJs equivalent to this javascript (in the $(document).ready function)?

$( "#slider" ).slider(  {  range: false,  min: 90,  max: 290,  value:100,

                slide: function( event, ui ) {

                $( "#gradeECF" ).html("ECF:" + ui.value);

                $( "#gradeElo" ).html( "Elo: " + (ui.value\*7.5 + 700));}

              }

            );

Thanks in advance for any help

Hi - Can anyone give an example of how to use Jquery-ui in PharoJs? I would like to use PharoJs to generate a page with a jquery-ui Slider widget and process its events through its slide function. To give an illustration - what is the PharoJs equivalent to this javascript (in the $(document).ready function)? $( "#slider" ).slider( { range: false, min: 90, max: 290, value:100, slide: function( event, ui ) { $( "#gradeECF" ).html("ECF:" + ui.value); $( "#gradeElo" ).html( "Elo: " + (ui.value\*7.5 + 700));} } ); Thanks in advance for any help
NB
Noury Bouraqadi
Mon, May 9, 2022 9:55 AM

Hi,

PharoJS exports vanilla JS. There is no support for JQuery.
Having said that, PharoJS allow writing Pharo code with references to JS globals. So, you can directly use JS APIs.
window
addEventListener: #load
block: [
window alert: 'Done Loading!!'.
console log: 'PharoJS signals end of loading']
Noury
On May 6 2022, at 5:30 pm, voxkmp@gmail.com wrote:

Hi -

Can anyone give an example of how to use Jquery-ui in PharoJs?
I would like to use PharoJs to generate a page with a jquery-ui Slider widget and process its events through its slide function.
To give an illustration - what is the PharoJs equivalent to this javascript (in the $(document).ready function)?
$( "#slider" ).slider( { range: false, min: 90, max: 290, value:100,
slide: function( event, ui ) {
$( "#gradeECF" ).html("ECF:" + ui.value);
$( "#gradeElo" ).html( "Elo: " + (ui.value*7.5 + 700));}
}
);
Thanks in advance for any help

Hi, PharoJS exports vanilla JS. There is no support for JQuery. Having said that, PharoJS allow writing Pharo code with references to JS globals. So, you can directly use JS APIs. window addEventListener: #load block: [ window alert: 'Done Loading!!'. console log: 'PharoJS signals end of loading'] Noury On May 6 2022, at 5:30 pm, voxkmp@gmail.com wrote: > Hi - > > Can anyone give an example of how to use Jquery-ui in PharoJs? > I would like to use PharoJs to generate a page with a jquery-ui Slider widget and process its events through its slide function. > To give an illustration - what is the PharoJs equivalent to this javascript (in the $(document).ready function)? > $( "#slider" ).slider( { range: false, min: 90, max: 290, value:100, > slide: function( event, ui ) { > $( "#gradeECF" ).html("ECF:" + ui.value); > $( "#gradeElo" ).html( "Elo: " + (ui.value*7.5 + 700));} > } > ); > Thanks in advance for any help
V
voxkmp@gmail.com
Mon, May 9, 2022 12:03 PM

Thanks

Thanks