[Proto-Scripty] Re: Calling other website server url

2009-01-04 Thread julien Devouassoud
Look at : php file_get_contents

On Sat, Jan 3, 2009 at 6:15 PM, Jerod Venema jven...@gmail.com wrote:

 That said, there are ways around it. If you're just doing a GET request,
 and the other site is designed to allow it (or more likely, not designed NOT
 to allow it), you can simply inject the appropriate script tag in the
 header of your page

 On Sat, Jan 3, 2009 at 11:52 AM, T.J. Crowder t...@crowdersoftware.comwrote:


  Nope. Google single origin policy for the reason why.

 Or same origin policy.  Here's the top hit when you do:
 http://en.wikipedia.org/wiki/Same_origin_policy

 HTH,
 --
 T.J. Crowder
 tj / crowder software / com

 On Jan 3, 4:37 pm, Walter Lee Davis wa...@wdstudio.com wrote:
  Nope. Google single origin policy for the reason why.
 
  Walter
 
  On Jan 2, 2009, at 3:02 AM, Jagan wrote:
 
 
 
   I want to call different website url in ajax.request method. is it
   possible? is there any way to call
 
   Ex: i am in xyz.com/home.jsp. In this page i want to call new
   Ajax.Request('http://www.abc.com/result.jsp?id=1001')




 --
 Jerod Venema
 Frozen Mountain Software
 http://www.frozenmountain.com/
 919-368-5105


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Event.observer with mouseup?

2009-01-04 Thread Joe Athman

Another alternative is to use Prototype's Curry function which let's
you create new functions with default arguments.

So you could write:
Event.observe(window, 'mouseup', alert.curry('hi'));

Joe

As long as you know what curry does, I think this is more obvious for
really simple examples like this.

On Jan 3, 10:50 am, T.J. Crowder t...@crowdersoftware.com wrote:
  Also any reference to a function inside of an observer needs to be in
  the form of an anonymous function, not a literal function itself.

 Doesn't have to be anonymous.  Named functions are fine:

 function myMouseUpThingy() {
     alert('Howdy');

 }

 // later

 Event.observe(window, 'mouseup', myMouseUpThingy);

 The critical thing is that you need to pass in a function *reference*.

 -- T.J.

 On Jan 3, 4:45 pm, Walter Lee Davis wa...@wdstudio.com wrote:

  Try doing this instead:

  //put the following in a script block near the bottom of your html
  var foo = function(){ alert('howdy') };
  Event.observe(window,'mouseup',foo);

  Note that the function is called Event.observe, not Event.observer.  
  Also any reference to a function inside of an observer needs to be in  
  the form of an anonymous function, not a literal function itself. You  
  could have done this as well:

  Event.observe(window,'mouseup',function(){alert('howdy')});

  It's a subtle distinction, but it becomes much more important in a non-
  trivial example, because an anonymous function won't get its input  
  variables (and won't be called, either) until it is invoked. Then it  
  uncloaks, does its business, and vanishes again.

  Walter

  On Jan 2, 2009, at 1:30 PM, Per wrote:

   Hi,
   I'm new to protocoljs, but it's this thing I'm trying to do, and it
   doesn't work. It drives me mad.

   Anyway,
   I try to do this with protocoljs:
   body onmouseup=alert('hi');

   This was how I wrote it, but it doesn't work:
   Event.observer(window,'mouseup',alert('hi'));

   What is the right way to do it?

   Thank you!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: emptyFunction() calls take up to 30% of execution time

2009-01-04 Thread Niko

I think this will solve itself. If I understood the announcements on
Squirrelfish correctly, they are trying to inline small calls. So that
a call to emptyFunction would become a noop.



On 24 Dez. 2008, 21:35, npepinpe n.pepi...@gmail.com wrote:
 The Prototype.emptyFunction is just a dummy function; it doesn't
 actually do anything.

 emptyFunction: function() {}

 It's often used as a default option for callbacks and such, so that
 you can still call the callback even if the user hasn't specified
 anything. It shouldn't affect running time as it adds very minimal
 overhead.

 The only way I can see how to circumvent this would be a massive patch
 to Prototype to remove all references to Prototype.emptyFunction and
 instead have type checks before function calls which might be the
 emptyFunction. But maybe someone has a better idea.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Ajax.Updater doesn't work correctly in IE6

2009-01-04 Thread Vinny Carpenter

Hi there.  I have an application that uses Ajax.Updater to render some
data inside a div based on user input - This is fairly vanilla app
using Prototype 1.6.0.3 and the code of my simple page is listed here:

http://gist.github.com/42983

Now this Ajax.Updater call works correctly in IE 7, IE8 BETA, Firefox
2 and 3, Opera, Safari and even my iPhone safari browser :) but it
does not work correctly in IE6.  Unfortunately I still have a few
users that have IE6 on their desktops and I see 2 different types of
behavior.  In one instance, the browser crashes when Ajax.Updater
fires and in another instance, only part of the data is rendered.  I
have Fiddler (HTTP debugging proxy) running and I see the entire
payload delivered with an HTTP status of 200 but the browser chooses
to render just part of it.  And so either the browser crashes or it
doesn't work but the latest Prototype release does not seem like IE6.
The data coming back is HTML form data with input fields, checkboxes
and select boxes with some script data and I have evalScripts set to
true.

