[Proto-Scripty] Re: sessvars
Thank you very much when you create your session object you use the follwing sessvars.myObj = {var1:, var2:0,} Can you add variables to this object at a later stage or do you have to declare all you varaibles at this stage. 2009/6/19 Rick Waldron waldron.r...@gmail.com Since no one else has replied, justly so as this is not a Prototype related question... I'm vaguely familiar with sessvars.js - what did you need help with? Rick On Fri, Jun 19, 2009 at 10:47 AM, cob brenda...@gmail.com wrote: Has anyone here used the sessvars lib, would like to ask a question if you have thx Boc --~--~-~--~~~---~--~~ 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: Autocompleter shifts results to the right in IE8
Hi David, It's the bog-standard way of centring content using CSS - in fact, it's probably used by 99% of web developers, it's that 'standard'. Given that, surely prototype and/or scriptaculous should be able to work with this technique? Dan On Jun 21, 11:04 pm, david david.brill...@gmail.com wrote: Hi Dan, the trouble is that you use the margin: 0px auto; in #centreWrapper CSS properties. To understand, try to change width of the viewport. By removing the attribute, it's well positionned. perhaps another way to center the div ?? -- --~--~-~--~~~---~--~~ 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] How to use bindAsEventListener to realize mouse click counter?
How to use bindAsEventListener to realize mouse click counter? The test code is as following: // function counter(){ } counter.counter1 = 1; // above is the static counter function wraphandler(e) { var tag = Event.element(e).tagName.toLowerCase(); var data = $A(arguments); data.shift(); document.writeln(this.name + 'Click on a ' + tag + '\nOther args: ' + data.join(', ') + '/br'); counter.counter1 = counter.counter1 + 1; document.writeln('counter1 = ' + counter.counter1.toString() + '/ br'); } Event.observe(document.body, 'click', wraphandler.bindAsEventListener (obj, 1, 2, 3)); // I hope that each time I click the body, the displayed counter1 increase 1. But the displayed counter1 doesn't change. --~--~-~--~~~---~--~~ 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] reg -Prototype window
Hi, I am using Prototype script.aculo.us in my application. I want to remain open the window which is already opened when i click some other link. can anyone help in this pls --~--~-~--~~~---~--~~ 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: Autocompleter shifts results to the right in IE8
Hi Dan, I'm not sure that it's a problem with scriptaculous or even prototype, but I think it's a trouble with IE (as proof, it works in all browsers, except IE). What I try to point is that if you remove this style it work as expected. What could you do now ?? perhaps try to find a way to reset this value at the level of the DIV that handle autocompleter result :)) btw, In kinow that is a standard way to center elemùent in a page, but IE doesn't like standard :(( -- david On 22 juin, 10:34, BillyRayPreachersSon billyraypreachers...@gmail.com wrote: Hi David, It's the bog-standard way of centring content using CSS - in fact, it's probably used by 99% of web developers, it's that 'standard'. Given that, surely prototype and/or scriptaculous should be able to work with this technique? Dan On Jun 21, 11:04 pm, david david.brill...@gmail.com wrote: Hi Dan, the trouble is that you use the margin: 0px auto; in #centreWrapper CSS properties. To understand, try to change width of the viewport. By removing the attribute, it's well positionned. perhaps another way to center the div ?? -- --~--~-~--~~~---~--~~ 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: reg -Prototype window
Any chance you could explain this better ? for a blank window use a href=http://www.google.com target=_blankClick Me/a !! - Original Message - From: sandhya sandhya2...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, June 22, 2009 4:46 AM Subject: [Proto-Scripty] reg -Prototype window Hi, I am using Prototype script.aculo.us in my application. I want to remain open the window which is already opened when i click some other link. can anyone help in this pls --~--~-~--~~~---~--~~ 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: Autocompleter shifts results to the right in IE8
Centering an element (left to right) is very easy with css #foo { width:200px; margin-left:auto; margin-right:auto; } div id=fooI am Centered!/div Alex - Original Message - From: david david.brill...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, June 22, 2009 11:36 AM Subject: [Proto-Scripty] Re: Autocompleter shifts results to the right in IE8 Hi Dan, I'm not sure that it's a problem with scriptaculous or even prototype, but I think it's a trouble with IE (as proof, it works in all browsers, except IE). What I try to point is that if you remove this style it work as expected. What could you do now ?? perhaps try to find a way to reset this value at the level of the DIV that handle autocompleter result :)) btw, In kinow that is a standard way to center elemùent in a page, but IE doesn't like standard :(( -- david On 22 juin, 10:34, BillyRayPreachersSon billyraypreachers...@gmail.com wrote: Hi David, It's the bog-standard way of centring content using CSS - in fact, it's probably used by 99% of web developers, it's that 'standard'. Given that, surely prototype and/or scriptaculous should be able to work with this technique? Dan On Jun 21, 11:04 pm, david david.brill...@gmail.com wrote: Hi Dan, the trouble is that you use the margin: 0px auto; in #centreWrapper CSS properties. To understand, try to change width of the viewport. By removing the attribute, it's well positionned. perhaps another way to center the div ?? -- --~--~-~--~~~---~--~~ 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: How to use bindAsEventListener to realize mouse click counter?
Hi Shumi, While giving you some doc reference, I just see that your code is the doc exemple of the binAsEventListener. So What I could do: var counter1=0; Event.observe(document.body, 'click', function(){counter1++;}); No need to bind to something. The binAsEventListener is used when you need to assign the 'this' value in your callback function. It is like the bind function but specifically to event callback. -- david On 22 juin, 05:00, Shumi jademobile2...@gmail.com wrote: How to use bindAsEventListener to realize mouse click counter? The test code is as following: // function counter(){} counter.counter1 = 1; // above is the static counter function wraphandler(e) { var tag = Event.element(e).tagName.toLowerCase(); var data = $A(arguments); data.shift(); document.writeln(this.name + 'Click on a ' + tag + '\nOther args: ' + data.join(', ') + '/br'); counter.counter1 = counter.counter1 + 1; document.writeln('counter1 = ' + counter.counter1.toString() + '/ br');} Event.observe(document.body, 'click', wraphandler.bindAsEventListener (obj, 1, 2, 3)); // I hope that each time I click the body, the displayed counter1 increase 1. But the displayed counter1 doesn't change. --~--~-~--~~~---~--~~ 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: Autocompleter shifts results to the right in IE8
Thanks for sticking with this, David... Remember that it works in IE 6 and IE 7, just not in IE 8. It also works in all other browsers which are 'standards compliant', so it's definitely an IE 8-only issue. Therefore it's probably something new that hasn't been catered for by either Prototype or scriptaculous, I'd say, and so they probably need to be updated to handle this very standard case in IE 8. Alex, I know how to centre a site - the code I posted does exactly what you've shown, so I'm not sure what you're trying to get at. Thanks, Dan --~--~-~--~~~---~--~~ 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: sessvars
Take a look at this demo they have posted: http://www.thomasfrank.se/sessvarsTestPage1.html Specifically, this: setName=function(f){ sessvars.username=f.elements[0].value; document.getElementById('enterYourName').style.display=none; alert('Welcome to this test of sessvars.js, '+sessvars.username+'!'); location.href=sessvarsTestPage2.html }; Notice they are declaring a brand new sessvar object called sessvar.username You can add new objects at anytime. Be sure you call in sessvars.js BEFORE prototype. Like... script type=text/javascript src=sessvars.js/script script type=text/javascript src=prototype.js/script In the head Rick On Mon, Jun 22, 2009 at 4:06 AM, Brendan O Connor brenda...@gmail.comwrote: Thank you very much when you create your session object you use the follwing sessvars.myObj = {var1:, var2:0,} Can you add variables to this object at a later stage or do you have to declare all you varaibles at this stage. 2009/6/19 Rick Waldron waldron.r...@gmail.com Since no one else has replied, justly so as this is not a Prototype related question... I'm vaguely familiar with sessvars.js - what did you need help with? Rick On Fri, Jun 19, 2009 at 10:47 AM, cob brenda...@gmail.com wrote: Has anyone here used the sessvars lib, would like to ask a question if you have thx Boc --~--~-~--~~~---~--~~ 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] mozilla firefox error when running Ajax.Request
I'm getting the following error when attempting to run Ajax.Request: Permission denied to get property XULElement.accessKey function saveLead(form) { var formSerialized = form.serialize(true); $('error').style.display = block; var file = 'http://ww.fakeurl.com/fakedir/fakefile.php'; new Ajax.Request(file, { method: 'post', parameters: formSerialized, onCreate: function() {$(error).innerHTML = Saving record.;}, onSuccess: function(response) { var returnXML = response.responseXML; var message = returnXML.getElementsByTagName(message) [0].childNodes[0].nodeValue; var success = returnXML.getElementsByTagName(success) [0].childNodes[0].nodeValue; var id = returnXML.getElementsByTagName(id)[0].childNodes [0].nodeValue; $(error).innerHTML = message; if (success == false) { $(error).style.color = #CC } else { $(error).style.color = #006633 } }, onFailure: function() { $(error).innerHTML = Save failed. Please contact support for further assistance.; } }); } It handles the onCreate fine but I think it bombs out on the onSuccess function. onFailure never gets executed. The file it is being submitted to is not on the same server or domain as the file that is doing the submitting. I'm thinking maybe firefox does not allow this type of scripting but I don't know. I absolutely have to be able to script across servers in this manner. Thoughts? Thanks in advance. --~--~-~--~~~---~--~~ 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: mozilla firefox error when running Ajax.Request
Hi, The file it is being submitted to is not on the same server or domain as the file that is doing the submitting. I'm thinking maybe firefox does not allow this type of scripting but I don't know. I absolutely have to be able to script across servers in this manner. Then you'll need to find a way around the Same Origin Policy[1], which is implemented in all browsers I'm aware of. There are workarounds, so if you search around you'll find various options, but they all have limitations as far as I know [which isn't that far ;-) ]. [1] http://en.wikipedia.org/wiki/Same_origin_policy HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 22, 1:39 pm, Jon creativefl...@gmail.com wrote: I'm getting the following error when attempting to run Ajax.Request: Permission denied to get property XULElement.accessKey function saveLead(form) { var formSerialized = form.serialize(true); $('error').style.display = block; var file = 'http://ww.fakeurl.com/fakedir/fakefile.php'; new Ajax.Request(file, { method: 'post', parameters: formSerialized, onCreate: function() {$(error).innerHTML = Saving record.;}, onSuccess: function(response) { var returnXML = response.responseXML; var message = returnXML.getElementsByTagName(message) [0].childNodes[0].nodeValue; var success = returnXML.getElementsByTagName(success) [0].childNodes[0].nodeValue; var id = returnXML.getElementsByTagName(id)[0].childNodes [0].nodeValue; $(error).innerHTML = message; if (success == false) { $(error).style.color = #CC } else { $(error).style.color = #006633 } }, onFailure: function() { $(error).innerHTML = Save failed. Please contact support for further assistance.; } }); } It handles the onCreate fine but I think it bombs out on the onSuccess function. onFailure never gets executed. The file it is being submitted to is not on the same server or domain as the file that is doing the submitting. I'm thinking maybe firefox does not allow this type of scripting but I don't know. I absolutely have to be able to script across servers in this manner. Thoughts? Thanks in advance. --~--~-~--~~~---~--~~ 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: mozilla firefox error when running Ajax.Request
You cannot do XDR (Cross domain requests) with ajax directly, you need to setup a wrapper or proxy on the server side to do the request!.. Sorry HTH Alex - Original Message - From: Jon creativefl...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, June 22, 2009 1:39 PM Subject: [Proto-Scripty] mozilla firefox error when running Ajax.Request I'm getting the following error when attempting to run Ajax.Request: Permission denied to get property XULElement.accessKey function saveLead(form) { var formSerialized = form.serialize(true); $('error').style.display = block; var file = 'http://ww.fakeurl.com/fakedir/fakefile.php'; new Ajax.Request(file, { method: 'post', parameters: formSerialized, onCreate: function() {$(error).innerHTML = Saving record.;}, onSuccess: function(response) { var returnXML = response.responseXML; var message = returnXML.getElementsByTagName(message) [0].childNodes[0].nodeValue; var success = returnXML.getElementsByTagName(success) [0].childNodes[0].nodeValue; var id = returnXML.getElementsByTagName(id)[0].childNodes [0].nodeValue; $(error).innerHTML = message; if (success == false) { $(error).style.color = #CC } else { $(error).style.color = #006633 } }, onFailure: function() { $(error).innerHTML = Save failed. Please contact support for further assistance.; } }); } It handles the onCreate fine but I think it bombs out on the onSuccess function. onFailure never gets executed. The file it is being submitted to is not on the same server or domain as the file that is doing the submitting. I'm thinking maybe firefox does not allow this type of scripting but I don't know. I absolutely have to be able to script across servers in this manner. Thoughts? Thanks in advance. --~--~-~--~~~---~--~~ 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: Effect.Morph syntax question
bump? On Jun 16, 2009, at 11:25 AM, Walter Lee Davis wrote: There's the simple method (these names are from the documentation in the Wiki): $('foo').morph('top:12px;') and the complex method: new Effect.Morph(foo,{style:'top:12px;',duration:0.5}); They work fine. Yet, from reading the code, I can't tell why I can't seem to use any parameters besides the style with the simple syntax. For example, this dies horribly: $('foo').morph({style:'top:12px;',duration:0.5}); Doesn't the methodize wrapper just shift the arguments over and send the callee to the function constructor? Thanks in advance, Walter --~--~-~--~~~---~--~~ 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] Can options in a selection box be made draggable...
Can the options in a selection box be made draggable (and dropable)? --~--~-~--~~~---~--~~ 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: Can options in a selection box be made draggable...
No ! - Original Message - From: Avram abas...@mitre.org To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, June 22, 2009 4:30 PM Subject: [Proto-Scripty] Can options in a selection box be made draggable... Can the options in a selection box be made draggable (and dropable)? --~--~-~--~~~---~--~~ 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: Autocompleter shifts results to the right in IE8
I'm experiencing this same problem in IE8, and like Dan, I've also tried various version of prototype including RC3. My HTML and CSS is significantly more complex than the test above and probably isn't worth posting, but I've been playing with difference CSS and so far I've been unable to find a workaround. I would vote for this to be fixed in a future release of script.aculo.us On Jun 22, 5:57 am, BillyRayPreachersSon billyraypreachers...@gmail.com wrote: Thanks for sticking with this, David... Remember that it works in IE 6 and IE 7, just not in IE 8. It also works in all other browsers which are 'standards compliant', so it's definitely an IE 8-only issue. Therefore it's probably something new that hasn't been catered for by either Prototype or scriptaculous, I'd say, and so they probably need to be updated to handle this very standard case in IE 8. Alex, I know how to centre a site - the code I posted does exactly what you've shown, so I'm not sure what you're trying to get at. Thanks, Dan --~--~-~--~~~---~--~~ 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] I can't work with xml files in prototype
Hi, I actually work with Slideshare API, php and prototype. I make a cURL call in php to consume a certain Slideshare API method, the php script return an xml result with the header header('Content-type: text/ xml'); I obtain a xml response, the current API does not returns json or other format. My ajax code is: new Ajax.Request('slideshare.php', { method: 'get', encoding: 'UTF-8', parameters: { query: myQuery, type: functionType }, onComplete: function(request){ var response = request.responseXML; widget.setEstadosService(response); var slidesLength = response.getElementsByTagName (Slideshow).length; if (slidesLength == 0){ $('estadoSlideshare_'+id).update('It is not exist results'); }else{ widget.setLimiteXmlOrJson(slidesLength); loadSlides(id); } } } In the end, the problem is not the response, neither php script or structure of ajax call. The problem is when I try to work and accede to XML file, I received the response with request.responseXML and when I try e.g.: var response = request.responseXML; //this no work :( alert(response.getElementsByTagName('Slideshow').childNodes [0].nodeValue); //this work alert(response.getElementsByTagName(Slideshow).length); I do not understand what happen. I tried changing nodeValue with data or text, but nothing. Also, I tried to parse XML response with: function loadXML(xmlFile){ var xmlDoc = new ActiveXObject(Microsoft.XMLDOM); xmlDoc.async=false; xmlDoc.onreadystatechange=function verify(){ if (xmlDoc.readyState != 4){ return false; } }; xmlDoc.load(xmlFile); var ticker=xmlDoc.documentElement; return ticker; } etc., etc., and other ways, but nothing function. Can you help me giving any links or tutoriales to work with XML files with prototype. I thank for your help. --~--~-~--~~~---~--~~ 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: mozilla firefox error when running Ajax.Request
I suggest you give JSONP a look, it's not implemented in Prototype unfortunately, but there are implementations around. On Jun 22, 7:34 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, The file it is being submitted to is not on the same server or domain as the file that is doing the submitting. I'm thinking maybe firefox does not allow this type of scripting but I don't know. I absolutely have to be able to script across servers in this manner. Then you'll need to find a way around the Same Origin Policy[1], which is implemented in all browsers I'm aware of. There are workarounds, so if you search around you'll find various options, but they all have limitations as far as I know [which isn't that far ;-) ]. [1]http://en.wikipedia.org/wiki/Same_origin_policy HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 22, 1:39 pm, Jon creativefl...@gmail.com wrote: I'm getting the following error when attempting to run Ajax.Request: Permission denied to get property XULElement.accessKey function saveLead(form) { var formSerialized = form.serialize(true); $('error').style.display = block; var file = 'http://ww.fakeurl.com/fakedir/fakefile.php'; new Ajax.Request(file, { method: 'post', parameters: formSerialized, onCreate: function() {$(error).innerHTML = Saving record.;}, onSuccess: function(response) { var returnXML = response.responseXML; var message = returnXML.getElementsByTagName(message) [0].childNodes[0].nodeValue; var success = returnXML.getElementsByTagName(success) [0].childNodes[0].nodeValue; var id = returnXML.getElementsByTagName(id)[0].childNodes [0].nodeValue; $(error).innerHTML = message; if (success == false) { $(error).style.color = #CC } else { $(error).style.color = #006633 } }, onFailure: function() { $(error).innerHTML = Save failed. Please contact support for further assistance.; } }); } It handles the onCreate fine but I think it bombs out on the onSuccess function. onFailure never gets executed. The file it is being submitted to is not on the same server or domain as the file that is doing the submitting. I'm thinking maybe firefox does not allow this type of scripting but I don't know. I absolutely have to be able to script across servers in this manner. Thoughts? Thanks in advance. --~--~-~--~~~---~--~~ 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] Last Weekends Adventure
I spent last weekend adding Spry to one of my web sites. I'm using Ruby On Rails and prototype with perhaps a bit of script.aculo.us in this web site. What attracted me to Spry is the region and repeat features. Lets us a table as an example. The basic idea is the page that is sent out has only the header and a single row. You have to put a div around the table to define the region. And the data row in the table has a repeat attribute in it. Somewhere you hook a data souce up to the region. In my case, I went back to my Rails server with a json request which sprewed out the selected items in a javascript array, each element being an item. The initial row has macros like {name} that get expanded to fields in the items. In my particular case, while a row only has 8 elements across, there are a lot of things in each td like hidden drop down lists, links, etc. The work to create a json row is small compared to the work to create the equivalent html row. What I see attractive with Spry is it moves the work of creating the html to the browser and offloads the server. There is just no reason for the server to be doing that work. My belief is that ultimately, moving the creation of the html to the browser is the way of the future. The server serves data. The view processing will eventually be done in the browser. There is no need for the server to do hard labor for the view processing. But I found Spry to be less than stellar. The main biggest issue is when I have a page with 1800 rows, it takes my Firefox about a half a minute of dead time to create the page and render it -- during that time, my whole laptop is dead pretty much with the dreaded spinning beachball. This half minute is divided into two parts I'm sure. Part of the time is Spry running creating the 1800 rows. I'll use the term fill out to refer to that process. Then there is the time for Firefox to actually render the page. I also found the package to not be very flexible and configurable. It has a sort feature but it has far fewer features than the tablesort.js file found on the net. So, it put me back to can I do this myself mode. A small side trace: I have seen the Rails cast where Ryan creates an endless page. My issue with that approach is that instead of one query, he makes N queries -- one for each page. That seems like it would add load to the server while I'm trying to take load away from the server. It seems like I could leverage prototypes template feature for most of the work. The main thing I would do different is make one request (like Spry) but I would only render the first page or two of rows. Then as the user scrolled, more data would be filled out hopefully before the user actually got to it. There are lots of problems to all this. How do you make the scroll bar act right? What do you do when the user does a search within the page? How do you handle a sort? As you add rows, the width of the columns may grow which is not expected. etc. But the essential concept is that all the data would be held as a javascript object and then the page filled out as it was needed. So, the question is, has anyone done something like this starting with Prototype? I sure don't want to recreate the wheel here. Is there any suggestion of other work that I can look at and build from? Is there any interest by any of the readers to help out? Thank you, pedz --~--~-~--~~~---~--~~ 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: I can't work with xml files in prototype
I found the solution. The solution is in http://groups.google.com.ec/group/prototype-scriptaculous/browse_thread/thread/37271ffc295fefbf/b8d47bc1f5cf8c66?lnk=gstq=xml#b8d47bc1f5cf8c66 in the first paragraph :D The problem was in the way to accede to XML file, the code syntax was bad. You must put attention with getElementsByTagName and childs. On 22 jun, 14:29, dy3g0s dy3...@gmail.com wrote: Hi, I actually work with Slideshare API, php and prototype. I make a cURL call in php to consume a certain Slideshare API method, the php script return an xml result with the header header('Content-type: text/ xml'); I obtain a xml response, the current API does not returns json or other format. My ajax code is: new Ajax.Request('slideshare.php', { method: 'get', encoding: 'UTF-8', parameters: { query: myQuery, type: functionType }, onComplete: function(request){ var response = request.responseXML; widget.setEstadosService(response); var slidesLength = response.getElementsByTagName (Slideshow).length; if (slidesLength == 0){ $('estadoSlideshare_'+id).update('It is not exist results'); }else{ widget.setLimiteXmlOrJson(slidesLength); loadSlides(id); } } } In the end, the problem is not the response, neither php script or structure of ajax call. The problem is when I try to work and accede to XML file, I received the response with request.responseXML and when I try e.g.: var response = request.responseXML; //this no work :( alert(response.getElementsByTagName('Slideshow').childNodes [0].nodeValue); //this work alert(response.getElementsByTagName(Slideshow).length); I do not understand what happen. I tried changing nodeValue with data or text, but nothing. Also, I tried to parse XML response with: function loadXML(xmlFile){ var xmlDoc = new ActiveXObject(Microsoft.XMLDOM); xmlDoc.async=false; xmlDoc.onreadystatechange=function verify(){ if (xmlDoc.readyState != 4){ return false; } }; xmlDoc.load(xmlFile); var ticker=xmlDoc.documentElement; return ticker; } etc., etc., and other ways, but nothing function. Can you help me giving any links or tutoriales to work with XML files with prototype. I thank for your help. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---