cancel
Showing results for 
Search instead for 
Did you mean: 

JavaScript Fragments

NicolasPapaccio
Level 2
Hi everyone, i want to use Javascript code to my object.  Ex;  function maximizar(){ window.moveTo(0,0); window.resizeTo(screen.width,screen.height); } Documento sin título   to maximize the ie window. Any idea how should i write it in the data item?    Thanks,
4 REPLIES 4

DaveMorris
Level 14
If you need to maximize the IE window, you can use a navigate stage and use the action in it to maximize the window. I don't think this was always a feature in BP, so it may not be in older versions. I think I've used Win32 mode to spy the window and then one of the actions available in the navigate stage is Maximize.
Dave Morris 3Ci at Southern Company Atlanta, GA

NicolasPapaccio
Level 2
You are absolutely right about that David, but what i wanted to know actually is how i should type the syntax of a Javascript code in a data item, so i could run with ""JavaScript Fragment"" option.

DaveMorris
Level 14
1. Call the Navigate Stage action 'Insert JavaScript Fragment' using the root level element and in the input 'Fragment', pass in the function text: function maximizar(){ window.moveTo(0,0); window.resizeTo(screen.width,screen.height); } 2. Then call the Navigate Stage action 'Invoke JavaScript Function' with the following inputs, including the quotes: Function Name: ""maximizar"" Arguments: ""[{}]
Dave Morris 3Ci at Southern Company Atlanta, GA

AndreyKudinov
Level 10
I think you can just insert js fragment: window.moveTo(0,0); window.resizeTo(screen.width,screen.height); and it will get executed, no need to mess with calling a function, unless you need to pass parameters to existing one.