Is this a known issue?  Is there a fix or workaround for this?  I'd
hate to revert back to an earlier version of Prototype and miss out on
all the benefits of v1.6.0.3.  Any guidance would be greatly
appreciated.  Thank you

--Vinny

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Calling other website server url

2009-01-04 Thread Ryan Gahl
If the page/service you're trying to consume will only take POST requests,
you can make the Ajax call to _your_ server which then creates a proxy Http
call to the endpoint with the appropriate headers and whatnot. Most server
languages support this via some sort of HttpClient class.

I'm assuming julien's comment is along those lines, though I'm not a php
dude.

... and Jerod's solution will only work if the endpoint you're calling
returns javascript.



On Sun, Jan 4, 2009 at 3:25 AM, julien Devouassoud julien@gmail.comwrote:

 Look at : php file_get_contents


 On Sat, Jan 3, 2009 at 6:15 PM, Jerod Venema jven...@gmail.com wrote:

 That said, there are ways around it. If you're just doing a GET request,
 and the other site is designed to allow it (or more likely, not designed NOT
 to allow it), you can simply inject the appropriate script tag in the
 header of your page

 On Sat, Jan 3, 2009 at 11:52 AM, T.J. Crowder 
 t...@crowdersoftware.comwrote:


  Nope. Google single origin policy for the reason why.

 Or same origin policy.  Here's the top hit when you do:
 http://en.wikipedia.org/wiki/Same_origin_policy

 HTH,
 --
 T.J. Crowder
 tj / crowder software / com

 On Jan 3, 4:37 pm, Walter Lee Davis wa...@wdstudio.com wrote:
  Nope. Google single origin policy for the reason why.
 
  Walter
 
  On Jan 2, 2009, at 3:02 AM, Jagan wrote:
 
 
 
   I want to call different website url in ajax.request method. is it
   possible? is there any way to call
 
   Ex: i am in xyz.com/home.jsp. In this page i want to call new
   Ajax.Request('http://www.abc.com/result.jsp?id=1001')




 --
 Jerod Venema
 Frozen Mountain Software
 http://www.frozenmountain.com/
 919-368-5105





 



-- 
Ryan Gahl
CEO
Nth Penguin, LLC
http://www.nthpenguin.com
--
WebWidgetry.com / MashupStudio.com
Future Home of the World's First Complete Web Platform
--
Inquire: 1-920-574-2218
Blog: http://www.someElement.com
LinkedIn Profile: http://www.linkedin.com/in/ryangahl

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] window.createPopup() and permission denied

2009-01-04 Thread Bill in Kansas City

I've got a web application written in classic ASP that uses the
window.createPopup() method for context menus. When a menu item is
selected, the onClick for the item is parent.myFunction(). Note:
this is all one page: I'm not scripting across frames, iframes,
domains, anything; all one page, all one domain.

Been working great for two years.

I've introduced Prototype and Scriptaculous, and now this same code
produces a permission denied error. I've tried the following
scenarios:

onClick=alert('clicked!');   works fine
onClick=myFunction();   error: object required, of course
onClick=parent.myFunction();   error: permission denied

I've tried plugging in Proto.Menu, but it's not as plug'n'play as the
authors would like to think, and (as always) deadlines loom. Given
that there are several systems over which I have maintenance duties,
I'd just as soon not have to rewrite them all.

Is there a fix for this? Or a workaround? Something I'm missing?

Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Sortable tree

2009-01-04 Thread Niko

Ok, I am really not the biggest JS guru on the planet. Consider me a
newbie on SU and javascript.

So, alright, here is the big plan: I have my small to do list and I
want to be able to drag around items in the list. tasks can have
subtasks and that should be the end of the line. no sub sub tasks.

I am far away from realizing that. I think it might have been smarter
to implement this directly using SU's drag and drop abilities.
however, what i did try was forcing sortables to do what i want and i
did not come far. not only am i far away from realizing the 2-level
restriction; more importantly, i can't convince the library to allow
drops on empty items.

i gave them an empty sublist. i turned on drop on empty. i added a
display:none child element to the sublists. nothing!


in an ideal work, i would tackle the problem like this:

in happy world, sortables would allow leaves to get child nodes
without obstructions. i would set the only attribute to a class name,
and after every update, i would update the classes so that only
elements on the first level would have this class set, so nothing can
be dragged beyond level 2.

also, after every update, i would check if level 3 got created (could
happen( and would smoothe it back to level 2.

could someone give me a hand, please?

regards,

niko

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Event.observer with mouseup?

2009-01-04 Thread kangax



On Jan 4, 10:21 am, Joe Athman jjath...@gmail.com wrote:
 Another alternative is to use Prototype's Curry function which let's
 you create new functions with default arguments.

 So you could write:
 Event.observe(window, 'mouseup', alert.curry('hi'));

`alert.curry(hi)` won't work in IE, where `window.alert` is not an
instance of Function object and does not inherit from
`Function.prototype` (as, pretty much, any other JScript host method).
You can, of course, try to call `curry` from the `Function.prototype`
directly (`Function.prototype.curry.call(window.alert, 1)`), but since
`curry` internally tries to invoke `call` directly on a context
object, this will fail once again. It would work if Prototype.js was
invoking `call` from the `Function.prototype` rather than from the
context object `(Function.prototype.call.call(alert, window, 1))` but
it doesn't and it's not clear if such change is even worth the
trouble.

Never expect anything from host objects.


 Joe
 [...]

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Custom attributes or not custom attributes ?

2009-01-04 Thread RobG



On Dec 31 2008, 12:05 am, buda www...@pochta.ru wrote:
 But to store metadata in objects - is doing overjob - elements might
 be added or deleted or changed their style or state - and syncronyze
 elmenets state with their object mappers - is very hard and
 useless

It's not hard at all, and definitely not useless (after all, you want
to do it).

Consider that DOM elements are simply one way of displaying the data
in business objects.   Do all of your work with the objects, then send
the data to the screen to be viewed.  That model separates the
business logic from the display logic.

Of course there are some functions that are pure UI (e.g. sorting a
table or list) but others, like updating the table rows from a server,
should be done with an object, then written to the UI.

If you only have one table representing a single data object, it
probably doesn't matter if you just update the table directly using
AJAX or similar, but once you have a number of data objects and maybe
a number of different ways of displaying their content, you will want
to separate display from business logic.

--
Rob.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---